Repository navigation
feat: drag to reorder queued messages on desktop and phone - #34026
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 6

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
293fa84b-88b8-4f6f-aa2b-c4835b1c3843
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 50-
mobile/src/components/DragReorderList.test.tsxmobile/src/components/DragReorderList.tsxmobile/src/components/DragReorderRow.tsxmobile/src/components/drag-reorder-positions.test.tsmobile/src/components/drag-reorder-positions.tsmobile/src/session/MobileNativeChatOverlay.tsxmobile/src/session/MobileNativeChatQueuedMessages.test.tsxmobile/src/session/MobileNativeChatQueuedMessages.tsxmobile/src/session/MobileQueuedMessageCardRow.tsxmobile/src/session/MobileQueuedMessageScrollList.tsxmobile/src/session/mobile-structured-agent-session-host-support.tsmobile/src/session/mobile-structured-queued-message-cards.tsmobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.test.tsxmobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.tsmobile/src/session/use-mobile-queued-message-composer-actions.tsmobile/src/session/use-mobile-structured-agent-session-queued.test.tsxmobile/src/session/use-mobile-structured-agent-session.tsmobile/src/session/use-mobile-structured-queued-message-controls.tssrc/main/native-chat/agent-session-journal/command-receipt-schema.tssrc/main/native-chat/agent-session-journal/journal-queued-messages.tssrc/main/native-chat/agent-session-journal/queued-message-move.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-move.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-move.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-wiring.tssrc/main/runtime/mobile-rpc-allowlist.test.tssrc/main/runtime/rpc/methods/structured-agent-session-gate-classification.test-fixture.tssrc/main/runtime/rpc/methods/structured-agent-session-queued-methods.tssrc/main/runtime/rpc/methods/structured-agent-session-rpc.test-fixture.tssrc/main/runtime/rpc/methods/structured-agent-session-schemas.tssrc/main/runtime/runtime-rpc/runtime-rpc-mobile-agent-session-methods.tssrc/renderer/src/components/native-chat/NativeChatQueuedMessageCard.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageImageCount.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageList.inline-edit.test.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageList.test.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageRows.test.tsxsrc/renderer/src/components/native-chat/NativeChatQueuedMessageRows.tsxsrc/renderer/src/components/native-chat/structured-agent-session-view-contract.tssrc/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.tssrc/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.tssrc/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/structured-agent-session-host-capability.tssrc/shared/agent-session-queued-message-wire.tssrc/shared/agent-session-runtime-capabilities.tssrc/shared/protocol-version-published-capabilities.test.tssrc/shared/rpc-contract/structured-agent-session-queued-edit-params.ts
Files with no reviewable changes: 1-
- src/renderer/src/components/native-chat/NativeChatQueuedMessageList.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Major · Select the newest card from the displayed order. · use-structured-agent-session-queued-messages.ts:273
src/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.ts:273
🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSelect the newest card from the displayed order.
When an optimistic move changes the last card,
reordered.cardsshows the new order, butsteerNeweststill reads the original order fromcardsRef. If the user presses Cmd/Ctrl+Enter before the host publishes new cards, the shortcut can send a different message from the last one shown. Keep the shortcut’s selection aligned with the displayed cards, including while a move is pending. (raw.githubusercontent.com)

Minor · Scope pending move state to the session. · use-structured-agent-session-queued-reorder.ts:26-27
src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.ts:26-27
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winScope pending move state to the session.
If a move in session A remains pending when this mounted hook switches to session B,
busy.currentstays true andpendingstays true. Session B’s grips remain disabled, and a directmovecall silently returns until A’s request settles. Track the active move byscope, and let A’s completion clear only A’s state. (raw.githubusercontent.com)

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
53d60b99-967b-4b38-86b0-ce80670041e5
Files selected for processing: 5-
mobile/src/components/DragReorderList.test.tsxmobile/src/components/DragReorderRow.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.tssrc/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
|
Queued messages could not be reordered on desktop or phone. Every unsettled queued message now has the same desktop and phone grip, including keyboard and accessible Move up/Move down actions. The host moves all unsettled cards through the same relative-ID operation. Moving preserves sender, body, options and delivery holds; editing mail into a message sent as you remains separate work in #31180. Old hosts retain their current accepted operations and expose no reorder controls. The general queued-messages capability remains dark, but kept and agent-mail cards are visible today, so this ships reorder to those users. Full review and an independent architecture check completed. Sender-independent ordering uses the existing queue and replay operation without adding a durable field or a second protocol. A fresh reviewer returned AGREE with zero P0–P3 findings on the final head, including delivery eligibility, restart/receipt replay, all affected consumers and mixed versions. The final reference comparison is complete ( Verification includes actual-host moved-mail delivery, unchanged non-position row facts, held-mail skipping, journal reopen and idempotent replay with no message loss/duplication; older-phone Send and older-host capability contracts; desktop/native source, target, keyboard/accessibility and pending/preview tests. Ten targeted root tests passed; a test-only mock scope correction retained every assertion. Prior unaffected performance and whole-mechanism evidence carries, with changed sender admission and consumers reviewed first-hand. CI is green on Targeted branch-only desktop and phone captures completed on this exact head, with no conversational agents. The phone used a newly built iOS Debug app and the shipping MobileWebShell workspace route; the loaded bundle and all 143 assets matched the host. Both screenshots together show all four grips and preserved mail attribution. The 58-point contained touch area is a source/test contract; effective hit-testing, a live reorder gesture, provider delivery and lifecycle behavior were not exercised by these captures. Delivery/replay evidence comes from integration tests through the existing lifecycle mechanism. Capture observations: the phone composer initially covers mail and part of the preceding card; scrolling exposes mail but clips an upper row beneath the header. Development overlays and ellipsized text remain visible. The restored fixture says Queued/Steer and is not stopped-run lifecycle proof. An earlier Debug capture attempt crashed at startup; the later single launch and this rebuilt app completed, with no startup fix established. Desktop onboarding and an unexplained 8-pixel vertical shift, plus build/runtime warnings, are recorded in the QA report. No unrelated UI fix is included. All recorded QA processes are stopped, the owned simulator is shut down and both admissions are released. For Brennan’s review Desktop idle: the existing leading icon slot adds no hidden-grip gap. Desktop hover: every queued message can be dragged, including attributed agent mail. All four controls measured 20×28 pixels without moving the text. Phone queue and its scrolled continuation: every queued message has the same grip, including the attributed mail card. Full-device Debug captures include development overlays; the composer clips the lower cards initially, so the second view exposes mail. Unchanged desktop inline editor: reorder controls disappear while editing. This retained capture predates the all-message change; the editor behavior is unchanged. Judgment spots: position-only host permutation, desktop all-card controls, phone shared grip list. |





What changed
Every queued message can now be dragged into order on desktop and phone, including automatic agent mail. Desktop also supports immediate Up/Down moves from the focused grip; phone provides accessible Move up/Move down actions and edge scrolling. All unsettled cards use the same controls.
The general queued-messages capability remains dark, but kept-message and agent-mail queues are visible today. This ships reorder on those visible queues. Moving a message preserves its sender and delivery holds. Existing queue pauses still determine when messages send. Editing mail into a message sent as you is separate work tracked in #31180.
The desktop grip shares the queue icon’s existing leading slot and appears on hover or keyboard focus, so it adds no idle indentation or hover shift. The phone grip retains its contained 58-point touch area. Pending grips stay mounted and disabled; an open inline editor removes reorder controls consistently.
Split from #31180 at the lane owner's request. Main’s inline Edit remains in place; this PR adds no copy-delete editing, phone draft persistence, or editing capabilities.
Mechanism and compatibility
One host operation moves a message relative to a current neighbor ID across all unsettled cards. It permutes existing journal positions atomically and records the result, so retrying a spent operation cannot apply it again. Sender, body, delivery options and hold facts remain with their message. The host’s publications replace temporary client previews.
Old or unknown hosts expose no reorder control and accept no new operation. Existing queue actions and independently updated phones retain their current contracts; an older phone sees the host’s newly ordered cards through the existing feed. No saved field, migration, minimum server version or provider-specific behavior is added.
The common pattern resolves current identities at the host and changes order without changing message content. Intended adaptations retain the existing integer journal/replay contract, native phone gestures and bounded tray. Automatic mail is a first-class queued message with the same ordering controls.
Visual proof
Desktop idle: the existing leading icon slot adds no hidden-grip gap.
Desktop hover: every queued message can be dragged, including attributed agent mail. All four controls measured 20×28 pixels without moving the text.
Phone queue and its scrolled continuation: every queued message has the same grip, including the attributed mail card. Full-device Debug captures include development overlays; the composer clips the lower cards initially, so the second view exposes mail.
Unchanged desktop inline editor: reorder controls disappear while editing. This retained capture predates the all-message change; the editor behavior is unchanged.
Validation
Full review path because this changes ordering and an additive RPC with durable replay. Earlier review covered 216 host/consumer checks, renderer scroll/feedback/focus/editor contracts and real-scale operation counts. The all-message correction adds actual-host delivery from the moved mail card’s new position, complete non-position row preservation, held-mail skipping, reopen and receipt replay without loss or duplicate handoff. Ten targeted root tests passed, including the old-phone Send contract; renderer and mobile contracts cover mail as both source and neighbor, pointer/keyboard/accessibility controls, capability absence, pending state and preview settlement. A new test mock’s missing scope was repaired without changing production code or weakening assertions.
CI is green on
6b916bf6884e38679e59d9a8542b7f236b6a9c59: all 43 contexts passed or were skipped (26 success, 17 skipped), including root checks, Mobile verify, persistence and three WSL distributions. No retry was needed on this head.These flows take the tests row. The changed desktop queue row and shipping phone tray receive targeted branch screenshots with no conversational agents. Delivery/replay are integration-test evidence through the unchanged lifecycle mechanism; screenshots do not claim provider, lifecycle, effective hit-testing or gesture execution. Targeted branch-only desktop and phone captures completed on this exact head, with no conversational agents. The phone used a newly built iOS Debug app and the shipping MobileWebShell workspace route; the loaded bundle and all 143 assets matched the host. Both screenshots together show all four grips and preserved mail attribution. The 58-point contained touch area is a source/test contract; effective hit-testing, a live reorder gesture, provider delivery and lifecycle behavior were not exercised by these captures. Delivery/replay evidence comes from integration tests through the existing lifecycle mechanism.
Capture observations: the phone composer initially covers mail and part of the preceding card; scrolling exposes mail but clips an upper row beneath the header. Development overlays and ellipsized text remain visible. The restored fixture says Queued/Steer and is not stopped-run lifecycle proof. An earlier Debug capture attempt crashed at startup; the later single launch and this rebuilt app completed, with no startup fix established. Desktop onboarding and an unexplained 8-pixel vertical shift, plus build/runtime warnings, are recorded in the QA report. No unrelated UI fix is included. All recorded QA processes are stopped, the owned simulator is shut down and both admissions are released.
Review
Full review and an independent architecture check completed. Fixes addressed late feedback, phone touch geometry and measurement, pending grips, overlapping previews, keyboard instructions, arrival scrolling, repeated allocation and desktop indentation. The host and both clients use sender-independent ordering throughout.
A fresh reviewer returned AGREE with zero P0–P3 findings on the final head, including delivery eligibility, restart/receipt replay, all affected consumers and mixed versions. The final reference comparison is complete (
refs=done), with sender-independent ordering intended under Brennan’s 10-26 ruling; unchanged whole-mechanism and performance evidence carries.Agent skill upstream boundary
Not applicable: no upstream skill-installer source, registry or documentation is copied.