Skip to content

feat: drag to reorder queued messages on desktop and phone - #34026

Merged
brennanb2025 merged 20 commits into
mainfrom
brennanb2025/queue-reorder
Oct 27, 2026
Merged

brennanb2025 merged 20 commits into
mainfrom
brennanb2025/queue-reorder

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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 queue at rest

Desktop hover: every queued message can be dragged, including attributed agent mail. All four controls measured 20×28 pixels without moving the text.

Agent-mail grip on desktop

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.

Phone queue

Phone queue scrolled to agent mail

Unchanged desktop inline editor: reorder controls disappear while editing. This retained capture predates the all-message change; the editor behavior is unchanged.

Desktop inline editor

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.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The change adds capability-gated queued-message moves through the journal and RPC. Move requests use before-or-after anchors and return a status. Mobile adds measured-height drag rows, protected-slot handling, and accessibility move actions. The renderer adds pointer and keyboard reordering with optimistic previews. Tests cover move outcomes, interaction behavior, and state updates.

Priority: Normal

Merge Risk: Moderate · up to ae5aa

A reorder can make the send-newest shortcut choose a different message from the one shown last. Session switching can temporarily block moves, while desktop accessibility guidance and several mobile reorder interactions remain inconsistent. Resolve or explicitly accept these risks before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the template's main sections (ELI5 is absent, but What Changed, Why/Mechanism, Visual Proof, Testing/Validation, Review, and Agent skill upstream boundary are present). It give… Add an ELI5 section in plain language. Add a 'Fixes #' line that links a real issue for this PR, because the template says an outside contributor's PR is ignored without one. Tick or annotate the Testing checkboxes to show which manual and …
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: adding drag-based queued-message reordering on desktop and mobile.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the template's main sections (ELI5 is absent, but What Changed, Why/Mechanism, Visual Proof, Testing/Validation, Review, and Agent skill upstream boundary are present). It gives a detailed account of the desktop and phone reorder behavior, the host operation, compatibility, and evidence. Gaps: the template's ELI5 section is missing, the 'Linked Issue' section has no 'Fixes #' issue reference (the description cites #31180 and a split from it, but that is not a linked issue for the PR itself), the Testing checkboxes are not ticked, and the AI Disclosure section is absent. The Visual Proof section is present but includes caveats about dev overlays and a crashed earlier capture. The Validation and Review text is long and dense, with many references to internal lanes and rulings that a reviewer cannot verify from the PR itself.

Resolution

Add an ELI5 section in plain language. Add a 'Fixes #' line that links a real issue for this PR, because the template says an outside contributor's PR is ignored without one. Tick or annotate the Testing checkboxes to show which manual and automated checks were run and on which platforms (macOS, Linux, Windows, SSH). Fill the AI Disclosure section unless the author is a StablyAI team member. Shorten the Validation and Review sections and replace references to internal lanes, rulings, and QA reports with reviewable evidence. Mark the Checklist items that apply. Confirm the mobile and desktop screenshots are the before/after pairs the template asks for, and state the before state for the phone and desktop views.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Commits

Reviewing files that changed from the base of the PR and between 532f6a0 and 46d00fc.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 50
  • mobile/src/components/DragReorderList.test.tsx
  • mobile/src/components/DragReorderList.tsx
  • mobile/src/components/DragReorderRow.tsx
  • mobile/src/components/drag-reorder-positions.test.ts
  • mobile/src/components/drag-reorder-positions.ts
  • mobile/src/session/MobileNativeChatOverlay.tsx
  • mobile/src/session/MobileNativeChatQueuedMessages.test.tsx
  • mobile/src/session/MobileNativeChatQueuedMessages.tsx
  • mobile/src/session/MobileQueuedMessageCardRow.tsx
  • mobile/src/session/MobileQueuedMessageScrollList.tsx
  • mobile/src/session/mobile-structured-agent-session-host-support.ts
  • mobile/src/session/mobile-structured-queued-message-cards.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.test.tsx
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.ts
  • mobile/src/session/use-mobile-queued-message-composer-actions.ts
  • mobile/src/session/use-mobile-structured-agent-session-queued.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-structured-queued-message-controls.ts
  • src/main/native-chat/agent-session-journal/command-receipt-schema.ts
  • src/main/native-chat/agent-session-journal/journal-queued-messages.ts
  • src/main/native-chat/agent-session-journal/queued-message-move.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-move.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-move.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-wiring.ts
  • src/main/runtime/mobile-rpc-allowlist.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-gate-classification.test-fixture.ts
  • src/main/runtime/rpc/methods/structured-agent-session-queued-methods.ts
  • src/main/runtime/rpc/methods/structured-agent-session-rpc.test-fixture.ts
  • src/main/runtime/rpc/methods/structured-agent-session-schemas.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-mobile-agent-session-methods.ts
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageCard.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageImageCount.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.inline-edit.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageRows.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageRows.tsx
  • src/renderer/src/components/native-chat/structured-agent-session-view-contract.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.test.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/structured-agent-session-host-capability.ts
  • src/shared/agent-session-queued-message-wire.ts
  • src/shared/agent-session-runtime-capabilities.ts
  • src/shared/protocol-version-published-capabilities.test.ts
  • src/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

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 win

Select the newest card from the displayed order.

When an optimistic move changes the last card, reordered.cards shows the new order, but steerNewest still reads the original order from cardsRef. 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 win

Scope pending move state to the session.

If a move in session A remains pending when this mounted hook switches to session B, busy.current stays true and pending stays true. Session B’s grips remain disabled, and a direct move call silently returns until A’s request settles. Track the active move by scope, 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
Commits

Reviewing files that changed from the base of the PR and between c19fa96 and ae5aa9a.

Files selected for processing: 5
  • mobile/src/components/DragReorderList.test.tsx
  • mobile/src/components/DragReorderRow.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.test.tsx
  • src/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.

@brennanb2025

brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

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 (refs=done), with sender-independent ordering intended under Brennan’s 10-26 ruling; unchanged whole-mechanism and performance evidence carries. No in-scope finding is deferred.

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 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.

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 queue at rest

Desktop hover: every queued message can be dragged, including attributed agent mail. All four controls measured 20×28 pixels without moving the text.

Agent-mail grip on desktop

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.

Phone queue

Phone queue scrolled to agent mail

Unchanged desktop inline editor: reorder controls disappear while editing. This retained capture predates the all-message change; the editor behavior is unchanged.

Desktop inline editor

Judgment spots: position-only host permutation, desktop all-card controls, phone shared grip list.

@brennanb2025
brennanb2025 merged commit 1c4d4a0 into main Oct 27, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant