Repository navigation
feat(toolbar): selection bubble v2, quick insert, grouped ⋯ and phone Insert sheet - #183
Merged
145 commits merged intoNov 22, 2026
Merged
145 commits merged into
145 commits merged into
Conversation
INSERT_KIND_CHOICE keeps the last 3 kinds (contract A19). The "/" menu leads with a Suggested section of the recent kinds that can run at the caret, each also in its own section; a query drops it and breaks rank ties toward recent kinds.
An empty query shows a "Type to search" ghost after the "/" when nothing follows the caret, and never during IME composition. A pinned footer teaches the active row's Markdown shortcut and has a Close button; the list is 320 px wide and anchors to the "/" on the content's start side. "New" badges are declared in the lazy chunk and ship empty.
The bar's Insert cell opens a bottom sheet instead of the desktop dropdown (spec §8.3, O6 a): the "/" menu's items as a two-column grid of 44px cells, Suggested (the remembered kinds) on top, then Blocks or Turn into (by whether the caret's block is empty), then Insert. Table and embed open their step inside the sheet from the lazy insert step chunk; Diagram lists the templates. A pick closes the sheet and focuses the editor inside the tap, so the caret lands in the new block. The sheet answers insert.open, so "/embed" on a phone opens it at the embed step. Both sheets pad 16px plus the safe area at the bottom, drawn as a 16px scroll fade.
On a fine pointer a + sits in the start margin of an empty top-level paragraph: beside the caret 300 ms after the last keystroke, or under the pointer after a 150 ms dwell, never during IME composition. A click types the "/" outside the undo history, so the ordinary "/" menu opens; Esc on its empty query removes that "/" again, and a pick stays one undo step. It lives in the slash chunk; the host renders it once the chunk has loaded.
The editor chunk must not grow, so SlashMenuHost renders nothing new: the lazy bubble chunk's desktop wrapper mounts EmptyLinePlus next to the status pill, and the + gates itself on a fine pointer. The New badge uses the muted tokens (the contrast test forbids --primary text).
Insert menu rows show the "/" alias that finds them ("/table"), and an
empty paragraph's placeholder reads "Type / for blocks". A contract
test checks that the "/" menu, the + and the Insert and phone list
cells name only registry ids and hard-code none of their labels, and
that every Markdown hint in "/" makes its block through the real input
rules. It caught the footer tip asking for no space after "-".
The Aa sheet leads with Style (spec §13.1, F16): Text and H1-H3, a More headings disclosure for H4-H6 (open when the current style is one of them), then the lists and Quote, the current one pressed. Colours follow, unchanged. On a touch tablet the row's unclear stand-ins get one fixed word each: Format, Layout and Block (O8 a). CSS only, from the lazy menu chunk, so the editor chunk group is unchanged; shown from an 832px row, where the row fits them in every context.
The embed step's link field raises the keyboard: the sheet now rides on it, like the bar, no taller than what it leaves, with the field kept in view. A pick refused since the sheet opened keeps the sheet open, says why on its own status line and redraws the cells with the reason. The insert.open frame is cancelled on unmount, so it never leaves the page inert. Suggested copies carry data-suggested.
The record of which "/" the + typed lives in the slash chunk only (the + reaches it with a dynamic import, so the bubble chunk has no copy of it), follows the trigger's own position and is dropped the moment the trigger closes, even before the menu mounts: a "/" typed later is never taken for it. The + re-derives its line from the DOM, so a collaborator's edit never leaves it on a stale position, wakes on a transaction only when something can change, and listens passively. insertKindOf returns an InsertKind; MAX_SUGGESTED and recentInsertKinds are exported for the phone Insert sheet.
# Conflicts: # docs/superpowers/specs/2026-11-13-smart-toolbar-v1-contract.md
Screenshots at 390 and 320 px (light, dark, RTL) and the tablet row at 820, 848 and 900 px, with main's before shots, and the changelog entry.
Shortcuts keep the row's direction around an inner ltr span, so in RTL they end at the row's inline end; their digits are tabular. Labels take dir=auto, so "All actions…" keeps its trailing ellipsis in RTL. More headings sits on the Turn into rows' grid. Text takes its icon from the registry, which drops the fallbacks in "/" and Turn into.
The disclosure wears Heading 4's registry icon at the rows' size, with their gap, border and type, so every Style label starts at one x. The RTL Insert check also keeps Table's chevron inside its cell.
…istry In the registry the icon put lucide's Type module in the editor chunk (+34 B gz). The lazy style-lift module, which every surface that shows text styles imports, installs it on the Text action instead; "/" keeps its own fallback, and the bubble's face reads it from the registry.
Installed from style-lift, which four lazy chunks share, the icon grew the editor chunk by about 960 B gz. The Aa sheet's chunk installs it on the registry's Text action instead (0 B); Turn into and the bubble's face keep their own fallback again.
Installed from a lazy chunk, the icon made a fourth lazy chunk import lucide's Type, which pulled about 950 B gz into the editor chunk. In the registry it costs about 7 B gz, and every surface, the bubble's face included, reads it there with no fallback of its own.
An open menu re-renders its rows on every store change, and each render ran the Code block and Quote dry runs again. They are cached per editor state, so an open menu runs them once unless the document or the selection changes.
Its icon in the registry grows the editor chunk by 7 B gz, and installed from lazy code by about 950 B. The fallbacks stay in Turn into, the bubble's face and "/"; the Aa sheet's Text row stays without an icon, as on main, and its check now covers the other labels.
Tiptap's focus() lands a frame later, so under load a ⌘A right after selectText went to the body and selected nothing in the editor.
# Conflicts: # CHANGELOG.md # docs/superpowers/specs/2026-11-13-smart-toolbar-v1-contract.md # tests/e2e/action-preview.spec.ts
Main's comments core registers comment.add but the web sandbox sets no comment gate, so the view reports a refusal and the bubble drew a disabled Comment after a separator. The slot now reads offered() as a boolean snapshot and renders nothing when it is false.
Turn into lifted the whole list item when the selected block was not its first, so the item's unselected first paragraph left the list too. Split the item around the selected block first, then lift only that block; the item's earlier blocks stay in the list and its later ones stay a list after it, in one undo step.
One page of before and after pairs for P1 to P4 against main 7b9fdc7, at 320, 390, 768, 820 and 1280 px in light, dark and RTL, with the owner's open decisions and a recommendation for each at the top.
HMarzban
marked this pull request as ready for review
November 22, 2026 13:55
# Conflicts: # CHANGELOG.md
The owner approved all seven review-page decisions as recommended on 2026-11-22. Spec §13.5 records them (decision 2 amends O4), §17 gains the submenu chevron, the bubble's comment icon (P5) and the Aa sheet's Text icon as follow-ups, and the review page's decisions box says so.
The Text style alignment test treated every digit-ending shortcut as one width. On Linux the lists' Ctrl+Shift+8 is wider than Ctrl+Alt+0, and rounding each edge apart turned a sub-pixel offset into 1 px, so CI failed while the menu was aligned. Compare the four style shortcuts' widths and every shortcut's inline end, unrounded, within half a pixel.
# Conflicts: # CHANGELOG.md
The bubble's face and Turn into imported lucide's Type from lib/icons, a module the editor chunk group also holds. After main's batch 10 (Find, Markdown paste) those two lazy import edges made Turbopack split the group's small modules across two files instead of one (+932 B gz, same raw bytes). A copy of the icon built with createLucideIcon renders the same SVG and keeps the group as on main; "/" still uses lucide's.
… editor chunk's exports Turn into imported TITLE_STYLE_REASON from core/blocks and "/" imported isInsertKind from remembered-choice, so the editor chunk exported both for lazy chunks (-23 B gz without them). Turn into keeps its own copy of the string, as it already does for "Not available in the title.", and "/" reads the same validator off INSERT_KIND_CHOICE.
The owner approved 26 B of editor-chunk growth for P1 to P4 on 2026-11-22: the style-lift hook, List and Quote in the style value and the phone Insert sheet's nested lazy load, measured 394,519 to 394,545 B gz on main 2764fb5. EDITOR_CHUNK_LEDGER_BYTES goes from 2,205 to 2,231 B, the details spec's D23 table and fence follow, and the CHANGELOG and contract A21 record the sizes and the Type icon copy.
…bular figures CI's Linux font has no tabular figures, so Ctrl+Alt+2 is a pixel narrower than Ctrl+Alt+0 while every shortcut still ends at one inline end. Keep the shared-end check exact and allow up to 1.5 px between the widths.
HMarzban
added a commit
that referenced
this pull request
Nov 22, 2026
f667af7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phases P1–P4 of the selection bubble and quick insert design (spec
docs/superpowers/specs/2026-11-17-bubble-and-quick-insert-design.md, approved 2026-11-17), as one integration PR. It holdsfeat/phone-insert-sheet(P4), which carriesfeat/overflow-groups(P3) andfeat/quick-insert(P2), plus P1 (feat/bubble-v2, with the colour rows and the keyboard settle) andmainat7b9fdc7.Style ▾ │ B I U S ‹› Tx │ A▁▾ 🔗 🖌.locales/en/actions.json).+in the margin of an empty line types the "/" for you.main's comments core registerscomment.add. The bubble shows Comment only where comments are offered, so the web sandbox is unchanged.Design review
docs/design/2026-11-17-bubble-quick-insert/review.htmlhas 67 before/after pairs againstmain7b9fdc7, at 320, 390, 768, 820 and 1280 px, in light, dark and RTL. The seven owner decisions are at the top, each with a recommendation. Do not merge until the owner has answered them.Budgets
Clean detached builds of
main7b9fdc7and this branch:mainSLASH_BUDGET=1test)Everything else is lazy: the bubble, menu, colour, slash and phone chunks, plus a new Insert sheet body chunk.
Test plan
bun run test: 3,607 pass, 0 fail.bun run typecheck,bun run lint,bun run i18n:check.bun run checkshows no errors; its 10 warnings are all in files this PR doesn't touch.mobile-bar-lazy-css.spec.tscharged to a paint-format test. That test passed 3 of 3 alone.