Skip to content

Fix default chat workspace files rail#90380

Closed
mushuiyu886 wants to merge 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-90359-chat-workspace-rail
Closed

Fix default chat workspace files rail#90380
mushuiyu886 wants to merge 1 commit into
openclaw:mainfrom
mushuiyu886:feat/issue-90359-chat-workspace-rail

Conversation

@mushuiyu886

Copy link
Copy Markdown
Contributor

Summary

  • Keep the WebChat workspace files rail collapsed on initial chat render.
  • Add an explicit composer toolbar toggle plus rail close action for users who want to inspect workspace files.
  • Make the chat workbench single-column by default and switch to the two-column rail layout only while the rail is open.

Fixes #90359

Real behavior proof

Behavior addressed: WebChat no longer shows or reserves the right-side Workspace Files rail by default after the v2026.6.1 regression, while preserving an explicit user path to open and close the rail.

Real environment tested: Local Linux checkout with Node v22.22.0, the Control UI Vite dev server, and headless Google Chrome from /usr/bin/google-chrome. The browser proof used the real openclaw-app DOM with a connected test state and a fake gateway client only for the agents.files.list response.

Exact steps or command run after this patch:

node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
node scripts/run-oxlint.mjs ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.ts ui/src/ui/app-render.ts
git diff --check
env -C ui corepack [email protected] build
node --input-type=module <<'NODE'
# Started a Vite dev server for ui/, launched Playwright with /usr/bin/google-chrome,
# injected connected openclaw-app state plus a fake agents.files.list response,
# then asserted default collapsed, explicit open, and close behavior in the real DOM.
NODE

Evidence after fix:

node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
Test Files  1 passed (1)
Tests  95 passed (95)
{
  "before": {
    "rail": false,
    "path": null,
    "file": null,
    "columns": "1142px",
    "expanded": "false",
    "disabled": false
  },
  "opened": {
    "rail": true,
    "path": "/workspace",
    "file": "AGENTS.md ... 2 KB",
    "columns": "862px 280px",
    "expanded": "true",
    "disabled": false
  },
  "closed": {
    "rail": false,
    "path": null,
    "file": null,
    "columns": "1142px",
    "expanded": "false",
    "disabled": false
  }
}
node scripts/run-oxlint.mjs ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.ts ui/src/ui/app-render.ts
# passed with no output

git diff --check
# passed with no output

env -C ui corepack [email protected] build
✓ built in 2.00s

Observed result after fix: The initial chat render remains full-width with no .chat-workspace-rail and a single workbench column; clicking Workspace files opens the rail, loads and displays AGENTS.md, and changes the workbench to a two-column layout; clicking the rail close button hides it and restores the single-column layout.

What was not tested: I did not test a live OpenClaw daemon or a real workspace on disk; the browser proof injects a fake gateway client response because this change is limited to Control UI rendering and state transitions for the workspace files rail.

Regression Test Plan

  • Coverage level: focused UI unit test plus browser DOM verification.
  • Target test file: ui/src/ui/views/chat.test.ts.
  • Scenario locked in: workspaceFiles.open === false keeps the rail absent and the workbench unmodified, while workspaceFiles.open === true renders the rail and close action.
  • Why this is the smallest reliable guardrail: the regression came from rendering the rail whenever workspace file data existed, so the view test directly locks the open-state gate that controls that behavior.

Root Cause

  • Root cause: renderWorkspaceFileRail() treated the presence of workspaceFiles as an instruction to render the rail, and the workbench CSS always reserved a second grid column.
  • Missing detection / guardrail: there was no regression test asserting that workspace file data can exist while the rail remains hidden until the user explicitly opens it.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 4, 2026, 11:13 AM ET / 15:13 UTC.

Summary
The PR adds an explicit WebChat workspace-files toggle/close path and gates the rail render, file loading, and two-column chat layout on an open state with focused view tests.

PR surface: Source +66, Tests +49. Total +115 across 4 files.

Reproducibility: yes. Current main source inspection gives a high-confidence path: chat supplies workspaceFiles, renderWorkspaceFileRail renders the rail whenever that prop exists, and the desktop grid reserves the right column.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Mantis proof suggestion
A short browser visual proof would help maintainers confirm the layout behavior users actually see, even though the supplied DOM proof is already sufficient. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify WebChat opens full-width with no Workspace Files rail by default, then the Workspace files toolbar button opens it and the rail close button hides it again.

Next step before merge

  • No repair lane is needed because the PR has no concrete blocking findings and should proceed through normal maintainer review and CI.

Security
Cleared: The diff is limited to Control UI TypeScript/CSS/tests and does not touch dependencies, workflows, secrets, package metadata, or code execution surfaces.

Review details

Best possible solution:

Land this narrow UI fix after normal maintainer and CI review; keep broader persisted resize/collapse preferences in #90246 if maintainers want that follow-up.

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

Yes. Current main source inspection gives a high-confidence path: chat supplies workspaceFiles, renderWorkspaceFileRail renders the rail whenever that prop exists, and the desktop grid reserves the right column.

Is this the best way to solve the issue?

Yes. The PR fixes the regression at the owner boundary by making rail visibility explicit state, gating load/render/layout on that state, and preserving file access through a toolbar toggle and close button.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 20c4e9475a7f.

Label changes

Label changes:

  • add P2: This PR fixes a normal-priority WebChat layout regression with limited blast radius but real daily usability impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix browser DOM output and terminal validation showing the rail hidden by default, opened by the toolbar button, and closed again.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix browser DOM output and terminal validation showing the rail hidden by default, opened by the toolbar button, and closed again.

Label justifications:

  • P2: This PR fixes a normal-priority WebChat layout regression with limited blast radius but real daily usability impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix browser DOM output and terminal validation showing the rail hidden by default, opened by the toolbar button, and closed again.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix browser DOM output and terminal validation showing the rail hidden by default, opened by the toolbar button, and closed again.
Evidence reviewed

PR surface:

Source +66, Tests +49. Total +115 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 86 20 +66
Tests 1 52 3 +49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 138 23 +115

What I checked:

  • Repository policy read: Root AGENTS.md and the scoped UI AGENTS.md were read fully; no matching maintainer note existed for these UI files because .agents/maintainer-notes only contained telegram.md. (AGENTS.md:1, 20c4e9475a7f)
  • Current main reproduces the default rail problem by source inspection: renderChat currently calls renderWorkspaceFileRail(props.workspaceFiles), and renderWorkspaceFileRail returns the rail whenever the prop object exists. (ui/src/ui/views/chat.ts:1008, 20c4e9475a7f)
  • Current main supplies workspaceFiles and auto-loads file data in chat: renderApp passes a workspaceFiles object into renderChat and auto-loads agents.files.list while chat is connected, so the rail condition is satisfied in the normal chat render path. (ui/src/ui/app-render.ts:2097, 20c4e9475a7f)
  • Current main reserves the desktop rail column: The current .chat-workbench grid reserves minmax(230px, 280px) for the workspace rail on desktop widths, matching the reported chat-space loss. (ui/src/styles/chat/sidebar.css:2, 20c4e9475a7f)
  • PR diff fixes the correct gate: The patch adds ChatWorkspaceFilesState.open, requires it before auto-loading/rendering the rail, adds explicit toggle and close callbacks, and only applies the two-column class while open. (ui/src/ui/app-render.ts:681, 4121ed55b0e5)
  • Focused regression coverage is included: The patch adds a hidden-by-default test and updates the opened-rail test to check aria-expanded, the open layout class, file click, and close action. (ui/src/ui/views/chat.test.ts:865, 4121ed55b0e5)

Likely related people:

  • BunsDev: GitHub commit search for the exact chat-workspace-rail symbol points to the dashboard-v2 UI refactor that introduced the rail/layout code. (role: introduced behavior; confidence: high; commits: f76a3c5225bb, a710366e9ece; files: ui/src/ui/views/chat.ts, ui/src/styles/chat/sidebar.css)
  • vincentkoc: Recent GitHub path history shows multiple Control UI chat rendering and composer performance commits touching the same chat/app-render surfaces near the release that exposed the regression. (role: recent area contributor; confidence: medium; commits: 61574eb50bd4, 6627b4fbdd31, 402e2bb81a73; files: ui/src/ui/views/chat.ts, ui/src/ui/app-render.ts)
  • steipete: Recent app-render path history includes chat composer-control work that is adjacent to the new toolbar toggle location. (role: adjacent UI contributor; confidence: medium; commits: d328a0d7a0da, 2b30951b8090; files: ui/src/ui/app-render.ts, ui/src/ui/views/chat.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@shakkernerd

Copy link
Copy Markdown
Member

Closed as superseded by #92779.

Maintainers chose the collapsed-strip Workspace Files UX instead of the fully hidden-by-default direction from this PR. The landed fix starts the panel collapsed by default and lets users expand it when needed.

Final landed SHA: dbf24fe.

Thanks @mushuiyu886!

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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

Regression: “Workspace Files” right sidebar is shown by default in chat after upgrading to v2026.6.1

3 participants