Repository navigation
fix(toolbar): give each toolbar separator its own item - #3931
Closed
PopaSerban wants to merge 2 commits into
Closed
PopaSerban wants to merge 2 commits into
PopaSerban wants to merge 2 commits into
Conversation
`ButtonGroup.vue` keys its v-for on item.id.value. default-items.js created a single `separator` item and reused that same object six times in the toolbar list; since separators default to the "center" group, all six landed in one ButtonGroup sharing one id, so a re-render for that group patched a list with six duplicate keys (Vue's "Duplicate keys found during update" warning). Each separator occurrence now gets its own item via makeSeparator().
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Contributor
Author
|
Closing to reopen with a clean branch (no merge commit) — see replacement PR. |
superdoc-bot Bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
…elper (#3931) * refactor(superdoc): read UI host methods through a typed hostMethod helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(superdoc): record the Document API boundary counts the hostMethod refactor removes Reading `editCommands` and `getHandles` through `hostMethod` removes four `editCommands` references and one `getHandles(` call site from create-super-doc-ui.ts. The boundary inventory is an exact match, so a removal fails until it is recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(superdoc): count a host method the Document API guard reads by name `hostMethod(getHost(), 'getHandles')` moves the member name into a string, so the handles route stopped seeing two access points that are still bypasses. Count the quoted form, and rename the local binding in mirrorTrackedChangeFocusToHost so that site counts once rather than twice. The handles baseline returns to 16. editCommands stays at 13, which is fewer mentions of a local variable, not a removed access point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(superdoc): pin the host-call behavior the hostMethod refactor routes through Covers the paths the preflight check found untested, with fake hosts built the way the neighboring tests build them: - A class-based host whose getTableContext is a prototype method reading a private field, returning a snapshot that is not an object literal. This pins the Reflect.apply receiver and shows isPlainObject accepts a non-Object.prototype snapshot. - contextMenu.open reporting operation-unavailable for a missing surface, a surface without open, and a non-callable open; forwarding a known host reason and falling back for an unknown one; close swallowing a throwing surface. - The host review handle needing both getActiveReviewTarget and clearActiveReviewTarget before either is called. - selection.restore re-applying a well-formed captured cell target as a cell selection, and rejecting malformed points with target-unresolved without reaching the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Ported-From-Source-Repo: superdoc/orbit Ported-From-Source-Commit: 6afe4b3dd0e92c65d017a90e583dd1408bc182a9 Ported-Public-Prefix: superdoc/public
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.
Summary
ButtonGroupby givingeach separator in the built-in toolbar its own item, instead of reusing one
shared item six times (
packages/superdoc/src/internal/toolbar/built-in/default-items.js).UI layer only — no pipeline/document-data involvement.
Context
ButtonGroup.vuekeys itsv-foronitem.id.value.default-items.jscreated asingle
separatortoolbar item and spliced that same object into the toolbar listsix times; since separators default to the
centergroup, all six ended up in oneButtonGroupsharing oneid, so Vue re-render passes for that group patched alist with six duplicate keys.
The warning only surfaces on a re-render after the initial mount (Vue's duplicate-key
check runs in
patchKeyedChildren, not on first mount), which is why it doesn't showup right after page load — it needs a
toolbar-state-changeevent (e.g. clickinginto the document, changing selection, typing) to trigger the re-render.
Fix:
default-items.jsnow callsuseToolbarItem(...)fresh for each separatoroccurrence, giving each its own
id.packages/superdoc/src/internal/toolbar/built-in/default-items.jsseparatoritem →makeSeparator()factory, called at each of its 6 use sites