Repository navigation
fix(ui): preserve queued corrections across navigation and updates - #149366
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 11:10 PM ET / September 16, 2026, 03:10 UTC (Revision 7). ClawSweeper reviewWhat this changesPreserves unsaved queued-message corrections across conversation navigation and automatic UI reloads, adds recovery navigation, and improves supporting test synchronization. Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks correction-aware eviction and reload protection. The earlier split-navigation findings are resolved, and no blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI keeps queued corrections in their chat pane while the original message remains in the outbox. Pane retention and document reload admission determine whether that unsaved correction survives navigation or a Gateway update. flowchart TD
A[Queued message correction] --> B[Chat pane owns unsaved edit]
C[Conversation navigation] --> D[Retained pane cache]
B --> D
B --> E[Document reload guard]
F[Gateway update] --> E
E --> G[Review edit in owning split]
G --> H[Save or cancel]
H --> D
H --> E
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +121, Tests +458, Docs +8. Total +587 across 18 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep correction custody with the existing queued editor, retain its pane until resolution, and let the shared reload guard provide direct recovery navigation. Do we have a high-confidence way to reproduce the issue? Yes: edit an offline queued message, then exceed the three-view cache or trigger update recovery. Current-main source supports both failure paths, and supplied before/after browser evidence demonstrates them; this review did not execute a reproduction. Is this the best way to solve the issue? Yes: the patch extends existing retention, navigation, and reload owners without introducing another correction store or changing durable message formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c1c870a41755. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Expanded navigation regression: visiting three other conversations previously evicted the chat view that owned an unsaved queued-message correction. Returning showed the original text already submitted, with no document reload involved. The repaired cache retains views with open corrections and releases temporary overflow when edits are saved or canceled. The matching navigation replay preserves both the correction and the separate composer draft, with no send before resolution. These inspected screenshots contain synthetic fixtures only. Proof uses Chromium and the existing mocked Gateway; it does not represent a deployed-artifact update. |
|
Cross-page recovery regression: after leaving Chat for Agents, Review edit previously opened the conversation in the currently active split instead of restoring the split holding the unsaved correction. The matched repaired flow restores the owning split, its correction and separate draft, while preserving the other split. The synthetic Chromium proof uses the existing mocked Gateway and source-mode update-recovery fixture; the reconnect banner is part of that fixture. It verifies recovery navigation and correction custody, not deployment of a new UI artifact. Both images were inspected and attached in the originating QA conversation. |
b188c86 to
13c9fc8
Compare
(cherry picked from commit a494b6e)
|
Merged via squash.
|
…penclaw#149366) * fix(ui): protect queued edits during update reloads * refactor(ui): keep queued edit navigation with retained panes * fix(ui): retain queued corrections through chat navigation * fix(ui): recover queued edits across page navigation * fix(test): unblock managed update fixture lint (cherry picked from commit a494b6e) * test(ui): wait for completed CLI discovery in refresh proof * test(pr): share installed dependencies with alias fixtures * test(pr): align alias setup with canonical checkout order * test(pr): match landed alias fixture setup order




What Problem This Solves
Fixes: unsaved queued-message corrections disappear during automatic UI updates or when switching through enough conversations to evict their chat view.
User Impact
User impact: corrections stay available until saved or canceled, including in background conversations. Review edit returns to the correction-owning split when it blocks an update reload, including after leaving Chat for another page. Navigation remains available when several conversations have open edits. Explicit browser reloads still discard unsaved corrections.
Why This Change Was Made
The queued editor owns an in-memory correction while the original remains queued. Its existing document reload guard now protects that custody through update recovery. The retained-chat cache also skips views that own corrections; when every candidate is being edited, it temporarily adds a slot and prunes back to its normal limit as edits resolve. Surviving views keep their slots, so pruning does not remount them. No durable storage format or message-delivery policy changes.
Evidence
Ten Chromium cases pass: Save and Cancel after update recovery, ordinary cache eviction pressure, navigation with every retained view being edited, returning to the owning split pane, clearing a preview in another split that already cached the same conversation, keeping that split hidden on narrow screens, and returning from another page to the original correction-owning split. They verify preserved corrections and separate drafts, no premature chat send, recovery reload after resolution, and overflow pruning after Save/Cancel. 232 focused owner/handoff tests passed; the final cache/page run passed another 53 tests (24 overlap). These cover the ordinary three-view limit, stable surviving panes, disposal, and handoffs.
Both defects were reproduced on the original code. The navigation reproduction lost the correction with zero document reloads and submitted the original queued text. The repaired flow retains the correction and sends nothing before resolution.
Before/after navigation screenshots.
The browser proof uses Chromium, the existing mocked Gateway, and source-mode UI; it proves correction custody and reload admission, not successful loading of a newly deployed artifact. Scoped type-aware lint, formatting, and whitespace checks pass. Fresh independent P2 review found no actionable issues.
Update-recovery screenshots (previously verified in chat and this PR):
The followup also sorts the private-server E2E inventory to satisfy the CI ownership guard. The exact failing guard now passes. Before/after cross-page Review edit screenshots.
Shared CI prerequisite
This branch includes the existing test-only fix from #149423, which is now merged. It resolves the unrelated managed-update fixture line-limit failure without changing its assertions or production behavior. The exact extracted patch passed four Linux lifecycle cases and a fresh independent review; its proof is included in the green current-head CI below. The feature-specific changes above are unchanged.
Real-Gateway CI readiness repair
CI exposed a separate model-picker test race: an absent CLI-agent loading indicator was accepted before discovery had started. The test now observes the latest successful discovery response on the current connection and waits for bootstrap, agent readiness, and settled rendering before checking the existing strict no-notices assertion. No product behavior, retry count, timeout, or assertion was weakened.
A controlled delayed-bootstrap/discovery run reproduces the original exact loading-notice failure. The repaired test passes that same schedule and a normal real-Gateway run, covering both new and existing conversations; fresh independent review found no actionable issue. The earlier desktop-resize failure passed on the unchanged scoped retry. Current-head hosted CI is green as recorded below.
CI repair follow-up
The catalog refresh test waits for completed CLI discovery using its actual response and rendered state. The branch also incorporates main's final #149520 fixture consolidation: linked dependencies are initialized exactly once after checkout and before the Node recorder is installed. The earlier shared-fixture failure remains recorded; no extra setup call is retained in the feature diff.
The merge with main incorporates the revisioned composer handoff from #149364. Its queued-edit transfer remains the existing owner; the reload guard and retained-view cache consult the live owning state. Fresh independent review of the complete 17-file feature diff against that main found no actionable P0–P2 issue. After replacing the old external dependency links with task-local dependencies matching the lockfile, all ten browser cases, 281 focused custody/handoff tests, and twelve wrapper cases pass. All three affected UI typegraphs and scoped typed lint pass. An equivalent focus-guard simplification resolves the integration line limit; its 29 page cases and fresh independent review pass. The canonical fixture follow-up also passed fresh independent review. Current head
51bdb27343718de5ae815524c2ac319c40e653fcpassed all 91 hosted checks in CI run 35047633552. Native review artifacts are validated for that exact head.