Add a compact text style selector to Content - #2601
Conversation
This comment has been minimized.
This comment has been minimized.
|
Here's a visual recap of what changed: Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
The latest commit addresses the remaining Escape-focus concern by handling onEscapeKeyDown, preventing Popover trigger autofocus for that dismissal path, and explicitly restoring editor focus. The prior mixed-selection repair remains intact through unconditional setParagraph(), while H5/H6 detection, selection replay, exact heading application, and pointer/keyboard activation are unchanged and covered by the expanded focused suite. Two independent code-review passes found no confirmed defects; one import-resolution report was verified as a false positive because the Content-local Popover wrapper exists. This remains a low-risk UI-only change.
Verification
- Focused BubbleToolbar tests: 11 passed according to the review agents.
- Content typecheck/build and guards are reported passing in the PR verification notes.
- No confirmed code-review findings remain.
🧪 Browser testing: Skipped — the dev server was healthy, but all browser executor retries lacked Chrome interaction tools, so the planned UI cases could not be executed.
* Add compact Content text style selector * Fix pointer selection in text style menu * Use native selector activation events * Handle legacy heading styles in text selector * Fix text style selector review findings * Fix text style selector Escape focus * Restore editor focus immediately on Escape

Problem
The Content selection toolbar exposed four permanent H1–H4 buttons but no way to return selected text to regular body text. The four controls also consumed a disproportionate amount of the compact toolbar.
Approach
Matched visual evidence
Before
Route:
http://127.0.0.1:3317/page/j4a5KAEDBHXYViewport:
1496 x 846, desktop ChromeFixture: disposable local account
toolbar-demo@example.com; pageToolbar comparison; paragraphSelect this sentence to compare the formatting toolbar.State: Personal expanded, agent panel closed, full paragraph selected, formatting bubble open, no submenu.
After
Route:
http://127.0.0.1:3317/page/vDisteHisXMqViewport:
1496 x 846, desktop ChromeFixture: same account, page title, paragraph, sidebar state, and agent-panel state. The route differs because the isolated worktree uses its own disposable local fixture database.
State: full paragraph selected, formatting bubble open, Text selector expanded, Text checked, H1–H4 visible.
The matched captures and their reproduction notes are retained in
templates/content/docs/solutions/evidence/content-text-selector/.Verification
Current head:
674ac20bfa72de62e273f80ca5eac97871128bd6, withmainat01881316a10e3626937d3268c594c986c78e9d85integrated after the repair.pnpm --filter content exec vitest --run app/components/editor/BubbleToolbar.test.tsx— 11 tests passed, including mixed paragraph/heading conversion, explicit Escape return-to-editor focus, applied-style editor-focus preservation, H5/H6 compatibility, and pointer/keyboard activation.pnpm --filter content typecheck— passed after refreshing the frozen workspace dependencies.pnpm --filter content build— passed; existing doctor findings about local production credentials and pre-existing environment reads remain non-blocking.pnpm test:content-product-impact— 30 tests passed.pnpm guards— all 51 checks passed.Sky Computer Use native pipe startup failed), and the collaborative preview did not reliably preserve its scripted selection after reload. The focused test now models Escape and close-autofocus separately and asserts botheditor.isFocusedand the ProseMirror DOM asdocument.activeElement; earlier independent browser QA covered pointer conversion, keyboard open/dismiss/selection, idempotent Text, accessibility semantics, clean console, and fixture restoration.Safety and review focus
Visual-review handoff
Steve's current guidance is to share screenshots of prominent UX changes asynchronously in
#dev-agent-native; it explicitly does not need to block shipping. Guidance thread: https://builder-internal.slack.com/archives/C0AKU9QD539/p1784744132830489?thread_ts=1784744132.830489&cid=C0AKU9QD539Original selector/highlight feedback: https://builder-internal.slack.com/archives/C0ATH3CCZT4/p1785450194911999
This PR prepares the evidence for that later review. It does not claim Slack visual approval, and it does not include the separate Notion-style highlight-color work or the later H5/H6-disable idea.