Skip to content

fix(ui): preserve split selections and newer drafts - #149364

Merged
steipete merged 5 commits into
mainfrom
codex/qa-split-draft-eviction
Sep 16, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/qa-split-draft-eviction

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two split-pane failures: an evicted pane restoring an older draft over newer saved work, and rapid focus changes letting an earlier navigation replace the last selected conversation.

User Impact

Users can return to a conversation and reload without losing the newer draft. Rapid focus changes keep the last selected conversation active, including after resizing. Text, selected recipients, Goal mode, and attachments remain consistent; unsaved drafts retain storage-failure recovery guidance. No migration or configuration change is required.

Why This Change Was Made

Eviction previously restored an unversioned draft alongside the saved composer, allowing old content to acquire a new revision. The existing handoff now carries the complete composer with its original revision and rejects stale content. The redundant eviction restore path is removed; explicit session creation and failed-storage fallbacks keep their existing ownership.

Evidence

  • Real Chromium, source-mode UI with mock Gateway: open Session A in two panes, save OLD on the left then NEW on the right, focus the left and visit B → C → D → A, then reload. Before: both panes show OLD. After: both show NEW. The regression failed before the fix and passes afterward (18.15 seconds; one selected test, six deselected).
  • 104 focused tests passed across composer persistence, retained presentation, pane attachment handoff, and application handoff owners. Coverage includes stale recipients/Goal mode/attachments, quota-failure recovery, and explicit session continuation.
  • Scoped type-aware lint, formatting, whitespace checks, and max-lines ratchet passed. Fresh isolated review through P2 found no actionable findings.
  • The final UI typecheck passed after replacing task-owned borrowed dependency links with physical copies. That focused proof uses a mocked Gateway. A later live Gateway replay preserved distinct drafts while switching conversations between split panes; the controlled regression remains the proof for the exact rapid-focus race.

Inspected synthetic before/after screenshots are attached below and in the originating QA conversation.

Before: an older pane overwrites the newer draft

After: the newer draft survives eviction and reload

Rapid split focus follow-through

A second split-draft failure exposed a navigation race: focus the left conversation and return immediately to the lower-right conversation before the first route finishes loading. The chat page compared the requested conversation with its last committed route and skipped the return navigation. The first route could then settle into the newly active pane, displaying the wrong conversation and draft.

The chat page now delegates that focus intent to the existing router, whose same-match path cancels superseded navigation without reloading or adding history. Repeated focus within the same active pane still returns at the pane-focus owner. The original draft-revision/eviction repair remains unchanged.

The bundled Chromium regression now exercises that sequence deterministically and verifies the actual active conversation, URL, unchanged history length, preserved independent drafts, narrow viewport coverage, and restored desktop geometry. It failed on the prior head by displaying Session a instead of Session c; it passes with the four-line owner simplification. The 40 focused chat-page/router-outlet cases pass, including draft URL cleanup and face-navigation siblings. UI typechecking, changed-file type-aware lint, styles, formatting, and fresh independent P2 review are recorded with the final candidate validation.

Inspected synthetic before/after screenshots for the rapid-focus race supplement the original eviction screenshots above. Both new captures have been inspected and attached in the originating chat. Their GitHub rendering has now been verified through the restored extension relay; the screenshot delivery gate is satisfied.

The CI follow-up preserves the canonical Home-session binding refresh in the existing session-change callback. Its original failing test passes unchanged, together with 63 focused owner/router cases and the bundled rapid-focus regression. The rebase onto main containing the shared lint fix is patch-identical; those focused checks also pass on the rebased head.

Shared CI prerequisite

This branch includes the existing test-only fix from #149423 which has now landed on main as 6c28739b1aca420df0c753acb79f065085cc7229. 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; current-head hosted CI is still required. The feature-specific changes above are unchanged.

Expanded dashboard CI regression

A repeated face notification during dashboard startup could discard the expanded-view URL setting and restore a split view. The notification now preserves an already-selected route, while explicit split-pane focus still supersedes pending navigation. The existing mobile case failed before this repair; all six dashboard cases, the rapid-focus browser case, and 28 page-owner cases passed afterward. Targeted lint, formatting and fresh independent review passed.

Expanded dashboard before: chat pane appears unexpectedly

Expanded dashboard after: full-height board and working default menu

These additional captures use synthetic data with a mocked Gateway. The earlier swarm-disclosure failure did not reproduce on an unchanged local replay; the current CI run passes all substantive jobs, including that browser lane. Its original root cause remains unconfirmed.

Shared CI prerequisite: includes the reviewed one-line alias-fixture dependency repair from #149481 (4ad5e7d). It restores installed wrapper dependencies so alias tests reach the supervisor handoff; delegation and refusal assertions remain unchanged. The prerequisite has nine failing cases before repair, twelve passing cases afterward, and a clean independent review. Exact-head CI will validate this combination. This branch also incorporates main at 14b8ad1 to supply the existing dependency helper; all feature commits remain patch-identical, with already-landed prerequisite commits omitted.

The shared test-fixture prerequisite #149481 has landed on main. Exact-head CI run 35032472588 passed all 127 checks, including the aggregate (12 inapplicable jobs skipped). Native preparation and merge completed without a bypass; merged as c536d37.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 15, 2026 19:22
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 7:02 PM ET / 23:02 UTC (Revision 5).

ClawSweeper review

What this changes

The PR preserves newer split-pane drafts, keeps rapid conversation selections and expanded dashboards stable, and updates regression tests, documentation, and a wrapper-test fixture.

Merge readiness

✅ Ready for maintainer review

Keep open: the central fixes remain necessary on current main. The pinned patch has useful browser evidence, preserves existing storage contracts, and introduces no actionable correctness finding.

Priority: P2
Reviewed head: c43b068807f2ac1ffd1e3e06705516af50dd15d0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with convincing visual evidence and meaningful regression coverage; no actionable patch defect found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Chromium before/after screenshots show newer drafts surviving pane recovery and the dashboard retaining its expanded view. The supplied browser scenarios exercise the changed UI owners with a mocked Gateway, including reload and rapid-focus assertions; no live Gateway result is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected Chromium before/after screenshots show newer drafts surviving pane recovery and the dashboard retaining its expanded view. The supplied browser scenarios exercise the changed UI owners with a mocked Gateway, including reload and rapid-focus assertions; no live Gateway result is claimed.
Evidence reviewed 11 items Pinned patch and clean checkout: Reviewed the introduced merge-base-to-head changes at c43b068. The supplied verified test merge has the pinned base and original head as its two parents. The whitespace check passed, and final git status showed no working-tree changes.
Current main still needs the eviction fix: Current main still prepares an unversioned eviction handoff and restores its draft independently of the newer persisted composer.
Latest release retains the old recovery path: GitHub source at v2026.9.4 contains the same unversioned eviction restoration. The release endpoint confirms that tag was published on September 11, 2026; no shipped implementation of this central fix was established.
Findings None None.
Security None None.

How this fits together

The Control UI manages conversation panes, unsent drafts, and browser navigation. Pane lifecycle events feed composer recovery, while focus changes feed the router that selects the visible conversation.

flowchart TD
  A[Composer edits] --> B[Existing draft store]
  C[Pane eviction and return] --> D[Revision-aware handoff]
  B --> D
  D --> E[Recovered composer]
  F[Pane focus or dashboard notification] --> G[Navigation owner]
  G --> H[Selected conversation and view]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +133, Docs +4. Total +152 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 9 89 74 +15
Tests 6 201 68 +133
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 294 142 +152

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +15 net lines; tests +133 net lines The small production increase carries complete draft revisions while removing the competing eviction restore path.

Technical review

Best possible solution:

Keep one revision-aware recovery path for evicted composers and let the router settle explicit focus intent without disturbing saved dashboard presentation.

Do we have a high-confidence way to reproduce the issue?

Yes: save different drafts in two panes showing the same conversation, then evict and revisit the older pane. Current-main source supports the failure mechanism, and the supplied Chromium evidence demonstrates the sequence; this review did not rerun it.

Is this the best way to solve the issue?

Yes: extending the existing handoff with its original revision removes competing restoration logic, and delegating focus cancellation to the existing router avoids another navigation owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 66d85ddf5397.

Labels

Label justifications:

  • P2: This addresses concrete draft-recovery and navigation failures limited to split-pane and dashboard workflows.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected Chromium before/after screenshots show newer drafts surviving pane recovery and the dashboard retaining its expanded view. The supplied browser scenarios exercise the changed UI owners with a mocked Gateway, including reload and rapid-focus assertions; no live Gateway result is claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected Chromium before/after screenshots show newer drafts surviving pane recovery and the dashboard retaining its expanded view. The supplied browser scenarios exercise the changed UI owners with a mocked Gateway, including reload and rapid-focus assertions; no live Gateway result is claimed.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected Chromium before/after screenshots show newer drafts surviving pane recovery and the dashboard retaining its expanded view. The supplied browser scenarios exercise the changed UI owners with a mocked Gateway, including reload and rapid-focus assertions; no live Gateway result is claimed.

Evidence

What I checked:

  • Pinned patch and clean checkout: Reviewed the introduced merge-base-to-head changes at c43b068. The supplied verified test merge has the pinned base and original head as its two parents. The whitespace check passed, and final git status showed no working-tree changes. (c43b068807f2)
  • Current main still needs the eviction fix: Current main still prepares an unversioned eviction handoff and restores its draft independently of the newer persisted composer. (ui/src/pages/chat/chat-pane-retained-presentation.ts, 66d85ddf5397)
  • Latest release retains the old recovery path: GitHub source at v2026.9.4 contains the same unversioned eviction restoration. The release endpoint confirms that tag was published on September 11, 2026; no shipped implementation of this central fix was established. (ui/src/pages/chat/chat-pane-retained-presentation.ts, 3a9d69db306c)
  • Recovery uses the existing revision owner: The handoff compares its captured revision with the persistence owner's latest attempt before restoring text, mentions, Goal mode, or attachments. Rejected attachment payloads are released while retained fallback payloads remain protected. The lifecycle restores this handoff before starting composer persistence; persistent schemas and keys are unchanged. (ui/src/pages/chat/chat-pane-attachment-handoff.ts:191, c43b068807f2)
  • Navigation dependency signal: The PR explicitly relies on the existing router's same-match cancellation. ApplicationContext imports Router from @openclaw/uirouter, and ui/package.json pins version 0.1.1; this establishes the relevant dependency boundary, with no Codex harness dependency. (ui/src/app/context.ts:2, c43b068807f2)
  • Pinned router cancellation contract: npm metadata identifies openclaw/uirouter as the repository and f5ce7c0d7c04049753b112121600b6fe1e13c99d as the package gitHead. Both the published 0.1.1 implementation and source confirm that navigating to an already successful active match cancels the current run and clears pending matches without loading that route again. (src/router.ts, f5ce7c0d7c04)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-15T19:38:23.549Z sha 5f5ff5b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T20:30:47.797Z sha 7d8392ab2537ebeaf6e5d6737f9082b99b6901cc :: blocked before merge. :: none
  • reviewed 2026-09-15T21:03:03.927Z sha 22279d9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T21:43:22.830Z sha 27b89f8 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

CI exposed a separate rapid-focus race: focusing A then returning to C before navigation settled let A replace the selected session in C's split. C's draft survived in a hidden view, while the visible pane showed A's draft.

The page's redundant same-session shortcut prevented the existing router from canceling superseded navigation. Removing it lets the router own cancellation and same-match handling. The deterministic Chromium regression fails before the repair and passes afterward, preserving both drafts, the final C URL, and browser history length.

Inspected synthetic screenshots show the same sequence at 1000×900. This is mocked-Gateway browser proof. Rendering of these newly uploaded images remains to be verified before landing because browser automation became unavailable.

Before: stale navigation selects Session A

After: Session C and its draft remain selected

@steipete steipete changed the title fix(ui): preserve newer drafts after split pane eviction fix(ui): preserve split selections and newer drafts Sep 15, 2026
@steipete
steipete force-pushed the codex/qa-split-draft-eviction branch from 7d8392a to 22279d9 Compare September 15, 2026 20:45
Link the existing installed wrapper dependencies into the linked alias fixture so its node recorder observes the supervisor handoff after the code-only wrapper dependency cutover. Preserve all delegation and refusal assertions.

Validation: nine delegation cases fail before the fix; all twelve alias delegation and refusal cases pass afterward. Focused formatting, typed lint, and independent P2 review pass.
(cherry picked from commit 4ad5e7d)
@steipete
steipete force-pushed the codex/qa-split-draft-eviction branch from 5f34b41 to c43b068 Compare September 15, 2026 22:44
@steipete
steipete merged commit c536d37 into main Sep 16, 2026
173 of 174 checks passed
@steipete
steipete deleted the codex/qa-split-draft-eviction branch September 16, 2026 01:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
* fix(ui): preserve newer drafts after split pane eviction

* fix(ui): supersede stale split focus navigation

* fix(ui): refresh canonical Home session bindings

* fix(ui): preserve expanded dashboard route intent

* test(pr): restore dependencies in alias fixtures

Link the existing installed wrapper dependencies into the linked alias fixture so its node recorder observes the supervisor handoff after the code-only wrapper dependency cutover. Preserve all delegation and refusal assertions.

Validation: nine delegation cases fail before the fix; all twelve alias delegation and refusal cases pass afterward. Focused formatting, typed lint, and independent P2 review pass.
(cherry picked from commit 4ad5e7d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant