✨(frontend) Add "Copy link to block" feature - #2547
Conversation
|
Size Change: +1.98 kB (+0.05%) Total Size: 4.36 MB 📦 View Changed
|
b05dc92 to
2349aa5
Compare
|
@CodeRabbit review |
✅ Action performedReview finished.
|
We want to have our own side menu, so we can add more features to it and display the ui as we want. The new side menu is called DocsSideMenu and it will be used in the BlockNoteEditor.
WalkthroughThe document editor now uses a custom side menu with block-link copying, table controls, and deletion. Hash URLs scroll to the target block, including blocks rendered after navigation, and table-of-contents navigation reuses the same scrolling helper. Document saves triggered during unload or navigation use fetch keepalive, while periodic saves remain standard. End-to-end tests cover the side menu and copied-link navigation. Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/LinkToBlockItem.tsx`:
- Around line 21-24: Both LinkToBlockItem and TableHeaderSeparator duplicate the
hovered-block selector. Create a shared useSideMenuBlock hook that encapsulates
the SideMenuExtension useExtensionState call, then replace the inline selectors
in
src/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/LinkToBlockItem.tsx
lines 21-24 and
src/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/TableHeaderSeparator.tsx
lines 10-13 with that hook.
In `@src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx`:
- Around line 89-117: Update saveDoc and the onSave keepalive flow so
unload-triggered requests never send an unbounded Y.encodeStateAsUpdate(yDoc)
payload through updateDocContent. Add or reuse a bounded-payload write path for
keepalive saves, and preserve recent edits via the existing local/offline
persistence mechanism when the encoded content exceeds the keepalive limit;
retain the current full-content behavior for non-keepalive saves.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 382f17d5-676b-4f11-89b5-cb1033908501
⛔ Files ignored due to path filters (5)
src/frontend/apps/impress/src/assets/icons/ui-kit/color.svgis excluded by!**/*.svgsrc/frontend/apps/impress/src/assets/icons/ui-kit/link.svgis excluded by!**/*.svgsrc/frontend/apps/impress/src/assets/icons/ui-kit/table-header-column.svgis excluded by!**/*.svgsrc/frontend/apps/impress/src/assets/icons/ui-kit/table-header-row.svgis excluded by!**/*.svgsrc/frontend/apps/impress/src/assets/icons/ui-kit/trash.svgis excluded by!**/*.svg
📒 Files selected for processing (11)
CHANGELOG.mdsrc/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.tssrc/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsxsrc/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/DocsSideMenu.tsxsrc/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/LinkToBlockItem.tsxsrc/frontend/apps/impress/src/features/docs/doc-editor/components/DocsSideMenu/TableHeaderSeparator.tsxsrc/frontend/apps/impress/src/features/docs/doc-editor/hook/index.tssrc/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsxsrc/frontend/apps/impress/src/features/docs/doc-editor/hook/useScrollToBlockAnchor.tsxsrc/frontend/apps/impress/src/features/docs/doc-management/api/useDocContentUpdate.tsxsrc/frontend/apps/impress/src/features/docs/doc-table-content/components/Heading.tsx
2349aa5 to
3a4b8c1
Compare
We added a new feature that allows users to copy a link to a specific block within the document. We can copy the link to the block by clicking on the "Copy link to block" button in the block's menu in the document editor. When the link is pasted in the browser, it will automatically scroll to the block.
3a4b8c1 to
fadd616
Compare
Purpose
We added a new feature that allows users to copy a link to a specific block within the document.
We can copy the link to the block by clicking on the "Copy link to block" button in the block's menu in the document editor.
When the link is pasted in the browser, it will automatically scroll to the block.
Demo
Enregistrement.2026-07-30.160257.mp4