Skip to content

Commit 3c7dfb6

Browse files
committed
fix(vortex-web): make stuck treemap header bars opaque
A pinned (stuck) sticky header bar was translucent, so content scrolling underneath bled through it. Draw an opaque surface base beneath the dtype tint once a bar is stuck, so it reads as solid and the children sit cleanly below it. In-band (non-stuck) strips keep their light tint. Signed-off-by: Robert <robert@spiraldb.com>
1 parent c9d00c7 commit 3c7dfb6

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

-4.1 KB
Loading
-4.04 KB
Loading

vortex-web/src/components/explorer/BlockTreemap.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ interface ThemeColors {
9696
dim: string;
9797
border: string;
9898
highlight: string;
99+
/** Opaque page surface — used as the solid base of a stuck header bar. */
100+
surface: string;
99101
}
100102

101103
function resolveThemeColors(choice: 'light' | 'dark' | 'system'): ThemeColors {
@@ -104,8 +106,20 @@ function resolveThemeColors(choice: 'light' | 'dark' | 'system'): ThemeColors {
104106
? window.matchMedia('(prefers-color-scheme: dark)').matches
105107
: choice === 'dark';
106108
return isDark
107-
? { fg: '#e4e4e8', dim: '#71717a', border: 'rgba(255,255,255,0.12)', highlight: '#2CB9D1' }
108-
: { fg: '#18181b', dim: '#71717a', border: 'rgba(0,0,0,0.1)', highlight: '#2CB9D1' };
109+
? {
110+
fg: '#e4e4e8',
111+
dim: '#71717a',
112+
border: 'rgba(255,255,255,0.12)',
113+
highlight: '#2CB9D1',
114+
surface: '#1a1a1e',
115+
}
116+
: {
117+
fg: '#18181b',
118+
dim: '#71717a',
119+
border: 'rgba(0,0,0,0.1)',
120+
highlight: '#2CB9D1',
121+
surface: '#fafafa',
122+
};
109123
}
110124

111125
interface Transform {
@@ -482,6 +496,11 @@ export function BlockTreemap({
482496
const label = maxChars < 2 ? '' : truncate(h.name, maxChars);
483497
return (
484498
<g key={`hdr-${h.id}`} pointerEvents="none">
499+
{/* Opaque base when stuck so children scrolling underneath are
500+
hidden — the bar reads as solid and pushes content below it. */}
501+
{h.stuck && (
502+
<rect x={h.sx} y={h.top} width={h.sw} height={HEADER_H} fill={theme.surface} />
503+
)}
485504
<rect
486505
x={h.sx}
487506
y={h.top}

0 commit comments

Comments
 (0)