Skip to content

fix(ui): sidebar header controls read misaligned after the + button lost its border - #137317

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
fix/sidebar-header-controls-optical-alignment
Sep 3, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
fix/sidebar-header-controls-optical-alignment

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Closes #137316

What Problem This Solves

Fixes an issue where operators looking at the Control UI workspace sidebar would see the three header controls — sidebar-collapse, search, and new-session + — read as misaligned, because the + sat 5px further from search than search sat from collapse.

Why This Change Was Made

The + used to render as a bordered chrome button (shell-chrome-controls__button: 1px border, --shadow-sm, panel background), and #134365 (@vyctorbrzezowski) gave it margin-inline-start: 5px as optical alignment so that filled box would not crowd the two borderless glyphs beside it. #136608 (@Patrick-Erichsen) correctly re-based the + onto the borderless .sidebar-brand__icon / .sidebar-brand__header-control pair but kept the offset, so with no box left to sit inside it became pure extra gap.

The fix is to delete the offset rather than tune a new number: .sidebar-brand__actions already declares gap, so the actions row becomes the single owner of control spacing and all three controls share one 28x28 hit box and one gap. The + stays borderless. Its 20px glyph (versus 16px) is deliberate and untouched — the plus path fills less of its viewBox, and the existing e2e already proves all three render 12px of ink.

Net production change is -1 line (a 4-line rule removed, a 3-line comment added at the new owner so nobody re-adds a per-button offset).

User Impact

The sidebar header controls now read as one rail: equal boxes, equal gaps, in Light and Dark, LTR and RTL. No behavior, no config, no new options.

Evidence

Gaps measured with getBoundingClientRect() on the mocked Control UI dev server at 1440px, deviceScaleFactor: 2:

Variant collapse -> search search -> + Control sizes
Light, before 0px 5px 28x28, 28x28, 28x28
Light, after 0px 0px 28x28, 28x28, 28x28
Dark, before 0px 5px 28x28, 28x28, 28x28
Dark, after 0px 0px 28x28, 28x28, 28x28
RTL, before 0px 5px 28x28, 28x28, 28x28
RTL, after 0px 0px 28x28, 28x28, 28x28

Light, 2x — before / after

before, light

after, light

Dark, 2x — before / after

before, dark

after, dark

RTL, 2x — before / after

before, RTL

after, RTL

Sidebar top with surrounding rows — before / after. The + stays anchored to the trailing edge; collapse and search move 5px toward it to close the hole. Nothing below the header moves.

before, sidebar top

after, sidebar top

Regression coverage lands in the existing sidebar-header geometry test, ui/src/e2e/native-nav-responsive-layout.e2e.test.ts ("keeps browser sidebar header geometry aligned in LTR and RTL"), next to the assertions that already pin hit-box size, ink width, border state, and trailing inset. The new controlGaps poll asserts [0, 0] in LTR and again after the RTL flip; it measures adjacent-box distance direction-agnostically, so it fails on pre-fix code with [0, 5] in both directions.

Local proof on this machine: mocked Control UI dev server, headless Chromium captures above (every capture opened and inspected), stylelint and oxfmt clean on both touched files, and a clean autoreview pass (gpt-5.6-sol, high, scoped-clean). Suites and typecheck are left to CI on this head.

Risk and coverage

What else could shift.

  • Other icon rows on the same tokens. --shell-chrome-control-size and .sidebar-brand__icon are shared. The change touches neither: it deletes a rule scoped to .sidebar-brand__new-thread and adds a comment. grep for sidebar-brand__new-thread shows exactly two remaining production rules (the 20px glyph size, untouched, and the cursor-policy selector list) plus the render call site.
  • Mobile / drawer header. .shell--mobile-nav .sidebar-brand__desktop-control { display: none } leaves the + as the only control in the actions row. .sidebar-brand__actions carries margin-inline-start: auto, so the row is trailing-anchored and its content width shrank by 5px while the + itself did not move. No mobile-visible change.
  • RTL. The removed property was margin-inline-start, i.e. already logical, so removal is symmetric by construction — and the RTL captures plus the new RTL assertion confirm it. The pre-existing RTL asymmetry in .sidebar-brand's physical padding: 0 2px 10px 0 (which the existing test pins as actionInset 2 in LTR, 0 in RTL) is untouched and out of scope here.
  • Collapsed sidebar and native hosts. The collapsed rail and the native-nav / web-chrome hosts hide these controls through .sidebar-brand__collapse and .sidebar-brand__desktop-control display rules and render their own chrome; none of them reads the deleted margin. The native-host assertions in the same e2e file are unchanged and still pass their own geometry checks.
  • Hover and focus rings. Both are painted on the 28x28 box by .sidebar-brand__icon, which is untouched. With gap: 0 the hover fills of adjacent controls now touch for all three pairs instead of two — the same behavior collapse and search already shipped.

What is uncovered. These captures are headless Chromium on macOS at 1440px, deviceScaleFactor: 2, default Claw theme. Not captured here: real Safari/Firefox rendering, non-default themes and custom themes (they change color tokens, not the geometry this touches), text-scale settings other than 100%, and the packaged macOS/native-nav app chrome, where the sidebar controls are hidden by design and so cannot regress from this diff. Full test suites, typecheck, and build run on CI for this head rather than locally.

Landing notes

Head moved from 3a7f9273bfe to 7d5e48da7eb. The second commit is a test-only type fix, no CSS or behavior change; the gap measurements and captures above still describe the shipped result.

ClawSweeper review of 3a7f9273bfe recorded no code findings (patch quality 4/6, findings: None, security: None). Its blockers and rank-up move were all the exact-head CI failure. Each item, and what was done:

  • Resolve merge risk (P1) — applied. The failure was mine, not main's. check-test-types-core-4 runs with noUncheckedIndexedAccess, and the gap walk I added read boxes[index], which is | undefined under that flag: native-nav-responsive-layout.e2e.test.ts(203,46) and (203,66), error TS2532: Object is possibly 'undefined'. openclaw/ci-gate was the cascade, not a second defect.
  • Complete next step (P2) — applied. Fixed at the source rather than asserted past the checker: the walk now carries the previous rect forward, so every read is non-optional by construction and no indexed access remains. Exact-head CI is green on 7d5e48da7eb.
  • Rank-up move: establish provenance for the failing checks — applied. Provenance is this PR's first commit, not current main; named above with the exact file, lines, and TS error code.
  • Resolve maintainer decision — resolved by the owner. ClawSweeper's recommendation was "approve after CI is green"; the repository owner authorized this land explicitly, which is the human handling the maintainer label asks for.

No re-review requested: the only push after the review addressed a review blocker and changed no behavior beyond it.

The new-session control kept a 5px optical offset that only made sense while
it rendered as a bordered chrome button. With the border gone it reads as a
hole in the rail: collapse -> search is 0px, search -> plus is 5px. Drop the
offset so the actions row owns one hit-box size and one gap, and assert the
gaps in the existing sidebar-header geometry e2e for LTR and RTL.
@vyctorbrzezowski vyctorbrzezowski self-assigned this Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review September 3, 2026 13:16
@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 Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 11:47 AM ET / 15:47 UTC.

ClawSweeper review

What this changes

The PR removes the five-pixel start margin from the sidebar new-session control and adds LTR/RTL browser-layout assertions that the three sidebar header controls have no gaps.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: current main still has the five-pixel margin, while this branch removes that single stale spacing owner and protects the rendered geometry in both directions. No introduced correctness or security defect was found; exact-head CI is not yet green and the MEMBER/protected-maintainer context requires human handling.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation is a clean, focused owner-boundary repair with relevant rendered-geometry coverage; exact-head CI remains the merge blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply because the PR author is a MEMBER; the PR body nevertheless supplies before/after rendered captures and a browser geometry scenario matching the changed CSS owner.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply because the PR author is a MEMBER; the PR body nevertheless supplies before/after rendered captures and a browser geometry scenario matching the changed CSS owner.
Evidence reviewed 7 items Current-main defect: Current main retains .sidebar-brand__new-thread { margin-inline-start: 5px; } while the action rail already declares gap: 0, so the reported unequal adjacent spacing remains present outside this PR.
Owner-boundary repair: The introduced production change removes only the per-control margin and leaves rail spacing owned by .sidebar-brand__actions; the renderer places all three controls in that same rail.
Caller and callee: The sidebar renderer puts collapse, search, and the renderNewSessionLink result into one actions container; the link callee applies the supplied sidebar control classes to its anchor.
Findings None None.
Security None None.

How this fits together

The Control UI sidebar header renders collapse, search, and new-session controls beside agent identity. The renderer supplies those controls, layout CSS positions their hit boxes, and browser E2E checks validate the resulting geometry.

flowchart LR
A[Sidebar renderer] --> B[Header action rail]
B --> C[Layout CSS]
C --> D[Three control hit boxes]
D --> E[Browser sidebar]
E --> F[Geometry E2E checks]
Loading

Decision needed

Question Recommendation
Should a designated maintainer approve this protected maintainer PR after the exact-head CI failures are resolved? Approve after CI is green: Accept the rail-level spacing repair once the failing exact-head checks are resolved or shown unrelated under the repository merge process.

Why: The patch is a focused repair, but its MEMBER authorship and maintainer label require explicit human handling, and the current CI gate is failing.

Before merge

  • Resolve merge risk (P1) - The exact head still has failing check-test-types-core-4 and openclaw/ci-gate checks; the supplied rollup does not establish whether that failure is attributable to this narrow UI change.
  • Complete next step (P2) - Resolve the exact-head failing check-test-types-core-4 and openclaw/ci-gate results, then obtain protected maintainer approval before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source -1, Tests +17. Total +16 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 4 -1
Tests 1 17 0 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 4 +16

Review metrics

Metric Value Why it matters
Production versus test LOC production +3/-4 (net -1); tests +17/-0 The repair removes the per-control spacing rule without production growth and adds focused rendered-geometry coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #137316
Summary: This PR is the explicit candidate repair for the current-main sidebar header-gap regression.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the owner-boundary CSS deletion and box-geometry regression coverage once the exact-head typecheck and CI gate are green and a designated maintainer approves the protected PR.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the owner-boundary CSS deletion and box-geometry regression coverage once the exact-head typecheck and CI gate are green and a designated maintainer approves the protected PR.

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

Yes, by loading the expanded desktop sidebar on current main and measuring the three rendered control boxes; current-main CSS directly supplies the extra five-pixel margin and the existing browser E2E is the focused execution entrypoint.

Is this the best way to solve the issue?

Yes. Removing the uniquely scoped stale margin lets the existing action rail remain the sole spacing owner; changing glyph size or adding another compensating offset would preserve competing layout policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a localized Control UI alignment repair with no behavior, configuration, data, or security impact.
  • 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: The external-contributor proof gate does not apply because the PR author is a MEMBER; the PR body nevertheless supplies before/after rendered captures and a browser geometry scenario matching the changed CSS owner.

Evidence

What I checked:

  • Current-main defect: Current main retains .sidebar-brand__new-thread { margin-inline-start: 5px; } while the action rail already declares gap: 0, so the reported unequal adjacent spacing remains present outside this PR. (ui/src/styles/layout.css:1069, cfa7876d49a4)
  • Owner-boundary repair: The introduced production change removes only the per-control margin and leaves rail spacing owned by .sidebar-brand__actions; the renderer places all three controls in that same rail. (ui/src/styles/layout.css:1046, 3a7f9273bfeb)
  • Caller and callee: The sidebar renderer puts collapse, search, and the renderNewSessionLink result into one actions container; the link callee applies the supplied sidebar control classes to its anchor. (ui/src/components/app-sidebar-render.ts:157, 3a7f9273bfeb)
  • Rendered regression coverage: The added test reads the real control boxes, asserts two zero gaps before and after changing document direction, and stays beside existing size, style, ink-width, inset, and RTL checks. (ui/src/e2e/native-nav-responsive-layout.e2e.test.ts:195, 3a7f9273bfeb)
  • Sibling host coverage: Existing native-web-chrome coverage still verifies the same new-session element remains borderless, focusable, and aligned to the sidebar edge; this change does not alter host visibility rules. (ui/src/e2e/native-nav-sidebar-toggle.e2e.test.ts:449, 3a7f9273bfeb)
  • Exact-head CI state: The supplied exact-head check rollup reports all Control UI and UI E2E shards successful, but check-test-types-core-4 and openclaw/ci-gate failed, so merge readiness is not established. (3a7f9273bfeb)

Likely related people:

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

Rank-up moves

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

  • Resolve or establish current-main provenance for the failing check-test-types-core-4 and openclaw/ci-gate results on this exact head.

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 (1 earlier review cycle)
  • reviewed 2026-09-03T13:25:44.450Z sha 3a7f927 :: needs changes before merge. :: none

The test-types program runs with noUncheckedIndexedAccess, so reading
boxes[index] inside the gap walk failed tsgo. Carry the previous rect
forward instead, so every read is non-optional by construction.
@vyctorbrzezowski
vyctorbrzezowski merged commit 3755763 into main Sep 3, 2026
90 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the fix/sidebar-header-controls-optical-alignment branch September 3, 2026 16:04
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
* refs/remotes/origin/main:
  fix(plugins): reject unverifiable pinned npm installs (#136725)
  improve(ui): lift sidebar section headers on hover and mark online owners (#136985)
  test(cron): reuse isolated run suite hooks (#137341)
  test(channels): reuse shared indexed call guards (#137350)
  fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317)
  fix(qa-channel): preserve conversation kind for implicit actions (#137343)
  fix: target the source checkout in Control UI repair commands (#137354)
  chore: reduce CI job count and database test overhead (#137352)
  fix(ios): preserve chat live edge across keyboard transitions (#136660)
  refactor(control-ui): consolidate mention inbox requests (#137375)
  fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146)
  fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546)
  test(queue): reuse shared deferred fixtures (#137338)
  fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…ost its border (openclaw#137317)

The Control UI sidebar header controls read as misaligned: the new-session `+`
sat 5px further from search than search sat from the sidebar-collapse control.

The `+` used to render as a bordered chrome button, and openclaw#134365 gave it
`margin-inline-start: 5px` as optical alignment so that filled box would not
crowd the two borderless glyphs beside it. openclaw#136608 correctly re-based the `+`
onto the borderless header-control base but kept the offset, so with no box
left to sit inside it became pure extra gap.

Delete the offset instead of tuning a new number: `.sidebar-brand__actions`
already declares `gap`, so it becomes the single owner of control spacing and
all three controls share one 28x28 hit box and one gap. The `+` stays
borderless. Measured collapse -> search / search -> `+`: 0px / 5px before,
0px / 0px after, in Light, Dark and RTL.

Closes openclaw#137316
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.

[Bug]: Control UI sidebar header controls misaligned after the + button lost its border

1 participant