Skip to content

test(ui): enforce that no offered side panel dead-ends when opened cold - #125174

Merged
steipete merged 1 commit into
mainfrom
steipete/sidebar-cold-open-invariant
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/sidebar-cold-open-invariant

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

chat-sidebar-panel-contract.e2e.test.ts was introduced in #124950 as a characterization test: it
recorded what each offered side-panel slot does when opened cold, including the answers that were wrong on
purpose, so the refactors in this series could not change behavior by accident. Four PRs later the wrong
answers are fixed, and a recording of current behavior is no longer the right shape — it documents the
present instead of preventing a repeat.

The bug class it needs to prevent is the one that shipped as #124824: a slot gets promoted to a
user-openable destination without anyone deciding what it shows when reached cold, and the result is a panel
named Review that renders "Open a change, file, image, or tool result to review it here." on a session full
of changes.

Why This Change Was Made

The obvious invariant — "every offered slot renders content or an empty state with an action" — is not
directly enforceable. Some empty states are legitimately actionless: Review on a session with no git
checkout has nothing to diff, and inventing an action there would be worse than the placeholder. A test
demanding an action everywhere would either fail honest cases or get weakened until it meant nothing.

So it is two falsifiable parts:

  1. Capability present ⇒ content. For every offered slot, in a scenario where its backing capability is
    advertised and has data, cold-open must render slot content and never the generic empty state. This is
    the actual anti-dead-end guarantee, and it is exactly what fix(ui): show session changes in the review panel #124824 violated.
  2. No silent placeholder. A slot rendering the generic empty state must name an action or appear in a
    short allowlist, each entry commented with why no action exists.

Both tests first assert the offered-slot list itself, so a newly added slot fails until it is explicitly
covered rather than silently escaping the sweep. The allowlist check is bidirectional — the final assertion
compares observed actionless empty states against the allowlist exactly — so a stale entry fails once its
slot is fixed and the list cannot rot.

Allowlist, in full:

  • Review — no git checkout, nothing to diff.
  • Tasks — no background tasks, nothing to inspect.

Side chat is deliberately not allowlisted: its starter questions are actionable controls, so it satisfies
part 2 on merit.

User Impact

None — test-only. This PR ships zero production lines; it locks in the behavior the previous four
established.

Evidence

A guard nobody has seen fail is an assumption, so the invariant was proven by breaking a slot on purpose.
Files' content resolution was temporarily disabled locally, producing this (then reverted):

× chat sidebar cold-open invariant > renders content for every offered slot with backing data
   → Files cold-open outcome: expected { outcome: 'generic-empty', …(1) } to match object { outcome: 'content' }
× chat sidebar cold-open invariant > keeps generic empty states actionable or explicitly allowlisted
   → Files renders the generic empty state without an action: expected false to be true
 Test Files  1 failed (1)
      Tests  2 failed | 1 passed (3)

Both parts caught it, and each message names the offending slot.

Passing, with the rest of the series' guards unchanged:

 Test Files  3 passed (3)      Tests  14 passed (14)
 Test Files  2 passed (2)      Tests  33 passed (33)

pnpm check:changed green; Codex autoreview clean.

reviewMetrics — production vs test LOC: production +0 / −0, tests +231 / −35. Series production
total across all five PRs: −17 (#124950) +11 (#125019) +7 (#125105) −5 (#125138) +0 here = net −4.

No CHANGELOG.md edit — release-only per repo policy; test-only change.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 17, 2026 08:35
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 4:41 AM ET / 08:41 UTC.

ClawSweeper review

What this changes

The PR replaces the chat side-panel characterization test with assertions that every offered panel renders useful cold-open content when its backing data is available, while permitting only documented actionless empty states.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. This maintainer-authored, test-only PR adds a useful UI-boundary guard, but this checkout is behind the supplied current main and cannot materialize the exact PR-head tree for a complete final pass.

Priority: P3
Reviewed head: e44a98aaf5dc321167ad0d899f982d85d3338f9c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The test direction is well-supported by the current owner boundary, but exact-head inspection and structured autoreview were blocked by the review environment.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only test coverage and does not alter user-visible runtime behavior.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes only test coverage and does not alter user-visible runtime behavior.
Evidence reviewed 5 items Panel ownership: The chat pane builds panel definitions, derives available slots/templates/actions, and passes all three to the rendered sidebar region.
Current local test baseline: The existing E2E test already opens every offered slot and records cold-open outcomes, so changing it into an invariant targets the correct browser boundary.
Feature-history provenance: The panel-definition contract and its Review/Files follow-up fixes appear in the merged series commits 07da6f6, b1e76c4, and 57e3ee6.
Findings None None.
Security None None.

How this fits together

Chat pane rendering derives offered side-panel slots and their content templates from a single panel-definition list. The Control UI E2E test opens those slots through the real browser UI and checks the resulting panel content or empty-state behavior.

flowchart LR
  A[Panel definitions] --> B[Offered side-panel slots]
  B --> C[Chat pane rendering]
  C --> D[Control UI browser test]
  D --> E[Cold-open content check]
  D --> F[Empty-state action check]
  E --> G[Regression guard]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head source and a current-main comparison were unavailable locally, so the final diff and autoreview must be rechecked once the PR tree is materialized.
  • Complete next step (P2) - This protected maintainer PR needs ordinary exact-head validation, not an automated repair branch.
Agent review details

Security

None.

PR surface

Tests +196. Total +196 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 231 35 +196
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 231 35 +196

Review metrics

Metric Value Why it matters
Production versus test LOC production +0 / −0; tests +231 / −35 The reported diff adds only browser-test coverage, so it changes no shipped runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one browser-level invariant alongside the centralized panel definitions, then complete an exact-head E2E and structured-review pass before landing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one browser-level invariant alongside the centralized panel definitions, then complete an exact-head E2E and structured-review pass before landing.

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

Not applicable as a current defect report: this PR adds a regression guard, and its body documents an intentional local fault injection that made the intended assertions fail.

Is this the best way to solve the issue?

Yes in design: checking offered slots through the running Control UI is the right owner-boundary guard, but the exact PR head still needs independent review execution.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a test-only regression guard for an already-fixed Control UI behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only test coverage and does not alter user-visible runtime behavior.

Label justifications:

  • P3: This is a test-only regression guard for an already-fixed Control UI behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only test coverage and does not alter user-visible runtime behavior.

Evidence

What I checked:

Likely related people:

  • steipete: Introduced the merged panel-definition and cold-open behavior series, including the current Files default-content change. (role: feature-series owner; confidence: high; commits: 07da6f6d6d4e, b1e76c4640bc, 57e3ee6513be; files: ui/src/e2e/chat-sidebar-panel-contract.e2e.test.ts, ui/src/pages/chat/chat-pane-embedded-panels.ts)

Rank-up moves

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

  • Materialize the exact PR head and rerun the focused Control UI E2E test.
  • Install or expose TruffleHog, then rerun the requested autoreview gate.

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for e44a98aaf5dc321167ad0d899f982d85d3338f9c:

  • Rebased cleanly onto the then-current origin/main (fb0e8b145e4c5401a8eb97587a51a83312d12331); no conflicts.
  • Focused local proof passed: pnpm test ui/src/pages/chat/components/chat-sidebar-region.test.ts ui/src/e2e/chat-sidebar-panel-contract.e2e.test.ts ui/src/e2e/chat-session-diff.e2e.test.ts ui/src/e2e/terminal-open.e2e.test.ts — 2 Vitest shards, 4 files, 29 tests.
  • Fresh structured review passed: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — TruffleHog clean; no accepted/actionable findings.
  • Exact-head CI passed: run 32011127478, including openclaw/ci-gate.
  • Native review artifacts validated with READY FOR /prepare-pr, zero findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125174 passed in hosted_exact_or_recent_parent mode and verified the remote PR head tree; it reused the hosted exact-head gate, so no separate Testbox run or lease was created.

ClawSweeper Rank-up moves: are both complete:

  • Exact PR head materialized and the focused Control UI E2E test rerun successfully.
  • TruffleHog is available and clean; the requested autoreview gate reran successfully.

The two pre-merge review items are also covered by exact-head inspection/current-main comparison in the native review worktree and ordinary exact-head validation. No proof gaps remain for this test-only change.

@steipete
steipete merged commit 65d1fa4 into main Aug 17, 2026
141 of 143 checks passed
@steipete
steipete deleted the steipete/sidebar-cold-open-invariant branch August 17, 2026 08:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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