Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(desktop): unify active-tab keyline in dark mode (MUL-6106)

Tim367e7ee6e825
diff --git a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx b/apps/desktop/src/renderer/src/components/tab-bar.test.tsx
index 46274ced6a..9970f108bc 100644
--- a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx
+++ b/apps/desktop/src/renderer/src/components/tab-bar.test.tsx
@@ -246,6 +246,54 @@ describe("TabBar active-tab title persistence", () => {
});
});
+describe("TabBar merged-tab chrome", () => {
+ // Dark mode's --surface-border is translucent, so a fill painted under the
+ // cap's own border tints its keyline lighter than the flare arcs and the
+ // content card's ring, leaving a visible step where the tab meets the frame.
+ // bg-clip-padding keeps the fill inside the border box.
+ it("keeps the active tab's page-canvas fill out from under its keyline", () => {
+ const { getByLabelText } = render(<TabBar />);
+ const cap = getByLabelText("Issues")
+ .closest("[data-tab-frame]")
+ ?.querySelector(".rounded-t-lg");
+
+ expect(cap).toHaveClass(
+ "border-surface-border",
+ "bg-page-canvas",
+ "bg-clip-padding",
+ );
+ });
+
+ // The flare's bottom row sits on top of the content card's top ring. Both
+ // draw --surface-border, so in dark mode the arc would composite over the
+ // ring rather than replace it and the two translucent keylines would stack
+ // into a markedly lighter line right at the straight-to-curve junction. The
+ // opaque --app-shell layer under the gradient makes the flare replace
+ // whatever it covers.
+ it("paints each flare on an opaque shell layer", () => {
+ const { getByLabelText } = render(<TabBar />);
+ const flares = getByLabelText("Issues")
+ .closest("[data-tab-frame]")
+ ?.querySelectorAll('[style*="radial-gradient"]');
+
+ expect(flares).toHaveLength(2);
+ for (const flare of flares ?? []) {
+ expect(flare.getAttribute("style")).toContain(
+ "var(--page-canvas) 10.2px), var(--app-shell)",
+ );
+ }
+ });
+
+ it("draws the merged cap only on the active tab", () => {
+ const { getByLabelText } = render(<TabBar />);
+ expect(
+ getByLabelText("Projects")
+ .closest("[data-tab-frame]")
+ ?.querySelector(".rounded-t-lg"),
+ ).toBeNull();
+ });
+});
+
describe("TabBar overflow", () => {
it("keeps tabs readable in a bounded horizontal scroller", () => {
state.byWorkspace.acme.tabs = Array.from({ length: 8 }, (_, index) => ({
diff --git a/apps/desktop/src/renderer/src/components/tab-bar.tsx b/apps/desktop/src/renderer/src/components/tab-bar.tsx
index 3f95fbf3c4..5ff7951bbd 100644
--- a/apps/desktop/src/renderer/src/components/tab-bar.tsx
+++ b/apps/desktop/src/renderer/src/components/tab-bar.tsx
@@ -48,14 +48,23 @@ const TAB_ENTRY_EASE = [0.22, 1, 0.36, 1] as const;
// Chrome-style merged tab: the active tab shares the content surface's fill
// and flares into it through concave bottom corners. Each flare is a small
-// square whose radial gradient carves a quarter-circle notch (shell shows
-// through), strokes a 1px arc that continues the tab's side border into the
+// square whose radial gradient carves a quarter-circle notch (the shell fill
+// below), strokes a 1px arc that continues the tab's side border into the
// content card's top ring, and fills the rest with the surface color. The
// 0.4px stop spread anti-aliases the arc.
+//
+// The gradient sits on an opaque --app-shell layer rather than letting the
+// shell show through, because the flare's bottom row overlaps the content
+// card's top ring. In dark mode --surface-border is translucent
+// (oklch(1 0 0 / 10%)), so the arc would composite over the ring instead of
+// replacing it and the two keylines would stack into a markedly lighter line
+// right where the straight ring meets the curve. The shell layer makes the
+// flare opaque over everything it covers, so the arc reads the same tone
+// whether it crosses the ring or the bare shell.
const TAB_FLARE_RADIUS = 10;
const tabFlareBackground = (side: "left" | "right") => {
const r = TAB_FLARE_RADIUS;
- return `radial-gradient(circle at top ${side}, transparent ${r - 1.2}px, var(--surface-border) ${r - 0.8}px, var(--surface-border) ${r - 0.2}px, var(--page-canvas) ${r + 0.2}px)`;
+ return `radial-gradient(circle at top ${side}, transparent ${r - 1.2}px, var(--surface-border) ${r - 0.8}px, var(--surface-border) ${r - 0.2}px, var(--page-canvas) ${r + 0.2}px), var(--app-shell)`;
};
type TabSnapshot = {
@@ -338,7 +347,13 @@ function SortableTabItem({
isDragging && "opacity-60",
)}
>
- <span className="absolute inset-x-0 top-0 bottom-2.5 rounded-t-lg border border-b-0 border-surface-border bg-page-canvas" />
+ {/* bg-clip-padding keeps the page-canvas fill out from under the
+ 1px border. In dark mode --surface-border is translucent
+ (oklch(1 0 0 / 10%)), so a fill behind it would tint this
+ keyline lighter than the flare arcs and the content card's
+ ring, which both composite over --app-shell. That leaves a
+ visible step exactly where the tab merges into the frame. */}
+ <span className="absolute inset-x-0 top-0 bottom-2.5 rounded-t-lg border border-b-0 border-surface-border bg-page-canvas bg-clip-padding" />
<span className="absolute inset-x-0 bottom-0 h-2.5 bg-page-canvas" />
<span
className="absolute bottom-0 size-2.5"