Skip to content

Commit 5247889

Browse files
committed
docs(byo-ui): correct toolbar ids and comment scrollTo scope
Two factual fixes flagged in PR #3034 review: - toolbar-and-commands.mdx: the built-in command id table listed several ids that aren't on PublicToolbarItemId. strike → strikethrough, color → text-color, highlight → highlight-color, and the entire 'Block' row (heading-1/-2/-3, paragraph) is dropped because no block-level commands exist on this surface today. Replaced the table with the actual id set grouped by domain. - comments.mdx: the trade-off note claimed ui.comments.scrollTo is story-aware. CommentAddress is body-scoped in the contract — only TrackedChangeAddress carries a story field — so the call doesn't navigate to header/footer/note comments. Replaced with an honest description and pointer to ui.viewport.scrollIntoView for non-body cases.
1 parent 79c0cb2 commit 5247889

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

apps/docs/build-your-own-ui/comments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ All three return a Document API receipt. The next snapshot from `useSuperDocComm
140140
ui.comments.scrollTo(commentId);
141141
```
142142

143-
Scrolls the editor viewport to the comment's anchor. Story-aware: comments anchored in headers and footers route correctly.
143+
Scrolls the editor viewport to the comment's anchor. Body-scoped today: the comment-address contract carries no `story` field, so a comment anchored in a header, footer, or note doesn't navigate through this call. For now, scroll those manually via `ui.viewport.scrollIntoView({ target: ... })` once you've resolved the right address yourself.
144144

145145
## Threads and replies
146146

apps/docs/build-your-own-ui/toolbar-and-commands.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,18 @@ Common ids you'll wire to buttons:
107107

108108
| Group | Ids |
109109
|---|---|
110-
| Text | `bold`, `italic`, `underline`, `strike` |
110+
| Text | `bold`, `italic`, `underline`, `strikethrough` |
111+
| Inline | `link`, `font-family`, `font-size`, `text-color`, `highlight-color` |
112+
| Layout | `text-align`, `line-height`, `indent-increase`, `indent-decrease` |
111113
| Lists | `bullet-list`, `numbered-list` |
114+
| Style | `linked-style`, `clear-formatting`, `copy-format` |
112115
| History | `undo`, `redo` |
113-
| Block | `heading-1`, `heading-2`, `heading-3`, `paragraph` |
114-
| Inline | `link`, `font-family`, `font-size`, `color`, `highlight` |
115-
| Layout | `text-align`, `line-height` |
116+
| Tracked changes | `track-changes-accept-selection`, `track-changes-reject-selection` |
117+
| View | `ruler`, `zoom`, `document-mode` |
118+
| Tables | `table-insert`, `table-add-row-before`, `table-add-row-after`, `table-delete-row`, `table-add-column-before`, `table-add-column-after`, `table-delete-column`, `table-merge-cells`, `table-split-cell`, `table-delete` |
119+
| Insert | `image` |
116120

117-
The full list lives in the [headless toolbar reference](/modules/toolbar/headless#command-reference). Anything you can pass to `createHeadlessToolbar({ commands })` works as a `useSuperDocCommand` id.
121+
`PublicToolbarItemId` in `superdoc/ui` is the source of truth. Anything you can pass to `createHeadlessToolbar({ commands })` works as a `useSuperDocCommand` id.
118122

119123
## Aggregate snapshots
120124

0 commit comments

Comments
 (0)