Skip to content

fix: improve toolbar responsiveness#2761

Merged
caio-pizzol merged 3 commits intomainfrom
artem/SD-2328
Apr 22, 2026
Merged

fix: improve toolbar responsiveness#2761
caio-pizzol merged 3 commits intomainfrom
artem/SD-2328

Conversation

@artem-harbour
Copy link
Copy Markdown
Contributor

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

Linear: SD-2328

Improved responsiveness behavior relative to the container.

@artem-harbour artem-harbour self-assigned this Apr 9, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Apr 9, 2026

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: 3f42cfbffe

ℹ️ 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".

Comment thread packages/super-editor/src/editors/v1/components/toolbar/Toolbar.vue Outdated
@artem-harbour artem-harbour force-pushed the artem/SD-2328 branch 2 times, most recently from 2347225 to 902a38a Compare April 14, 2026 10:26
@artem-harbour
Copy link
Copy Markdown
Contributor Author

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

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 good direction on moving from CSS media queries to JS-driven compaction.

one blocking issue: the toolbar only recomputes on browser resize, not container resize — so side panels / layout changes leave it stale. reproduced: "Editing" button 387px outside the container. ResizeObserver fixes it.

also: the side-group check and the button-hiding check use different width sources, so they disagree under the default config. and the ticket asks for a regression test at the reproduction width — none added yet. left inline comments.

Comment thread packages/super-editor/src/editors/v1/components/toolbar/Toolbar.vue
Comment thread packages/super-editor/src/editors/v1/components/toolbar/Toolbar.vue Outdated
Comment thread packages/super-editor/src/editors/v1/components/toolbar/defaultItems.js Outdated
Comment thread packages/superdoc/src/dev/components/SuperdocDev.vue Outdated
@artem-harbour artem-harbour force-pushed the artem/SD-2328 branch 2 times, most recently from 7ed6fdd to 35e1d40 Compare April 15, 2026 12:11
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@artem-harbour artem-harbour force-pushed the artem/SD-2328 branch 2 times, most recently from 904baad to 74c412b Compare April 17, 2026 13:42
@artem-harbour
Copy link
Copy Markdown
Contributor Author

Note: Not sure why the test fails here, but locally it passes.
pnpm --filter @superdoc-testing/behavior test tests/toolbar/overflow-dropdown-label.spec.ts

@artem-harbour artem-harbour force-pushed the artem/SD-2328 branch 6 times, most recently from 8cb96c8 to b1e4b6d Compare April 22, 2026 10:01
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.

round 1 items all addressed, and i pushed the regression test at 84a3f22d. three inline comments, one worth fixing before merge.

Comment thread packages/super-editor/src/editors/v1/components/toolbar/Toolbar.vue Outdated
Comment thread packages/superdoc/src/dev/components/SuperdocDev.vue Outdated
Adds boundary and lifecycle coverage for the responsive toolbar fix:

- defaultItems.test.js: XL overflow cutoff (1429 vs 1430) and LG
  compact-class application (1280 vs 1281).
- Toolbar.test.js: positive ResizeObserver branch (constructor, observe,
  disconnect on unmount). Moves vi.unstubAllGlobals into afterEach so
  the stub doesn't leak on a thrown assertion.
- super-toolbar.test.js: getAvailableWidth branches on
  responsiveToContainer and falls back to 0 when no container is set.
- responsive-container-overflow.spec.ts: fixes a latent selector bug.
  The original descendant query never matched (class lives on the
  ButtonGroup root, not a descendant) so the minWidth assertion
  silently passed on null. Now uses a compound selector and asserts
  both side groups compact.
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.

hey @artem-harbour! thanks for addressing last round.

i pushed a follow-up commit with the missing tests and fixed a selector in the regression spec that was matching nothing.

lgtm once ci is green.

@caio-pizzol caio-pizzol enabled auto-merge (squash) April 22, 2026 19:07
@caio-pizzol caio-pizzol merged commit 3a53eb3 into main Apr 22, 2026
52 checks passed
@caio-pizzol caio-pizzol deleted the artem/SD-2328 branch April 22, 2026 19:11
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

🎉 This PR is included in template-builder v1.6.0-next.5

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

🎉 This PR is included in superdoc v1.28.0-next.5

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.5

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented Apr 22, 2026

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

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