Skip to content

fix(ui): collapse chat side panel after final tab closes - #130102

Merged
vyctorbrzezowski merged 4 commits into
mainfrom
fix/panel-collapse
Aug 26, 2026
Merged

vyctorbrzezowski merged 4 commits into
mainfrom
fix/panel-collapse

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Closes #130100

What Problem This Solves

Fixes an issue where users closing the final tab in the Control UI chat side panel would be left with an empty panel occupying part of the chat.

Why This Change Was Made

In this PR, the canonical side-panel layout owner collapses the panel when closing a tab removes the final panel column. Closing one tab while others remain continues to select the nearest remaining tab; no rendering-layer guard or fallback path was added.

User Impact

Closing the last side-panel tab now returns the full width to the chat immediately, without requiring a second close action.

Evidence

  • Reproduced before the fix with node --import tsx scripts/control-ui-mock-dev.ts --host 127.0.0.1 --port 5208 --fixture workboard on origin/main.
  • The regression assertion failed pre-fix with { columns: [], open: true } and expected { columns: [], open: false }.
  • Focused tests on the final rebased head: OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs ui/src/pages/chat/sidebar-layout.test.ts ui/src/pages/chat/chat-pane.test.ts — 10/10 and 42/42 passed.
  • Targeted oxfmt --check and git diff --check origin/main...HEAD passed.
  • Production LOC: +1/−1 (net 0). Tests: +3/−3.
  • Codex autoreview on the final branch was clean with no accepted/actionable findings.
  • AI-assisted: yes; the change, tests, mock flow, and recording were inspected directly.

Before/after recording from the real workboard mock at 1280×800. The first segment shows the empty panel remaining open; after the black divider, the second segment shows the panel collapsing. The final MP4 and extracted before/after frames were inspected before upload.

panel-collapse-before-after.mp4

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 26, 2026 12:27
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 26, 2026, 11:28 AM ET / 15:28 UTC.

ClawSweeper review

What this changes

The PR changes Control UI side-panel state so closing the final tab collapses the panel and updates browser coverage for persistence after reload.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this member-authored PR open for maintainer product confirmation: current tests explicitly supported the empty type picker, while this patch intentionally replaces it with final-tab collapse. The repair is otherwise focused, but it includes a removable no-op projection block.

Priority: P2
Reviewed head: e92605a53c856346e35474372063c1acca46ecee
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and backed by targeted UI evidence, with product confirmation and a small cleanup still needed.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.
Evidence reviewed 6 items Canonical layout owner: The changed layout owner closes the panel only after removing the final column, which is the correct producer boundary for the requested behavior.
Persistence caller: Layout updates are normalized and written to per-session settings, so final-tab semantics affect persisted Control UI state.
Board projection coverage: The new test covers an empty projected Board chat and preservation of visibility when a real non-chat tab remains.
Findings 1 actionable finding [P3] Remove the redundant visibility restoration
Security None None.

Live Verification

Entry: /chat

Result: FAIL (partial) — step 2 wait_for .chat-group: locator.waitFor: Error: strict mode violation: locator('.chat-group') resolved to 13 elements:

Steps:

  • PASS goto /chat
  • FAIL wait_for .chat-group — locator.waitFor: Error: strict mode violation: locator('.chat-group') resolved to 13 elements:

How this fits together

The Control UI chat page persists each session’s side-panel layout, projects board-chat visibility into that layout, and renders the resulting panel beside the conversation. Closing a tab updates the layout before persistence and rendering consume it.

flowchart LR
A[User closes a side-panel tab] --> B[Sidebar layout owner]
B --> C[Persisted session layout]
B --> D[Board chat projection]
C --> E[Chat panel renderer]
D --> E
E --> F[Collapsed or visible side panel]
Loading

Decision needed

Question Recommendation
Should closing the final Control UI side-panel tab collapse the panel rather than retain the existing empty type picker? Adopt final-tab collapse: Accept the reported full-width-chat behavior and merge after removing the redundant projection restoration.

Why: Current test coverage and an inline type definition documented the empty-picker behavior, so accepting this UX change requires maintainer intent rather than treating it as an unambiguous regression repair.

Before merge

  • Remove the redundant visibility restoration (P3) - closeSlot only changes open when it removed the final column, so when a real tab remains it already preserves the input visibility state. The changed restoration block has no observable effect; remove it and keep the projection regression test.
  • Resolve merge risk (P1) - Merging intentionally removes the existing empty “Open a tab” picker after the last tab closes; users who relied on that picker must reopen the panel first.
  • Complete next step (P2) - Maintainer confirmation of the changed empty-picker UX is required before any mechanical cleanup or merge.

Findings

  • [P3] Remove the redundant visibility restoration — ui/src/pages/chat/chat-pane-sidebar-layout.ts:199-203
Agent review details

Security

None.

PR surface

Source +6, Tests +28. Total +34 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 7 1 +6
Tests 4 33 5 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 40 6 +34

Review metrics

Metric Value Why it matters
Production versus test delta production +7/-1; tests +33/-5 The patch is test-heavy, but four added projection lines are behaviorally redundant and should be removed before accepting the intentional UX change.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #130100
Summary: This PR is the explicit candidate repair for the reported final-tab side-panel behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Adopt collapse with the minimal owner change (recommended)
    Confirm the UX direction, remove the no-op projection code, and retain the focused final-tab and reload coverage.
  2. Retain the empty-picker workflow
    Decline the behavior change if the persistent empty picker remains the intended quick-add affordance.

Technical review

Best possible solution:

Confirm that final-tab collapse is the desired Control UI interaction, then retain the minimal closeSlot owner change and remove the redundant Board-projection restoration.

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

Yes: the PR body supplies a deterministic Control UI mock flow, and the layout-owner and browser assertions directly encode the final-tab state transition.

Is this the best way to solve the issue?

Unclear: the owner-boundary implementation is appropriate, but current tests show the removed empty-picker behavior was deliberate, so maintainers must confirm the UX direction first.

Full review comments:

  • [P3] Remove the redundant visibility restoration — ui/src/pages/chat/chat-pane-sidebar-layout.ts:199-203
    closeSlot only changes open when it removed the final column, so when a real tab remains it already preserves the input visibility state. The changed restoration block has no observable effect; remove it and keep the projection regression test.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a limited Control UI interaction change that affects chat width but not core runtime availability.
  • merge-risk: 🚨 compatibility: The patch changes the established final-tab interaction and the persisted open state seen by existing Control UI users.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR author is a repository member; the body nonetheless provides a before/after Control UI recording and focused validation results.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: The available local blame and final commit attribute the inspected sidebar-owner changes to this member; the shallow checkout cannot establish earlier feature ownership. (role: recent area contributor; confidence: low; commits: e92605a53c85; files: ui/src/pages/chat/sidebar-layout.ts, ui/src/pages/chat/chat-pane-sidebar-layout.ts)

Rank-up moves

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

  • Confirm whether final-tab collapse should replace the empty-picker workflow.
  • Remove the redundant projection restoration before merge.

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 (3 earlier review cycles)
  • reviewed 2026-08-26T12:37:04.829Z sha 23ead2b :: found issues before merge. :: [P2] Update the final-tab browser contract
  • reviewed 2026-08-26T13:19:10.890Z sha 23ead2b :: found issues before merge. :: [P2] Update the final-tab browser contract
  • reviewed 2026-08-26T14:04:48.903Z sha 00b9ce1 :: needs changes before merge. :: [P2] Preserve final-tab closure for projected Board chat

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 26, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 26, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 26, 2026
@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 7afda00 into main Aug 26, 2026
108 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…0102)

* fix(ui): collapse side panel after final tab closes

* fix(ui): preserve side panel owner state

* fix(ui): preserve projected panel closure

* fix(ui): align projected panel close contract
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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.

[Bug]: Closing the final chat side-panel tab leaves an empty panel

1 participant