Skip to content

Commit 22b4352

Browse files
authored
fix(sql): polish results grid styling (UX-1330) (#2530)
Address visual issues in the SQL Studio results grid: - Render boolean cells in the default foreground color instead of green/orange (text-success/text-warning). - Render JSON/composite cell triggers in the default foreground color, keeping the dotted underline as the expand affordance (drop text-info). - Keep the frozen row-number gutter opaque. rdg's row-hover tint (--color-accent-subtle) is semi-transparent, so first-column text scrolled under the frozen column was bleeding through the hovered row's gutter and overlapping the row number. - Add thin, transparent-track scrollbars to the grid so native Linux scrollbars no longer render as opaque black.
1 parent 81b6c53 commit 22b4352

2 files changed

Lines changed: 41 additions & 3 deletions

File tree

frontend/src/components/pages/sql/sql-results.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,41 @@
2424
.sql-results-grid .sql-results-row-alt {
2525
--rdg-background-color: var(--color-background-subtle);
2626
}
27+
28+
/* Frozen row-number gutter must stay opaque. rdg's row-hover tint
29+
(--color-accent-subtle) is semi-transparent, so without this the first data
30+
column's text — scrolled horizontally underneath the frozen column — bleeds
31+
through the hovered row's gutter and overlaps the row number. Paint the
32+
gutter with the row's opaque base (card, or zebra-subtle on alt rows). */
33+
.sql-results-grid .sql-results-rownum {
34+
background-color: var(--rdg-background-color);
35+
}
36+
37+
/* Cross-platform scrollbars. Native Linux scrollbars render opaque/black
38+
over the grid; make them thin with a transparent track and a subtle thumb
39+
so they blend in instead. rdg scrolls on its own root element. */
40+
.rdg.sql-results-grid {
41+
scrollbar-width: thin;
42+
scrollbar-color: var(--color-border) transparent;
43+
}
44+
45+
.rdg.sql-results-grid::-webkit-scrollbar {
46+
width: 10px;
47+
height: 10px;
48+
}
49+
50+
.rdg.sql-results-grid::-webkit-scrollbar-track,
51+
.rdg.sql-results-grid::-webkit-scrollbar-corner {
52+
background: transparent;
53+
}
54+
55+
.rdg.sql-results-grid::-webkit-scrollbar-thumb {
56+
background-color: var(--color-border);
57+
background-clip: content-box;
58+
border: 2px solid transparent;
59+
border-radius: 8px;
60+
}
61+
62+
.rdg.sql-results-grid::-webkit-scrollbar-thumb:hover {
63+
background-color: var(--color-muted-foreground);
64+
}

frontend/src/components/pages/sql/sql-results.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function JsonCellPopover({ value, name, typeLabel }: { value: string; name: stri
148148
<PopoverTrigger asChild>
149149
<button
150150
className={cn(
151-
'block cursor-pointer truncate text-left font-mono text-info underline decoration-dotted underline-offset-2',
151+
'block cursor-pointer truncate text-left font-mono underline decoration-dotted underline-offset-2',
152152
CELL_MAX_W
153153
)}
154154
title="Show JSON"
@@ -201,7 +201,7 @@ function CellContent({
201201
}) {
202202
const container = useContext(CellPopoverContainerContext);
203203
if (kind === 'bool' && typeof v === 'boolean') {
204-
return <span className={cn('font-semibold', v ? 'text-success' : 'text-warning')}>{String(v)}</span>;
204+
return <span className="font-semibold">{String(v)}</span>;
205205
}
206206
if (v === null || v === undefined) {
207207
return <span className="text-disabled italic">NULL</span>;
@@ -289,7 +289,7 @@ function buildColumns(cols: ColumnDef[]): Column<ResultRow>[] {
289289
width: 'max-content',
290290
renderHeaderCell: () => <span className="font-mono text-disabled text-xs">#</span>,
291291
renderCell: ({ rowIdx }) => rowIdx + 1,
292-
cellClass: 'text-right font-mono text-disabled text-xs [user-select:none]',
292+
cellClass: 'sql-results-rownum text-right font-mono text-disabled text-xs [user-select:none]',
293293
};
294294
const dataCols = cols.map((c): Column<ResultRow> => {
295295
const alignRight = c.kind === 'num';

0 commit comments

Comments
 (0)