Repository navigation
fix(native-chat): seat the queued-message editor inside its queue row - #52002
Conversation
[Low impact] The PR appears safe to merge. SummaryThe queued-message editor now sits directly inside its queue row.
No actionable issues found. Tests and visual capture were not run; dependencies are not installed in this checkout. Reviews (3) · Last reviewed commit: "fix(native-chat): seat the queued-messag..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The inline queued-message editor mounts the full chat composer with an editSession, and NativeChatComposerField painted the dock's chrome (the bg-chat-pane strip, the gutter padding and the centred max-width column) for every non-launch composer. Inside the queue card that showed up as a darker, square-cornered band with uneven padding. Draw that chrome only when docked (!launch && !editSession). The edit session keeps data-composer-field and @container/composer-field so the toolbar measurement and card padding clamp still work. The edit card uses rounded-lg to match the queue card and starts one line tall (min-h-7, pointer-coarse:min-h-11). The pencil icon's -mr-0.5 puts the "Editing message" label on the rows' text column while keeping the other header gaps at 6px. Adds a component fixture for the editing state. Co-authored-by: Neil <[email protected]>
776a09c to
3693a89
Compare
ELI5
When you edit a message that's waiting in the queue, the edit box looked like the big chat box at the bottom of the screen. It sat in a darker band with extra padding and square corners, indented away from the other queued messages. Now it sits inside the queued message's own row, lined up with the rows around it. It starts one line tall and grows as you type.
What Changed
NativeChatQueuedMessageComposermounts the full chat composer with aneditSession.NativeChatComposerFieldpainted the dock's chrome on every composer that was not a launch prompt: thebg-chat-panestrip, thenative-chat-composer-gutter pt-2 pb-4padding and the centredmx-auto max-w-(--chat-content-max-width)column. A newdocked = !launch && !editSessionflag now limits that chrome to the docked composer. An edit session keepsdata-composer-fieldand@container/composer-field, because the toolbar writes--composer-atomic-widthonto that host and.native-chat-composer-cardclamps its padding against it.rounded-lg(the queue card's radius) instead ofrounded-xl. The editor usesmin-h-7(pointer-coarse:min-h-11, 44px) instead ofmin-h-12. It still grows to eight lines and then scrolls.-mr-0.5 shrink-0, so "Editing message" starts on the rows' text column. The gaps after the label (sender, image count) stay at 6px, as on main.native-chat/queue/editing/NativeChatQueuedMessageComposer(wide,narrowFromAgent), covers a state that otherwise only appears in a live agent session.Why
The editor reuses the real composer on purpose, so it gets the same input, menus, attachments and dictation. Only the outer chrome belongs to the dock, so this change ties that chrome to where the composer is hosted. A separate inline composer would duplicate the field. Styling around the band from the queue side would leave the dock padding in place.
Linked Issue
None. No existing issue tracks this; it was found while using the queue.
Visual Proof
Component fixture shots on main (left) and this branch (right).
Wide, dark:
Narrow, light, an agent's card with its sender:
Edge case, 300px wide with a 10-line message (it grows to eight lines, then scrolls; the overflow menu and Save still fit):
Testing
Reproduced headlessly with
pnpm fixtures:shot(scale 2, both themes) on macOS. For the before shots, the two source files were taken from main and the new fixture was kept. On main the band, the uneven padding and the inset card are visible. On this branch the editor is flush in the row.Regression sweep: 312 fixture shots (queue list including
onRealComposer/withRealComposer,NativeChatWorkerDock,NativeChatEmptyState,AgentLaunchPicker, and allnative-chat/composer/*, in both themes). 308 are byte-identical to main. The 4 that differ are the editing fixture's own shots. A main-vs-main re-shoot was also byte-identical, so the comparison is deterministic.Unit tests:
vitestonnative-chat/queueandnative-chat/composer(6 files, 25 tests) pass. An earlier fullnative-chatrun (68 files, 319 tests) also passed.oxlint,oxfmt --check, the anti-slop and code-quality oxlint configs,ast-grep, andcheck-changed-code-quality.mjsare all clean on the touched files.Not checked: the live Electron app, and the visual touch sizing (
pointer-coarse).No unit test was added. This is a class-name and layout change, and the fixture is the visual regression check (see test anti-patterns).
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None that matters, because this only changes class names.
NativeChatComposerFieldre-renders on each keystroke in the docked composer, and its host class now goes throughcn(). A Node microbenchmark (200k iterations, real clsx and tailwind-merge) measured that at about 0.1 µs per render, roughly 1/160000 of a 16 ms frame. There are no new effects, stores, selectors, memos, measurements, I/O or polling. Nothing scales with the number of tabs or rows: at N=200, a single update does the same work as on main.Risk
Level: Low
Class names in two renderer files, plus a dev-only fixture. Only the inline queued-message editor changes, because it is the only host that passes
editSession. The riskiest part is that the dock-fit measurement now sees a shorter editor, without the 24px of dock padding. That only gives the queue more room. One trade-off: the editor starts at 28px instead of 48px (44px on touch), so the empty click target on desktop is smaller. A plain revert undoes the change.Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Original fix by @luisgonzaleznf in #52002.