Skip to content

Keep the markup toolbar from setting its editor's width - #1503

Merged
amyjko merged 1 commit into
mainfrom
markup-toolbar-width
Nov 14, 2026
Merged

amyjko merged 1 commit into
mainfrom
markup-toolbar-width

Conversation

@amyjko

@amyjko amyjko commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Context

While reviewing #1502, I noticed that editing a tutorial bubble in localization mode opened an editor wider than the tutorial's dialog column, at every window width. The text ran on one line, and the part past the column edge was cut off, along with the new save status beside it.

Cause, measured in the browser:

  • A tutorial bubble sizes itself to its content.
  • The markup editor's toolbar is a no-wrap row of buttons, so its buttons (878px in all) stretched the bubble well past its 320px column.
  • OverflowToolbar decides how many buttons fit from its container's clientWidth. It measured that stretched width as room to spare and folded just enough buttons into ☰ to settle at about 505px. That state holds itself up.

The text itself was only 247px wide. It sat on one line only because the editor had been stretched.

What changed

MarkupToolbar wraps its OverflowToolbar in a div with contain: inline-size. The toolbar now takes the editor's width instead of setting it, and folds buttons into ☰ as designed.

This is scoped to the markup editor on purpose. The other seven OverflowToolbar users (Page, ProjectView, ProjectFooter, the code editor's Toolbar, GlyphInserter, InsertToolbar and the character page) may sit in content-sized boxes, where containment would collapse them. The fix covers every host of the markup editor: tutorial bubbles, inline docs, the chat composer, how-to forms and the localization workspace.

After the fix, the editor is 214px inside a 302px bubble, the text wraps, and ✓, ✕ and ☰ are all visible.

Verification

  • New e2e test in localize-annotations.spec.ts: it opens a tutorial bubble's editor in localization mode and asserts that the editor stays inside the dialog column and that ☰ shows. It failed before the fix (the editor's edge was at 600px, the column's at 329px) and passes after.
  • The chat, how-to form, localization, markup and IME composition e2e specs all pass (36 tests).
  • npm run check:now, npm run test:run, npm run rtl and npm run tokens pass.
  • Not fixed, and present before this change: in localization mode, a 💭 tooltip badge sticks 8px past the tutorial column, so the dialog can scroll sideways by a few pixels.

Checklist

  • CHANGELOG entry
  • e2e coverage for the geometry

🤖 Generated with Claude Code

A tutorial bubble sizes itself to its content, and the markup toolbar is a
no-wrap row of buttons, so the toolbar's 878px of buttons stretched the bubble
past its 320px column. OverflowToolbar then measured that stretched width as
room to spare and settled at ~505px, so text ran on one line and the part past
the column edge was cut off, along with the save status beside it.

Wrapping the toolbar in `contain: inline-size` makes it take the editor's
width, so it folds buttons into its menu as designed. Scoped to the markup
editor: the other seven OverflowToolbar users may sit in content-sized boxes,
where containment would collapse them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amyjko
amyjko merged commit 325d606 into main Nov 14, 2026
17 checks passed
@amyjko
amyjko deleted the markup-toolbar-width branch November 14, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant