Skip to content

feat: toolbar to headless api (state and execute)#2757

Merged
caio-pizzol merged 5 commits intomainfrom
artem/headless-toolbar-migration-v1
Apr 15, 2026
Merged

feat: toolbar to headless api (state and execute)#2757
caio-pizzol merged 5 commits intomainfrom
artem/headless-toolbar-migration-v1

Conversation

@artem-harbour
Copy link
Copy Markdown
Contributor

@artem-harbour artem-harbour commented Apr 8, 2026

Linear: SD-2348.

Migrated toolbar to headless API (state and execute path).

Notes:

  • The link item is not migrated intentionally, as this is a special case and all the logic lives in the component (LinkInput.vue).
  • Some legacy logic has been moved to adapters (getFontFamilyFallbackValue, isFontSizeMixedState) rather than headless api for now.

@artem-harbour artem-harbour self-assigned this Apr 8, 2026
@artem-harbour artem-harbour added the don't merge Don't merge yet label Apr 8, 2026
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 8, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
SuperDoc 🟢 Ready View Preview Apr 8, 2026, 2:34 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@linear
Copy link
Copy Markdown

linear bot commented Apr 8, 2026

@artem-harbour artem-harbour force-pushed the artem/headless-toolbar-migration-v1 branch from 3687083 to bad1282 Compare April 8, 2026 16:23
@artem-harbour artem-harbour added ready for review and removed don't merge Don't merge yet labels Apr 8, 2026
@artem-harbour artem-harbour marked this pull request as ready for review April 8, 2026 16:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bad1282efc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@artem-harbour
Copy link
Copy Markdown
Contributor Author

@harbournick @caio-pizzol - please review this.

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artem-harbour clean migration, the routing is much easier to follow now. left a few inline comments.

two things to fix: toggling formatting on empty selections loses the toggle when you click away (sticky marks), and image upload errors no longer reach onException. also flagged three lists in constants.js that could get out of sync — easy to derive them from the maps.

test-wise: no coverage for destroy/cleanup and no test for hiding tracked-change buttons based on role. not blocking, good follow-ups.

@artem-harbour artem-harbour force-pushed the artem/headless-toolbar-migration-v1 branch from b1cc8d2 to 600a652 Compare April 14, 2026 12:20
@artem-harbour
Copy link
Copy Markdown
Contributor Author

@harbournick @caio-pizzol - please review and merge.

caio-pizzol and others added 4 commits April 14, 2026 17:35
…olbarState calls

- #scheduleRestoreEditorFocus now clears the previous pending timeout before
  scheduling a new one, preventing leaked timers on rapid clicks of items with
  restoreEditorFocus (list, numberedlist).
- Remove explicit toolbar.updateToolbarState() calls from #setModeEditing,
  #setModeSuggesting, and #setModeViewing. The headless toolbar already
  subscribes to document-mode-change and updates the snapshot automatically.
…ge cases

- Add tests for #applyHeadlessState adapter branches: textAlign, lineHeight,
  zoom (number→percentage string), link (active + href), color, highlight,
  fontSize mixed-state, and tableActions enable/disable aggregation.
- Add headless test for text-color "none" payload (converts to "inherit" for
  the inline command and null for field annotations).
- Add headless tests for createZoomExecute string payloads ("150", "150%")
  and rejection of invalid payloads (non-numeric, zero, negative).
…ge upload errors

The Editor's 'exception' event payload type is { error, editor }. Adding
'originalError' caused TS2353 in CI. Inline the original message into the
wrapped Error instead and keep the original error in the console.error log.
@caio-pizzol caio-pizzol enabled auto-merge April 15, 2026 00:41
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artem-harbour everything from last round is fixed, nice work.

i pushed three small commits:

  • 512a46e: clear pending focus timer on rapid clicks, drop redundant updateToolbarState() calls in mode setters
  • f9e22b8: tests for the headless adapter branches (textAlign, lineHeight, zoom, link, color, highlight, fontSize mixed, tableActions), plus zoom string handling and text-color "none"
  • b5e1c41: fix the CI type error — Editor's exception event payload doesn't accept originalError, so i merged the original message into the wrapped Error

lgtm now.

@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 8075858 Apr 15, 2026
52 of 55 checks passed
@caio-pizzol caio-pizzol deleted the artem/headless-toolbar-migration-v1 branch April 15, 2026 00:47
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.14

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.17

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in esign v2.3.0-next.17

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in template-builder v1.5.0-next.17

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in superdoc v1.26.0-next.17

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in superdoc-cli v0.7.0-next.18

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 15, 2026

🎉 This PR is included in superdoc-sdk v1.6.0-next.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants