Skip to content

feat(web): navigate queued messages without losing unsaved edits - #12892

Open
shivamhwp wants to merge 4 commits into
t3code/codex-turn-mappingfrom
feat/queued-message-navigation
Open

shivamhwp wants to merge 4 commits into
t3code/codex-turn-mappingfrom
feat/queued-message-navigation

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Extends #12599: Option/Alt+Up walks backward through queued messages, and Option/Alt+Down walks forward to the original composer draft. Unsaved text, attachment, and context changes require Save or Cancel before switching, including when clicking another row's pencil.

The configured send shortcut saves the edited message in place and restores the original draft. Escape discards the edit and restores that draft. Suggestions and attachment previews close first; holding Escape does not also discard the edit. Shift+Enter retains its newline behavior. Navigation shortcuts are configurable. Image thumbnails stay on the left, with a one-pixel vertical adjustment to align visually with the message text.

Targets V2 (t3code/codex-turn-mapping), based on 1f2f91ded4. Parent #12599 is already merged into V2.

Validation

  • Final head c808dedbf2: real Linux Chromium verification at normal width, a narrow window, and 125% zoom; backward/forward navigation, dirty-edit protection, Escape, Ctrl+Enter save, and draft restoration checked again. Targeted lint, formatting, and diff checks pass. Full CI passed on this head (Check, Test, all three server test shards, Rust, and Release Smoke). Macroscope correctness and UI consistency passed with no findings; the unchanged Effect check was skipped. Macroscope requires human review for the workflow and default-keybinding changes.
  • At parent 024abdc43a, before the one-line thumbnail adjustment: 259 focused tests in six files, web typecheck, and full CI passed. Macroscope correctness, Effect conventions, and UI consistency passed with no findings. Approvability requires human review because this changes the queue-editing workflow and default shortcuts.
  • Mouse/keyboard tests covered backward/forward navigation, dirty-edit protection, Enter save, Shift+Enter, configured Ctrl+Enter, Escape cancellation, independent-draft restoration, ordinary-draft Escape, suggestion dismissal, held Escape, attachment removal cancellation, and image-preview dismissal followed by cancellation. The preview test found a thumbnail-focus gap, which was fixed and retested.

Native queue sheet redesign (74ec2ceae2, iOS and Android)

The native "Queued" sheet was a flat one-line list with small handles and a weak "Resume queue" pill. It now uses a rounded grouped card. Each row shows two lines of text, a status line (up next, position, attachment count, or "Editing in composer"), a 44 px image thumbnail and a quieter Steer pill. A held queue shows a "Queue paused" banner with an inline Resume, and a hint below the list explains tap, hold and swipe. Behavior is unchanged apart from layout. Checked on a real queue against the isolated server (iPhone 17 Pro sim on iOS 26.5, Android 16 emulator): the editing state, reorder handles and the paused banner all render, and Resume drained the held queue. Mobile typecheck and the queue presentation tests pass.

Before (c808ded) After (74ec2ce)
iOS, held
iOS, active turn
iOS, editing —
Android, held
Android, active turn —

The mobile recordings below were taken at c808ded, before this redesign. The unsaved-edit loss on mobile is still open.

Verification at c808dedbf2 (Mac, isolated state, real Codex turns)

Tested head c808dedbf2f23f567bd7bc116047d0ce6c034b5c on V2 without rebasing. Each client used a queue of four real messages behind an active turn: a short one, a long multiline one, one with an image, and one more. Queue state was checked against the server's database after each save, cancel, reorder and removal.

Behavior Web (Mac) iOS 26.5 sim Android 16 emu
Option+Up backward, stops at first entry Pass Not in mobile (no shortcut code) Not in mobile
Option+Down forward, past last restores draft Pass Not in mobile Not in mobile
Unsaved edit blocks switching (text, attachment removal, pencil click) Pass (toast) Fail: switches silently, edit lost Fail: switches silently, edit lost
Save persists (Enter, ⌘Enter, "⌘ + Enter always") Pass Pass (Update) Pass (Update)
Cancel/Escape discards, saved text unchanged, draft restored Pass Pass Pass
Escape closes suggestions / image preview first; held Escape doesn't discard Pass n/a n/a
Reorder / remove, navigation follows current order Pass Pass Pass
Held queue after restart → Resume drains Pass Pass Pass
Thumbnail aligned with text Pass Pass Pass
iOS hardware Option+Up — Not tested (AgentDevice can't send modifier keys); no handler in mobile code —

Mobile unsaved-edit loss (pre-existing, not from this PR): on both iOS and Android, open a queued message, type X, open another queued entry, then return. The field shows the saved text again with no Save/Cancel prompt, and the X is lost. The native queue sheet has no dirty-edit guard; this PR changes only the shared web/desktop composer. Mobile needs a separate fix.

Other notes (none caused by this PR):

  • mobile-native-client.ts ensure android fails for emulators because it validates the serial and Expo expects the AVD name.
  • The Android dev build crashed at launch with NDK 27 (libfbjni.so needs __cxa_init_primary_exception); it runs when built with NDK 28.2.
  • Removing a saved attachment while editing on web drops focus to <body>, so the next shortcut does nothing until the composer is clicked.

Mac web demonstration (82 s, normal speed)

Web queue navigation

MP4: Option+Up to the first entry, blocked switches with the toast, Enter save, reopen to show it persisted, Escape cancel with draft restored, suggestions closed by the first Escape, forward navigation to the draft, and ⌘Enter save during an active turn. Idle waits are cut; each action plays at recorded speed.

iOS simulator: native queue workflow (75 s)

iOS queue workflow

MP4: held queue, then the X edit is lost after switching, Update persists, Cancel restores the draft, Move up, Remove, and Resume drains.

Android emulator: native queue workflow (119 s)

Android queue workflow

MP4: the same sequence as iOS on Android, now connected: successful Save, reorder, removal and draining are verified (these were blocked in the earlier Android pass). The X loss reproduces.

Thumbnail alignment (before/after)

Before: thumbnail appears slightly low After: thumbnail aligned with the text
Before alignment adjustment Aligned thumbnail

Earlier Android evidence from the 2026-09-21 pass, which first reproduced the mobile edit loss: before switching · after returning · real-time recording

Full test report · Previous report

Scope: shared web/desktop composer only. Not tested: Electron shell, Windows/Linux, IME input, relay/tunnel. Native mobile keyboard shortcuts are not implemented. Mobile unsaved-edit loss remains unresolved and needs a separate native fix. No source changes in this verification pass.

Verification pass: Claude Opus 5.5 via Claude Code (T3 Code). Original implementation: GPT-6-Astra, Codex.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: c808ded · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This cross-platform feature adds queued-message navigation and unsaved-edit protection while changing existing composer shortcut and Escape behavior. It also adds alt+arrowdown to the default keybindings, changing a product default and warranting human review of the runtime and UX impact.

You can add or adjust custom eligibility rules. Learn more.

@shivamhwp
shivamhwp changed the base branch from stack/pr-12599-base to t3code/codex-turn-mapping September 22, 2026 08:44
@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

@shivamhwp
shivamhwp changed the base branch from t3code/codex-turn-mapping to stack/pr-12599-base September 22, 2026 08:46
@shivamhwp
shivamhwp force-pushed the feat/queued-message-navigation branch from 02b5187 to 1004723 Compare September 22, 2026 08:51
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Sep 22, 2026
@shivamhwp
shivamhwp changed the base branch from stack/pr-12599-base to t3code/codex-turn-mapping September 22, 2026 08:52
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 7 times, most recently from 1bd44f2 to 3b9c885 Compare September 24, 2026 04:06
@shivamhwp
shivamhwp force-pushed the feat/queued-message-navigation branch from 1004723 to 03c1a7a Compare September 24, 2026 09:37
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 24, 2026
@macroscopeapp

This comment has been minimized.

1 similar comment
@macroscopeapp

This comment has been minimized.

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 3 times, most recently from fe4f6ad to 87c67bd Compare September 25, 2026 05:55
@shivamhwp
shivamhwp force-pushed the feat/queued-message-navigation branch from 03c1a7a to ce61b28 Compare September 25, 2026 06:32
@shivamhwp
shivamhwp force-pushed the feat/queued-message-navigation branch from ce61b28 to 024abdc Compare September 25, 2026 11:41
shivamhwp and others added 2 commits September 25, 2026 12:02
The native queue sheet was a flat one-line list with a small resume pill.
Rows now sit in a grouped card with two-line previews, a status line
(up next, position, attachment count, or editing), a larger image
thumbnail, and a quieter Steer pill. A held queue shows a paused banner
with an inline Resume, and a hint explains tap, hold, and swipe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant