Skip to content

fix(ui): wait for presented sidebar session before clearing draft - #130747

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ui-sidebar-presented-pane-race
Aug 27, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ui-sidebar-presented-pane-race

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Related: #130688

What Problem This Solves

Resolves a flaky Control UI sidebar E2E failure where returning Home could clear the composer from the previously presented retained pane. The browser URL could commit to the Home session before that session's chat pane became the single presented pane, leaving the draft indicator behind and failing the assertion.

Why This Change Was Made

The test now waits for the existing router readiness contract, then requires exactly one presented chat pane with the Home session key before clearing the composer. Production code, shared helpers, retry counts, and timeout budgets are unchanged.

User Impact

No product behavior changes. CI now verifies draft clearing against the pane users can actually interact with instead of racing the retained-pane transition.

Evidence

AI-assisted: yes. The maintainer reviewed the implementation and evidence.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc vincentkoc self-assigned this Aug 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 27, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 5:00 AM ET / 09:00 UTC.

ClawSweeper review

What this changes

The branch makes the sidebar draft-indicator E2E test wait for both router settlement and the sole presented Home chat pane before clearing the composer.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this maintainer-authored, protected draft is a focused test-race repair, but it still needs a non-skipped exact-head Control UI E2E result before landing.

Priority: P3
Reviewed head: 3b309cc4aca137f3f18610593c087f062fd10ccc
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-only patch that follows the existing route and presentation contracts, pending exact-head CI confirmation.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR changes only automated test synchronization, so external-contributor real-behavior proof is not required; the supplied test results remain supplemental validation evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR changes only automated test synchronization, so external-contributor real-behavior proof is not required; the supplied test results remain supplemental validation evidence.
Evidence reviewed 5 items Current-main gap: Current main still waits only for the Home URL and draft indicator before clearing the composer; it has neither the route-settlement wait nor the presented-pane assertion, so the proposed test stabilization is not already implemented.
Presentation invariant: The renderer assigns aria-hidden="false" only to a presented pane, and retained-pane transition code updates that attribute when presentation settles; the new assertion therefore targets the pane state that owns interactive composer behavior.
Existing readiness contract: The reused helper waits for successful router state, resolved matching location, and no pending matches before returning, so it addresses the URL-versus-router race without adding a new timing mechanism.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/e2e/session-management.sidebar.e2e.test.ts

Result: FAIL (failed) — step 1 expect_output session-management.sidebar.e2e.test.ts: expected terminal output was not visible within 30 seconds: "session-management.sidebar.e2e.test.ts"

[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-130747-s1bco5/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130747-s1bco5/target

Assertions:

  • FAIL expect_output: session-management.sidebar.e2e.test.ts

How this fits together

The Control UI sidebar navigates between retained chat panes while the router updates the URL and page state. This test verifies that a browser-local draft is cleared only after the pane a user can interact with is presented.

flowchart LR
  A[Sidebar session click] --> B[Control UI router]
  B --> C[Route settles]
  C --> D[Home chat pane is presented]
  D --> E[Composer draft is cleared]
  E --> F[Sidebar draft indicator assertion]
Loading

Decision needed

Question Recommendation
Should this protected maintainer draft be made ready for review after its exact-head Control UI E2E check is scheduled and passes? Run exact-head E2E and proceed: Make the draft reviewable, obtain a non-skipped exact-head Control UI E2E result, then land if it is green.

Why: The patch is test-only and appears coherent, but the repository policy requires an exact-head validation result before landing and member-authored protected work is not eligible for automated cleanup.

Before merge

  • Resolve merge risk (P1) - The current exact-head GitHub check set is skipped, so the claimed focused and full E2E results have not yet been independently confirmed by a non-skipped PR run.
Agent review details

Security

None.

PR surface

Tests +13. Total +13 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 14 1 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 14 1 +13

Review metrics

Metric Value Why it matters
Production versus test delta production +0, tests +13 net The one-file change is confined to an existing E2E test and adds no shipped runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the focused assertion, mark the draft ready when appropriate, and land after a non-skipped exact-head Control UI E2E run confirms the retained-pane transition.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the focused assertion, mark the draft ready when appropriate, and land after a non-skipped exact-head Control UI E2E run confirms the retained-pane transition.

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

Yes, source reproducibly exposes the race: current main clears the composer after the URL changes without first proving that the Home pane is presented; the PR body also records the observed CI failure.

Is this the best way to solve the issue?

Yes. Reusing the established router readiness check and then asserting the renderer’s presented-pane contract is narrower and more maintainable than adding retries or changing production timing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1847e9ac9945.

Labels

Label justifications:

  • P3: This addresses CI test determinism without changing product behavior or a user-facing workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR changes only automated test synchronization, so external-contributor real-behavior proof is not required; the supplied test results remain supplemental validation evidence.

Evidence

What I checked:

  • Current-main gap: Current main still waits only for the Home URL and draft indicator before clearing the composer; it has neither the route-settlement wait nor the presented-pane assertion, so the proposed test stabilization is not already implemented. (ui/src/e2e/session-management.sidebar.e2e.test.ts:82, 1847e9ac9945)
  • Presentation invariant: The renderer assigns aria-hidden="false" only to a presented pane, and retained-pane transition code updates that attribute when presentation settles; the new assertion therefore targets the pane state that owns interactive composer behavior. (ui/src/pages/chat/chat-page-pane-render.ts:90, 1847e9ac9945)
  • Existing readiness contract: The reused helper waits for successful router state, resolved matching location, and no pending matches before returning, so it addresses the URL-versus-router race without adding a new timing mechanism. (ui/src/test-helpers/control-ui-e2e.ts:99, 1847e9ac9945)
  • Exact-head provenance: The changed lines are attributed to the current branch commit; sparse history prevents reliable attribution of the older test setup beyond this branch. (ui/src/e2e/session-management.sidebar.e2e.test.ts:84, 3b309cc4aca1)
  • Related work is distinct: The merged gzip-ratchet PR explicitly identifies this sidebar failure as separately remediated here; it does not implement this test synchronization. (0b0cff180bed)

Likely related people:

  • Vincent Koc: Authored the current focused test change and is a repository member; sparse local history did not yield a reliable earlier feature owner. (role: current exact-head test contributor; confidence: medium; commits: 3b309cc4aca1; files: ui/src/e2e/session-management.sidebar.e2e.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain a non-skipped exact-head run covering ui/src/e2e/session-management.sidebar.e2e.test.ts before landing.

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 (2 earlier review cycles)
  • reviewed 2026-08-27T06:16:36.435Z sha 58566fbaf08693684d983e131a6102f276dd9669 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T06:54:29.353Z sha 2b6a4921171bacbd56c4c6faa2c622cc8729b195 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/ui-sidebar-presented-pane-race branch from 58566fb to 2b6a492 Compare August 27, 2026 06:49
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc force-pushed the fix/ui-sidebar-presented-pane-race branch from 2b6a492 to 3b309cc Compare August 27, 2026 08:55
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc marked this pull request as ready for review August 27, 2026 11:03
@vincentkoc
vincentkoc merged commit 40feadb into main Aug 27, 2026
320 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-sidebar-presented-pane-race branch August 27, 2026 11:24
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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