Repository navigation
🐛(frontend) show the sub-docs modal when duplicating a doc - #2860
Merged
Merged
Conversation
1 task done
Contributor
|
Size Change: 0 B Total Size: 4.08 MB 📦 View Changed
|
Ovgodd
approved these changes
Oct 21, 2026
AntoLC
force-pushed
the
fix/2797-duplicate-subdocs-modal
branch
from
October 21, 2026 09:05
883e71f to
3a4a2df
Compare
The sub-docs confirmation modal was not displayed in some cases when duplicating a document with sub-docs. Closes #2797 Signed-off-by: Anthony LC <[email protected]>
The sub-docs confirmation modal was skipped when duplicating a doc right after creating, deleting or moving one of its sub-docs: the duplicate action read a stale `numchild`. Two copies of the parent were out of date. The doc page keeps it cached for 30 seconds, and creating a sub-doc never invalidated it. The doc tree also keeps its own copy, which react-query invalidations do not reach, so it is now updated when a sub-doc is created, deleted or moved by drag and drop. The move updates the nodes in place before the move, as `updateNode` would bring the moved doc back under its old parent.
When a user below editor duplicates a sub-document, the backend creates the copy as a new root document owned by the user, since only editors and above can write in the tree. The frontend still inserted the copy in the displayed tree as a sibling of the original, showing a document that does not belong there. Only add the duplicate to the tree when the user can edit the document, and make the toast "Undo" action leave the tree alone in the other case.
AntoLC
force-pushed
the
fix/2797-duplicate-subdocs-modal
branch
from
October 21, 2026 11:46
3a4a2df to
84ce311
Compare
Merged
lunika
added a commit
that referenced
this pull request
Oct 21, 2026
Added - ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552 - 🌐(frontend) add Crowdin translator context #2785 - ✨(frontend) open the emoji picker when adding a document emoji #2777 Changed - 💄(frontend) limit heading choices to levels 1–3 - ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775 - 💄(frontend) update upload loader and error ui #2778 - ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853 - ♿️(frontend) allow opening the home button in a new tab #2839 - 💄(frontend) use 12px for error page home links #2809 Fixed - 🐛(frontend) don't add a reader's duplicate to the doc tree #2860 - 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860 - 🐛(frontend) wrap long unbroken document titles #2852 - 🐛(frontend) wrap long text in the print export #2813 - 🔒️(backend) bind comment thread to the path document on creation #2838 - 🐛(frontend) fix search highlight hidden inside code blocks #2681 - 🔒️(backend) require present document access for thread and comment writes #2840 - 🐛(backend) enforce resource server action restrictions on the external API #2745 - 🐛(backend) mark only the top duplicate as a copy, after its title #2855 - 🐛(yhub) measure migration durations with a monotonic clock #2814 - 🐛(backend) send the mention email when the cache is unreachable #2803 - 🐛(backend) give media-auth its own throttle scope - 💄(frontend) remove the vertical line next to nested blocks #2825
lunika
added a commit
that referenced
this pull request
Oct 21, 2026
Added - ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552 - 🌐(frontend) add Crowdin translator context #2785 - ✨(frontend) open the emoji picker when adding a document emoji #2777 Changed - 💄(frontend) limit heading choices to levels 1–3 - ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775 - 💄(frontend) update upload loader and error ui #2778 - ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853 - ♿️(frontend) allow opening the home button in a new tab #2839 - 💄(frontend) use 12px for error page home links #2809 Fixed - 🐛(frontend) don't add a reader's duplicate to the doc tree #2860 - 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860 - 🐛(frontend) wrap long unbroken document titles #2852 - 🐛(frontend) wrap long text in the print export #2813 - 🔒️(backend) bind comment thread to the path document on creation #2838 - 🐛(frontend) fix search highlight hidden inside code blocks #2681 - 🔒️(backend) require present document access for thread and comment writes #2840 - 🐛(backend) enforce resource server action restrictions on the external API #2745 - 🐛(backend) mark only the top duplicate as a copy, after its title #2855 - 🐛(yhub) measure migration durations with a monotonic clock #2814 - 🐛(backend) send the mention email when the cache is unreachable #2803 - 🐛(backend) give media-auth its own throttle scope - 💄(frontend) remove the vertical line next to nested blocks #2825
lunika
added a commit
that referenced
this pull request
Oct 21, 2026
Added - ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552 - 🌐(frontend) add Crowdin translator context #2785 - ✨(frontend) open the emoji picker when adding a document emoji #2777 Changed - 💄(frontend) limit heading choices to levels 1–3 - ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775 - 💄(frontend) update upload loader and error ui #2778 - ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853 - ♿️(frontend) allow opening the home button in a new tab #2839 - 💄(frontend) use 12px for error page home links #2809 Fixed - 🐛(frontend) don't add a reader's duplicate to the doc tree #2860 - 🐛(frontend) fix confirmation modal for duplicating sub-docs #2860 - 🐛(frontend) wrap long unbroken document titles #2852 - 🐛(frontend) wrap long text in the print export #2813 - 🔒️(backend) bind comment thread to the path document on creation #2838 - 🐛(frontend) fix search highlight hidden inside code blocks #2681 - 🔒️(backend) require present document access for thread and comment writes #2840 - 🐛(backend) enforce resource server action restrictions on the external API #2745 - 🐛(backend) mark only the top duplicate as a copy, after its title #2855 - 🐛(yhub) measure migration durations with a monotonic clock #2814 - 🐛(backend) send the mention email when the cache is unreachable #2803 - 🐛(backend) give media-auth its own throttle scope - 💄(frontend) remove the vertical line next to nested blocks #2825
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Duplicating a doc that has sub-docs sometimes skipped the confirmation modal and silently left the sub-docs out of the copy. The duplicate action was reading a stale
numchildof the parent, and a reader's duplicate was wrongly added to the doc tree.Proposal
numchildof the parent up to date when a sub-doc is created (doc page cache) and when it is created, deleted or moved in the doc tree