Skip to content

fix(web): preserve the active queued-message edit - #15911

Closed
shivamhwp wants to merge 1 commit into
mainfrom
fix/keep-active-queued-message-edit
Closed

shivamhwp wants to merge 1 commit into
mainfrom
fix/keep-active-queued-message-edit

Conversation

@shivamhwp

Copy link
Copy Markdown
Collaborator

Editing a queued message, typing an unsaved change, then clicking another message's pencil silently discards the first edit. Returning to the first message shows its saved text, with the change gone.

Disable the other edit buttons until the current edit is saved or cancelled, and explain why in the tooltip. This matches the existing Alt+Up guard. It is a small fix for accidental draft loss within the existing workflow, covered by the focused-bug exception in CONTRIBUTING.md.

Replaces the draft-loss portion of #12892 after orchestration V2 merged into main. Queue-navigation shortcuts and presentation changes from that proposal are outside this fix. Related #15612 addresses dispatch during editing and includes a handler-level switch guard; this client-only fix can land independently, and that PR should retain its server hold work.

Reproduction and verification

Linux Chromium, real web renderer, isolated database with two held queued messages. No provider prompt was sent. Before: edit the first message to append UNSAVED IMPORTANT EDIT, click the second pencil, then the first; the suffix disappears. After: the other pencil is disabled and the suffix remains. Recordings were captured against main a1d9d72aef; the affected web code is unchanged in the updated base 37de6cbde6.

Before video, 9 seconds · After video, 4 seconds

Before: edit lost After: edit retained
Before After

Images are cropped to the queue and composer. Media is hosted as evidence-only assets on my GitHub fork, with no assets committed.

  • Real-client checks passed: mouse and Alt+Up cannot replace the active edit; Save persists and restores the composer draft; Cancel discards only the edit and restores that draft; another queued message is editable afterward.
  • vp test run apps/web/src/components/chat/QueuedRunsControl.test.tsx apps/web/src/components/chat/queuedMessageEdit.test.ts --maxWorkers=1: 11 passed on the updated base.
  • Web TypeScript check, scoped lint/format, and git diff --check passed.

Evidence level: 5 for draft protection and Save/Cancel in the running web client; 4 for existing queued-edit state tests. The safety condition is that Save and Cancel clear the editing run, restoring access to the other pencils; verified in the client. Desktop uses this web component, but the Electron shell was not separately exercised. Native mobile's separate editor is unchanged and its draft-switching problem remains outside this PR. Relay/tunnel and provider dispatch were not exercised.

Merge risk: reversible client-only change. A regression could leave other pencils disabled after editing; the browser Save/Cancel checks cover that transition. Reverting restores the prior interaction; no persistent or wire-format changes.

Model/harness: GPT-6 Astra through Codex in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 5, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c381ffe

Macroscope's review found this PR approvable — This is a small, localized web bug fix that prevents accidental loss of an active queued-message draft by disabling conflicting edit controls. It leaves save/cancel behavior and persistence unchanged, with no schema, infrastructure, security, billing, or configuration impact.

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

@shivamhwp

Copy link
Copy Markdown
Collaborator Author

Withdrawing this duplicate after independent review confirmed that active #15612 already prevents the same unsaved-edit loss in its web edit handler. The current-main reproduction and short videos remain available above. No code merged.

@shivamhwp shivamhwp closed this Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

⚠️ The thread fixture changed, so impact percentages are not directly comparable to the main baseline.

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

Baseline: 408ff8a · PR result: c381ffe · Source CI: failure

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: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

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

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

Labels

size:S 10-29 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