fix(ui): restore sidebar/thread divider, unify border alpha to 0.08#845
Conversation
DESIGN.md L226/L228 calls for a 1px --border-weaker hairline between the three shell columns, but layout.tsx L2483 had no border-right on <aside>. After the light/dark surface collapse (#834, #841) that divider became the only signal carrying the boundary: dark sidebar and canvas both resolve to #1A1917 (zero color delta), and light's 6-unit brightness gap reads as "panels glued together" without a hairline. Two changes: 1. Add `border-r border-border-weaker` to the sidebar <aside>. 2. Unify dark --border-base / --border-weak / --border-weaker from rgba(255,255,255,0.06) to rgba(255,255,255,0.08), matching the light side at 0.08 black. The 0.06 vs 0.08 drift was unjustified at this scale (visually indistinguishable in side-by-side preview) and the bumped value lets the dark hairline carry the boundary without becoming the only signal that's too faint to see. The token bump is global to dark and affects every dark border: tool cards, popovers, code fences, button outlines. Snap diff shows they read slightly more defined, still calm. Verify: cd packages/ui && bun test theme-parity # 200 pass / 403 expects cd packages/app && bun test shell-frame-contract # 9 pass / 95 expects bun --cwd packages/{ui,app,opencode} run typecheck # clean bun run snap app-shell sidebar session-turn-changes sidebar-divider
📝 WalkthroughWalkthroughThis PR increases the opacity of dark-mode border tokens ( ChangesSidebar Border Styling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a visible boundary between the sidebar and the main thread by adding a right border to the sidebar layout and increasing the alpha transparency of border tokens in dark mode from 0.06 to 0.08. It also adds a new E2E snapshot test and a theme parity test to ensure visual consistency. Feedback on the E2E test suggests refining the screenshot clipping logic to use the sidebar's vertical offset and adopting stricter fallback values for viewport dimensions to prevent false positives.
Perf delta summaryComparator: pass
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
… preview anchor Crop y/height were taken from y:0 + viewport height, which sliced the titlebar above the sidebar into the frame instead of the sidebar↔thread seam. Anchor both to the sidebar bounding box so the crop sits inside the sidebar's vertical extent. Also reframe the comment: this snap is a human-eye preview anchor, not a regression gate. Token regressions are locked by theme-parity; the snap only asserts the PNG buffer is non-empty.
Summary
Restore the 1px hairline between the sidebar column and the thread column, and unify the dark hairline alpha to match light. After the surface collapses in #834 and #841, both themes lost a visible boundary at the sidebar↔thread seam: dark sidebar and canvas resolve to the same
#1A1917, and light's 6-unit brightness gap reads as "panels glued together" without a hairline.Two changes:
border-r border-border-weakerto the sidebar<aside>inpackages/app/src/pages/layout.tsx. The class swaps via the existing:root[data-color-scheme="dark"]rule, no Tailwinddark:variant needed.--border-base / --border-weak / --border-weakerfromrgba(255,255,255,0.06)torgba(255,255,255,0.08). Light side stays atrgba(0,0,0,0.08); both themes now resolve to alpha 0.08, mirroring the same intent on both sides.A new
theme-paritytest locks the value in all three theme blocks (:root,:root[data-color-scheme="dark"],@media (prefers-color-scheme: dark)) so a silent rollback fails CI.Why
docs/DESIGN.mdL226/L228 already specifies "internal divisions use 1px--border-weaker" and "the 1px hairline between columns is the only divider — no color contrast". The spec was correct; the code never rendered theborder-righton the sidebar. Direct user report after #841: "侧边会话栏和会话流黏在一起,看不清了" — both themes confirmed in side-by-side preview.On the alpha unification: 0.06 (dark) vs 0.08 (light) was a perceptual-asymmetry argument that does not hold up at this scale — the two values are visually indistinguishable in a real side-by-side. Keeping two numbers when one suffices is unjustified drift, and the bumped dark value carries the divider role better in the one place where the alpha is the only boundary signal.
Related Issue
No tracking issue. Reported direct, fixed direct.
Human Review Status
Pending
Review Focus
packages/ui/src/styles/theme.cssL300-307 and L445-447 — dark border alpha bump. Affects every dark border in the app (tool cards, popovers, code fences, button ghosts), not just the sidebar divider. Snap diff against current dev shows they read slightly more defined and stay calm.packages/ui/src/theme/themes/pawwork.jsonL148-150 — dark border alpha bump mirrored in the theme JSON registration path.packages/app/src/pages/layout.tsxL2486 — the only callsite change. Addingborder-r border-border-weakerto the sidebar<aside>; the resize handle and main pane geometry are untouched.packages/ui/test/theme-parity.test.ts— new describe block locks both themes at 0.08 across all three theme blocks.packages/app/e2e/snap/sidebar-divider.snap.ts— new focused snap as a human-eye preview anchor, not a regression gate. The test only writes the PNG and asserts the buffer is non-empty; token-level regressions are caught bytheme-parity. App-shell covers the full composition; this one zooms in on the 80px window straddling the seam so reviewers can see the hairline. Crop is anchored to the sidebar bounding box (y/height frombox.y/box.height) so the titlebar above the sidebar does not leak into the frame.Risk Notes
border-border-*callsite reads ~33% stronger (0.06 → 0.08 white alpha). Verified in three snap grids:app-shell(full shell stack),sidebar(popover and sort menu borders),session-turn-changes(tool card and diff card borders). All read cleaner, none read "hard".docs/DESIGN.mdis local-only in this checkout per AGENTS.md ("docs/are local-only in this checkout and excluded via.git/info/exclude"), so no in-PR doc edit; the maintainer will sync the prose after merge as part of normal doc upkeep.How To Verify
Screenshots or Recordings
docs/design/preview/screenshots/sidebar-divider.png— focused crop of the new hairline in both themes.docs/design/preview/screenshots/app-shell.png— full shell composition, divider visible at the sidebar right edge in both themes.docs/design/preview/screenshots/session-turn-changes.png— tool / diff cards in dark with the bumped 0.08 border, still calm.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.Summary by CodeRabbit
New Features
Style
Tests