Skip to content

fix(desktop): stop the collapsed rail repainting a third tone in dark mode - #2187

Merged
Astro-Han merged 2 commits into
mainfrom
fix/collapsed-rail-dark-top-seam
Aug 4, 2026
Merged

fix(desktop): stop the collapsed rail repainting a third tone in dark mode#2187
Astro-Han merged 2 commits into
mainfrom
fix/collapsed-rail-dark-top-seam

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Collapsed, the sidebar rail painted a 49px slab that ran to the window top — past the content plate's 4px gutter and under the traffic-light cluster — in dark mode only.

shell-layout.css overrode the collapsed rail's column material with --color-background-surface so the lights would sit on one surface instead of straddling a column edge narrower than they are. That was written while AppShell's own surface was still the content column's material. .astryx-layout-content now paints --agents-layout-bg (== --surface-canvas == --color-background-body), so the two columns already share one material and the override was the only thing breaking the band:

  • Light: --color-background-surface happens to equal the floating plate's fill (on darwin --color-bg-container is --background), so the slab was invisible.
  • Dark: the plate lifts 0.035L off --background, so the rail landed on a third tone — measured L 0.205 against the canvas's 0.18 — and the slab showed.

Drop the override. The rail wears its column's material in both collapse states, which is what "one surface" meant in the first place. The border-inline-end-color: transparent half of the old rule was already covered by the unconditional rule below it.

The sidenav's background-color, border-color ease in makaTheme.ts goes with it: neither property changes across the collapse any more, so it had nothing left to interpolate. maka.css regenerated with npm run astryx:theme.

Verification

New computed-style contract in e2e/sidebar-geometry.spec.ts — the rail's painted material must equal .astryx-layout-content's in both collapse states, with a transparent inline-end edge. Red on main (collapsed rail 255,255,255 against the column's 247,247,247), green here.

Two details the contract had to get right, both measured against the pre-fix rule rather than assumed:

  • Compare painted RGBA bytes, not computed-style strings. Chromium serializes a relative oklch(from …) token as oklab(), so equal paint can read as unequal text.
  • Take two agreeing reads rather than one sample. The pre-fix rule eased into its new color, so right after the toggle the rail still reports the material it is supposed to keep — a single read and a poll-until-equal both passed against the bug.

Computed styles read over CDP from the live dev app (darwin, vibrancy shell) for the tone analysis above:

state theme .astryx-app-shell-sidenav .astryx-layout-content .maka-panel-detail
collapsed (before) dark oklch(0.205 0.004 286) oklch(0.18 0.004 286) oklch(0.24 0.004 286)
collapsed (after) dark oklch(0.18 0.004 286) oklch(0.18 0.004 286) oklch(0.24 0.004 286)
collapsed (before) light oklch(1 0 0) oklch(0.975 0 0) oklch(1 0 0)
collapsed (after) light oklch(0.975 0 0) oklch(0.975 0 0) oklch(1 0 0)
expanded (after) dark oklch(0.18 0.004 286) oklch(0.18 0.004 286)
expanded (after) light oklch(0.975 0 0) oklch(0.975 0 0)

Also ran: npm run format:check, npm run lint, npm run typecheck --workspace @maka/desktop, and the full sidebar-geometry spec (3 passed) — all clean.

Intended consequences on the other platform/theme combinations

Expanded is unchanged everywhere. Collapsed moves wherever the rail was previously wearing the plate's fill instead of its column's:

  • Light, all platforms: the rail goes 1.0 → 0.975, the value its own expanded state already used. The plate's top-left radius now reads against the canvas the same way it does on the other three sides.
  • Dark, non-darwin: the plate is --background there, so the rail moves 0.205 → 0.18 and now contrasts with the plate along its full height, where the two previously matched. This is the same relationship the expanded rail has always had on those platforms.

Keeping the rail on the plate's fill is what produced the darwin-dark bug, and preserving it would need a per-platform material fork. Both moves are the same decision: the rail wears its column's material, in every state and on every platform.

… mode

The collapsed sidebar rail overrode its column material with --color-background-surface so the traffic lights would sit on one surface. That was written while AppShell's surface was still the content column's material; .astryx-layout-content now paints --agents-layout-bg (== --color-background-body), so both columns already share one material.

In light mode the override happens to equal the floating plate's fill and stayed invisible. In dark mode the plate lifts 0.035L off --background, so the rail landed on a third tone (L 0.205 against the canvas's 0.18) and painted a 49px slab running to the window top, past the plate's 4px gutter and under the light cluster.

Drop the override; the rail wears its column's material in both states. The sidenav's background-color/border-color ease goes with it — neither property changes across the collapse any more.
The bug this fixes is a state-dependent token mapping, which AGENTS.md says to lock with a computed-style contract rather than a screenshot. Assert the rail's painted material against the column it must match — not against a literal gray — in both collapse states, plus the transparent inline-end edge.

Compare painted RGBA bytes, not computed-style strings: Chromium serializes a relative oklch(from …) token as oklab(), so equal paint can read as unequal text.

Take two agreeing reads rather than one sample or a poll-until-equal. A re-materialing rule eases into its new color, so right after the toggle the rail still reports the material it is supposed to keep; measured against the pre-fix rule, both cheaper forms passed. Settled, the pre-fix rule fails with rail 255,255,255 against column 247,247,247.
@Astro-Han
Astro-Han marked this pull request as ready for review August 4, 2026 18:49
@Astro-Han
Astro-Han merged commit 9597efb into main Aug 4, 2026
11 checks passed
AidenNovak pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 7, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
AidenNovak pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 9, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
M4n5ter pushed a commit to AidenNovak/maka-agent that referenced this pull request Aug 26, 2026
…c lights

The macOS traffic-light cluster is ~54px wide (x 17..71: 14px discs on
20px centres — main-window.ts, apache#2144) but the collapsed rail is 48px,
so the yellow disc straddled the rail/plate seam and the green disc sat
on the plate's own top-left corner. No position fits the cluster inside
a 48px rail, so the seam is removed from under it instead.

Collapsed, the rail puts on the plate's material
(--agents-content-area-bg) and the plate docks flush under the
titlebar (top margin and top corners to zero): one continuous surface
where the lights sit. All three properties ease with the existing
collapse width animation (--duration-large). Expanded keeps the
floating-plate design untouched.

This is the deliberate successor to the repaint apache#2187 removed: that one
wore --color-background-surface, which light mode happened to share
with the plate and dark mode did not — a third tone under the light
cluster. Wearing the plate's own token fuses light and dark by
construction.

The sidebar-geometry material contract moves with the change: expanded
still asserts rail == column (the apache#2187 regression lock), collapsed now
asserts rail == plate plus flush margin/radius, compared as painted
RGBA bytes so palettes and themes survive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant