Repository navigation
Dock phone selection actions and give the comment sheet detents - #474
Conversation
|
Review: Changes needed I checked this on a seeded build (iPhone 15 Pro emulation, plus 1280×800, 768×1024 and 420px with a mouse). Comment creation is unchanged: Must fix
Nice to have
Design feelThe bar matches the prototype's docked pill (Ask Chopin is left out for a good reason). The medium detent on a directly opened long thread feels right: half height, composer pinned, rubber-banding, and drag-to-large deepens the backdrop. The pager header is close to the 06 target. The two snap-point bugs above are what make it feel inconsistent: the sheet's height and dimming depend on which thread you paged from. Design-contract hash failure on |
|
Review: Changes needed (one small fix left) I re-checked head Verified fixed
Must fix
Nice to have (also on main)
|
On a phone, a text selection now raises a bottom action bar (Comment, Copy) docked above the safe area and any bottom chrome, instead of a floating format bubble that covered the next lines and mixed formatting with commenting. Desktop and wider touch screens keep the bubble. The phone comment sheet opens at a medium detent of the space above the keyboard, so its passage stays in view, and drags up to a large detent or down to dismiss. The reply composer stays on the visible edge at either detent, the backdrop deepens as the sheet rises, a pager steps through the document's threads, and send, Send to Chopin and the margin markers are full 44px targets. Comment creation is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctions A tap on a short sheet's header made the drawer report its only snap point as the large detent, so the next, longer thread opened full height with the passage hidden under it. Only a real pull now reaches the large detent, and each new thread opens at medium. The backdrop reads the drawer's progress only while dragging, so it no longer vanishes after paging from a two-detent thread to a one-detent one. The pager stops at its ends, and closing after paging returns focus and the document to the thread shown. A selection low on the screen scrolls clear of the docked bar, Copy announces through a status region, and button hover is gated to devices that can hover, so a tapped control does not stay grey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…election test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- packages/editor/src/comment-layer.tsx: adds a thread pager, a detent callback, a touch-only focus guard, and a margin touch-target span whose style is measured numeric geometry like the reviewed chip and hit styles; the reviewed preview/surface style and presence-class expressions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
319bab4 to
58f16b7
Compare
The selection bar from #474 now takes its gate from selectionOffer(), so a reader's lock no longer hides it; the reading spec asserts the bar itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selection bar from #474 now takes its gate from selectionOffer(), so a reader's lock no longer hides it; the reading spec asserts the bar itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selection bar from #474 now takes its gate from selectionOffer(), so a reader's lock no longer hides it; the reading spec asserts the bar itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
On phones, selecting text raised a floating formatting bubble under the selection that covered the next lines and mixed formatting with commenting (M-29). The comment sheet sized itself to its content, so with the keyboard open it covered the passage being discussed (M-31). Send was a 32px disc, Send to Chopin an 18px checkbox, and margin markers showed about 22px of target (M-26).
What changed
Presentation only. Comment creation is unchanged: the quote locator and server-minted positions are untouched.
--phone-bottom-chrome(defaults to 0, so the tab bar slice can claim room). It rides on the keyboard via the visual viewport, rises with a smooth-out transition and only fades under reduced motion. Bottom docking keeps it clear of iOS's own callout. It has no formatting buttons, because on a phone formatting belongs to the edit mode slice. Escape lets go of the selection, as before. Ask Chopin is left out because the app has no way to quote a selection into Chat yet.scroll-padding-bottom. The document's existing 60vh trailing space lets even the last line rise. "Copied" is announced through a visually hidden status region.btn-*hover backgrounds inapps/web/src/theme.cssare now inside@media (hover: hover), so a tapped button no longer stays grey on touch. Desktop is unchanged.packages/editor/src/phone.ts, ready to be replaced by the shared phone class.CopyIcon.Screenshots
iPhone 15 Pro, BEFORE (main, left) and AFTER (right).
Selection

New comment

Thread sheet

Reply with the keyboard open (viewport cut to 360px). This passage is the document title, and the tall top chrome leaves no room above the sheet. With a deeper passage it stays in view. The composer is pinned at the medium detent.

AFTER: medium detent (passage above), large detent (backdrop deeper), keyboard on a longer thread

AFTER: a selection near the bottom scrolls clear of the bar

Desktop is unchanged (bubble still floats over the selection)

Testing
bun run types: passesbun test packages/editor packages/icons: 683 pass. New unit tests cover the medium detent, including its floor.bun run ci: passes (after the hash renewal below)comment-sheet.e2e.tsadds these tests:toolbar.e2e.ts: the phone touch test now checks the action bar. A 768px touch test keeps the bubble coverage, and the bubble-follows-scroll test runs at 600px touch.responsive-comments.e2e.ts: the old check that the Comment icon is centred becomes an icon-plus-label check.Design-contract review
Reviewed and renewed in
Renew design-contract review hashes for comment-layer.tsx:packages/editor/src/comment-layer.tsx(both entries indynamic-editor.json). The only new style is the marginreachspan, which uses measured numeric geometry like the existing chip span; the reviewed preview/surface style and presence-class expressions are unchanged.Rebase notes
Main's comment-marker-line work changed the compact sheet key to depend on the marker. This PR's constant
"pinned"key is kept (it is what keeps the detent steady while paging across markers), along with main'sLineimport.Needs a real device
preventDefaultkeeps the native selection on iOS when Comment or Copy is tapped.🤖 Generated with Claude Code