Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(desktop): stop the tab flares biting into a neighbour's hover pill (MUL-6160) (#6942)
Bohan Jiang1ddc3812aa43
diff --git a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx b/apps/desktop/src/renderer/src/components/tab-bar.test.tsxindex 13b90e5fe6..2b92783fb7 100644--- a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx+++ b/apps/desktop/src/renderer/src/components/tab-bar.test.tsx@@ -284,6 +284,32 @@ describe("TabBar merged-tab chrome", () => {}});+ // A flare overhangs the neighbouring tab by 9px, so the backing above may only+ // cover the arc and the canvas fill: left over the notch it prints a square of+ // strip colour on top of whatever the neighbour draws there, which is how the+ // hover pill lost its corner to a dark bite (MUL-6160). The notch is therefore+ // masked out of the flare entirely, and the mask has to close before the arc's+ // anti-aliasing starts (r - 1.2) or the arc loses the backing it needs.+ it("punches the notch out rather than filling it with strip colour", () => {+ const { getByLabelText } = render(<TabBar />);+ const flares = getByLabelText("Issues")+ .closest("[data-tab-frame]")+ ?.querySelectorAll<HTMLElement>('[style*="radial-gradient"]');++ expect(flares).toHaveLength(2);+ for (const flare of flares ?? []) {+ const corner = /circle at top (left|right), transparent 8\.8px/.exec(+ flare.style.backgroundImage,+ )?.[1];+ const mask = flare.style.maskImage;++ expect(corner).toBeDefined();+ expect(mask).toContain(`radial-gradient(circle at top ${corner}, transparent 8.4px`);+ expect(mask).toMatch(/ 8\.8px\)$/);+ expect(flare.style.getPropertyValue("-webkit-mask-image")).toBe(mask);+ }+ });+it("draws the merged cap only on the active tab", () => {const { getByLabelText } = render(<TabBar />);expect(diff --git a/apps/desktop/src/renderer/src/components/tab-bar.tsx b/apps/desktop/src/renderer/src/components/tab-bar.tsxindex 46db305842..e366fc231a 100644--- a/apps/desktop/src/renderer/src/components/tab-bar.tsx+++ b/apps/desktop/src/renderer/src/components/tab-bar.tsx@@ -50,10 +50,10 @@ 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 (transparent, so the-// flare's own background-color shows through and the notch reads as the strip),-// 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 colour. The 0.4px spread on-// either side of the --surface-border pair anti-aliases that arc.+// strip behind the flare shows through), 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 colour. The 0.4px spread on either side of the --surface-border+// pair anti-aliases that arc.//// That background-color is load-bearing, not decoration: the flare's bottom row// overlaps the content card's top ring, and in dark mode --surface-border is@@ -63,11 +63,38 @@ const TAB_ENTRY_EASE = [0.22, 1, 0.36, 1] as const;// the curve. It therefore has to be the strip's real backdrop — the sidebar// wrapper's fill, which is conditional and not this file's to re-derive.// SIDEBAR_WRAPPER_FILL_CLASS reads it off the wrapper itself.+//+// The backing may only reach as far as it is needed, though. A flare hangs 9px+// past the tab's edge, over the neighbouring tab, so an opaque square there+// prints over whatever that neighbour draws: its hover pill lost the whole+// corner it shares with the flare and read as a dark bite (MUL-6160). Masking+// the notch away removes the backing exactly where the gradient is transparent+// anyway, so the notch is a hole rather than a painted-on copy of the strip and+// shows whatever is actually behind it — bare strip usually, the neighbour's+// pill where it reaches in. The mask is opaque again by the radius where the+// arc's anti-aliasing starts, so every pixel the arc and the canvas fill cover+// keeps its backing.const TAB_FLARE_RADIUS = 10;const tabFlareGradient = (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)`;};+const tabFlareNotchMask = (side: "left" | "right") => {+ const r = TAB_FLARE_RADIUS;+ return `radial-gradient(circle at top ${side}, transparent ${r - 1.6}px, black ${r - 1.2}px)`;+};+// The flares are mirror images: the offset overlaps the tab edge by 1px so arc+// and side border meet, and gradient and mask share the corner the offset picks.+const tabFlareStyle = (side: "left" | "right"): React.CSSProperties => {+ const overhang = -TAB_FLARE_RADIUS + 1;+ const mask = tabFlareNotchMask(side);+ return {+ ...(side === "left" ? { left: overhang } : { right: overhang }),+ backgroundImage: tabFlareGradient(side),+ maskImage: mask,+ WebkitMaskImage: mask,+ };+};type TabSnapshot = {workspaceSlug: string | null;@@ -355,11 +382,11 @@ function SortableTabItem({<span className="absolute inset-x-0 bottom-0 h-2.5 bg-page-canvas" /><spanclassName={cn("absolute bottom-0 size-2.5", SIDEBAR_WRAPPER_FILL_CLASS)}- style={{ left: -TAB_FLARE_RADIUS + 1, backgroundImage: tabFlareGradient("left") }}+ style={tabFlareStyle("left")}/><spanclassName={cn("absolute bottom-0 size-2.5", SIDEBAR_WRAPPER_FILL_CLASS)}- style={{ right: -TAB_FLARE_RADIUS + 1, backgroundImage: tabFlareGradient("right") }}+ style={tabFlareStyle("right")}/></span>) : (