') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); fix(desktop): fuse the collapsed rail with the plate under the traffic lights by AidenNovak · Pull Request #2396 · apache/maka · GitHub
Skip to content

fix(desktop): fuse the collapsed rail with the plate under the traffic lights - #2396

Closed
AidenNovak wants to merge 1 commit into
apache:mainfrom
AidenNovak:fix/collapsed-rail-plate-fusion
Closed

fix(desktop): fuse the collapsed rail with the plate under the traffic lights#2396
AidenNovak wants to merge 1 commit into
apache:mainfrom
AidenNovak:fix/collapsed-rail-plate-fusion

Conversation

@AidenNovak

@AidenNovakAidenNovak commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The macOS traffic-light cluster is ~54px wide (trafficLightPosition {x:17, y:14}, 14px discs on 20px centres — #2144) but the collapsed rail is 48px: the 🟡 disc straddles the rail/plate seam and the 🟢 disc sits on the plate's top-left corner.

Fix (collapsed state only, pure CSS)

The seam is removed from under the cluster: the rail puts on the plate's material and the plate docks flush.

PropertyExpanded (unchanged)Collapsed (new)
rail backgroundfloor material --agents-layout-bgplate material--agents-content-area-bg
plate top margin4px0
plate top corners12px0

All three ease with the existing collapse animation (--duration-large). Wearing the plate's own token (not --color-background-surface, which was #2187's third-tone bug) fuses light and dark by construction.

Before/After

Same live Electron window, fix toggled on/off via injected CSS. Light + dark, traffic-light positions drawn in (OS buttons aren't in webContents captures).

Notes on scope

  • Pure CSS — one file, +44 lines. The e2e contract this PR originally carried (sidebar-geometry.spec.ts) was deleted upstream by the test: delete low-value and redundant suite files #2462 test trim; following that direction, the change is now CSS-only and verified live against the shipping window instead (rail and plate report identical painted RGBA bytes in both palettes when collapsed).
  • Rebased onto current main; verified against the post-fix(ui): drop ceremonial Astryx patches; two-tone shell floor #2574 two-tone floor design (rail --agents-layout-bg, plate --agents-content-area-bg) — the fusion still holds: collapsed rail reads the plate's paint.

Testing

  • Live e2e window, collapsed: rail == plate == oklch(1 0 0), margin-top 0px, top-left radius 0px (light); same fusion in dark.
  • Desktop full build green.

@AidenNovak
AidenNovakforce-pushed the fix/collapsed-rail-plate-fusion branch 2 times, most recently from 4cbdf7f to e549ca2CompareAugust 7, 2026 06:23
Astro-Han
Astro-Han previously approved these changes Aug 7, 2026

@Astro-HanAstro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — the fusing is clean: same collapsed gate, same cascade layer, token-driven, no !important, and the color-contract test rework (RGBA byte compare + settle sampling) is stronger than a screenshot. Two P2s worth a look before this lands:

  1. Docked content slides 4px under the drag band. The collapsed margin-block-start: 0 (shell-layout.css:238-240) moves the plate top to y=0, so content starts at 32px — but the titlebar drag strip covers y=4..36 (shell-layout.css:294-297). Workbar tabs and scrolled message content now have their top 4px inside the drag region — exactly the app-region hygiene class that has bitten this repo twice (titlebar buttons, breadcrumb clicks). The docked state should use the --h-titlebar clearance (or the formula should track the margin), plus a geometry assertion that content.top ≥ strip.bottom.
  2. The three new transitions aren't gated during drag-resize. The width ease is deliberately suppressed under [data-resizing] (shell-layout.css:172-182 comment), but background-color / margin-block-start / border-radius now animate mid-drag when crossing the 160px threshold, and oscillate on repeated crossings. Same gate should cover them (e.g. transition-duration: 0.01ms under [data-resizing], like chat-detail.css:87-90).

P3s: the test hardcodes token values (4px/12px) against this file's own 'never against a literal' philosophy; the macOS traffic-light rationale applies globally (Windows/Linux also get the new rail color/radius); the background-color transition also eases theme switches for 280ms. Approving either way.

@AidenNovak
AidenNovakforce-pushed the fix/collapsed-rail-plate-fusion branch from e549ca2 to e1be88cCompareAugust 9, 2026 11:15

@Astro-HanAstro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the careful visual work here. I tested the before/after states in the same real Electron window. The seam improvement is real, but quite subtle, while the current approach introduces two interaction risks:

  • [P2] Moving the plate to margin-block-start: 0 puts its first 4px of content inside the native titlebar drag region.
  • [P2] The new background, margin, and radius transitions remain active during sidebar resize, unlike the existing width transition guard.

I think this can be much smaller: keep the plate geometry unchanged and only let the collapsed rail use --agents-content-area-bg. That should remove the relevant color seam without moving content, changing corner geometry, or adding transitions.

If that single paint change is not sufficient, I would prefer keeping the current UI rather than adding layout and interaction side effects for this small visual difference. Thanks again for exploring this carefully.

@Astro-Han

Copy link
Copy Markdown
Contributor

/agentic_review

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0)📘 Rule violations (0)📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@Astro-HanAstro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — this is unusually well-reasoned CSS, and I want to be specific about why before I raise anything.

The diagnosis is the good part: the cluster is ~54px and the rail is 48px, so no amount of nudging trafficLightPosition fits it, and the only move left is to stop having a seam under it. Reaching for that instead of shaving pixels is the right instinct. Wearing the plate's own --agents-content-area-bg rather than --color-background-surface — and saying in the comment that the latter is precisely what made #2187 read as a third tone in dark mode — means the fusion holds in both palettes by construction rather than by coincidence. And the note about why the transitions live on the base rules (a state-scoped transition stops applying the instant its selector stops matching, so the expand leg would jump) is exactly the kind of thing that gets silently "cleaned up" by the next person if it is not written down.

Two [P2]s, both about reach rather than correctness. No [P0]/[P1].

The first is the one I would most like your view on: the problem being solved is macOS-only, but the fix is not scoped to macOS. There are no traffic lights in that corner on Windows or Linux, yet those users also lose the floating-plate look when the sidebar is collapsed. This repo already tags <html> with data-os="darwin" (theme-glass.css uses it), so scoping is available and idiomatic here.

Separately, this PR was opened on Aug 7 and its green checks carry the older check names (changes, typecheck, test_workspaces, storybook), so that green predates the current required set and mergeable currently reports UNKNOWN. Worth a rebase so the result reflects today's gates.

Review assisted by AI (Claude Opus 5). Findings were verified against the files at this head; the reviewer is accountable for them.

light and dark both read as one surface by construction (verified live
against the shipping window in both palettes: rail and plate report the
same painted RGBA bytes when collapsed). */
.appFrame[data-sidebar-state='collapsed'] .maka-shell-astryx .astryx-app-shell-sidenav {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] The whole justification for the fusion — spelled out well in the comment above — is the macOS traffic-light cluster. On Windows and Linux there is no cluster in that corner, so there is nothing for the seam to cross, yet these three rules still apply: the rail changes material, the plate loses its top margin, and the top corners square off whenever the sidebar is collapsed.

So non-macOS users get a visual change to the collapsed state that solves a problem they do not have, and they lose the floating-plate design the expanded state deliberately keeps.

The mechanism is already here: theme-glass.css tags <html> with data-os="darwin" from window.maka.app.info(), so prefixing this block is a small, idiomatic change.

I am raising it as a question rather than asserting it is wrong, because there is a coherent argument the other way — that a single collapsed appearance across platforms is worth more than platform-specific fidelity, and that the flush dock reads fine on its own merits. If that is your reasoning, it belongs in the comment block above alongside the rest, since the current text explains the macOS motivation and leaves a reader assuming the rule is macOS-scoped.

material and the plate's. The transition lives on the BASE rule so both
directions animate — a state-scoped transition drops the moment its own
selector stops matching, which would leave the expand leg jumping. */
transition: background-color var(--duration-large) var(--ease-out-strong);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Putting the transition on the base rule is right for the reason you give, and I would not move it. The cost is that it now applies to everybackground-color change on this element, not only the collapse.

The concrete one is theme switching. I looked for a guard — a no-transitions class toggled around palette changes, or similar — and there is none in apps/desktop/src. So on light/dark switch the rail will ease over --duration-large while the surrounding chrome repaints instantly, leaving it visibly lagging behind the rest of the window for the length of a "large" duration. That is a normal user path, not a corner case.

Same consideration in principle for border-radius on .mainColumn at line 126, though corner radius is far less likely to change for unrelated reasons, so in practice this is really about the background.

The narrow fix is to scope the transition by property and state without scoping the rule — e.g. keep the declaration on the base rule but let a [data-theme-switching] (or whatever this app uses for palette changes) suppress it. If no such hook exists, that is worth knowing too, and this comment can stand as the record of the tradeoff.

I checked the transitions you added to .maka-panel-detail and .mainColumn for the same issue — those properties are not touched elsewhere, so they are clean.

@jackwenerjackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review of e1be88c5a7021f59e4dee5e5cb4199e15a5d7695: NO-GO. The PR description does include the required light/dark before/after evidence, and the current-main merge-tree is clean. I independently confirmed the existing exact-head interaction concerns remain live: the drag-region overlap is line-anchored below; the resize-triggered collapse still changes these three newly-transitioned properties while only the width transition has a [data-resizing] guard; and the unresolved platform-scope/theme-transition threads (3836047653, 3836047655) still match the current code. No additional P0/P1.

The hosted successes are from 2026-08-09's older workflow/base world. After the blockers are fixed on a new head, please rerun today's path-filtered gates; these runs should not be used as approval evidence for the repaired result. COMMENT only; no APPROVE or merge action.

}

.appFrame[data-sidebar-state='collapsed'] .maka-shell-astryx .maka-panel-detail {
margin-block-start: 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2][① normal collapsed-sidebar path] Setting the frame's top margin to 0 changes the geometry without changing --maka-plate-titlebar-clearance: with the live tokens, content starts at 0 + (36px - 4px) = 32px, while the window's sole drag strip spans y=4..36. That leaves the first 4px of the plate's usable content inside -webkit-app-region: drag; anything there that is not explicitly carved out as no-drag can start a window move instead of receiving the pointer. The same numbers and selectors survive the clean merge with current main. Please keep the content edge at or below y=36 (for example, make the clearance track the zero margin) and add a geometry assertion equivalent to content.top >= titlebar.bottom.

@Astro-Han
Astro-Han dismissed their stale reviewAugust 23, 2026 20:27

Dismissing a stale approval. This is bound to e549ca20; the PR has advanced well past it, and there are currently three unresolved [P0]–[P2] threads at the present head. This repository does not dismiss stale reviews automatically, so leaving the approval in place means the PR would flip straight to mergeable the moment CI goes green, with those findings still open. Re-approval should be at the head that carries the fixes.

…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
M4n5terforce-pushed the fix/collapsed-rail-plate-fusion branch from e1be88c to c93208eCompareAugust 26, 2026 08:41
@github-actionsgithub-actionsBot added the effort/S Under 100 readable lines label Aug 27, 2026
@Astro-Han

Copy link
Copy Markdown
Contributor

Thanks for exploring the traffic-light seam carefully. The underlying state this PR targets has since been removed by #3808: current main closes the collapsed sidebar to 0px, hides its navigation from focus and pointer interaction, and keeps only the titlebar restore action.

As a result, the original 48px rail no longer exists for the macOS traffic-light cluster to cross, and applying this CSS now would restore assumptions from an obsolete collapsed-sidebar design. I propose closing this PR as superseded by #3808.

Please do push back with a current-main reproduction if a residual seam remains; that would be better handled against the new zero-width collapsed state.

AI-assisted review disclosure: Codex assisted with the current-main history and CSS comparison; Astro-Han verified the superseding behavior and owns this closure decision.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/SUnder 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@AidenNovak@Astro-Han@jackwener