Skip to content

Commit 7f1e4ab

Browse files
andresdjassoclaude
authored andcommitted
improvement(tables): strip the empty-state graphic to ruled lines and a corner fade
Minimal pass. The card is gone — no border, no fill, no header shading, no type squares. What is left is the grid itself: hairline rules in `--border-1`, ink bars at two strengths, and the one cell held in an edit ring. With no card fill the grid sits directly on the page, so it can dissolve into the background instead of ending at a border. The fade is the landing page's own idiom — two gradients intersected (`mask-composite: intersect`), crisp at the top-left and gone through the bottom-right, the same construction `workflow-graph-preview` uses. Two placement notes: - The grid is offset right of frame centre. A diagonal dissolve puts the visual mass toward its opaque corner, so centring the geometry would leave the graphic reading left of the copy beneath it. - The selected cell sits in the quadrant the fade leaves fully opaque. A selection ring dissolving mid-stroke reads as a rendering fault, not a detail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 4e0f3de commit 7f1e4ab

1 file changed

Lines changed: 39 additions & 47 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state

apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/tables-empty-state.tsx

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
1-
import { cn } from '@sim/emcn'
21
import { EmptyState } from '@/components/empty-state/empty-state'
32

43
/**
5-
* Neutral ink at graded strengths.
4+
* Neutral ink at two strengths.
65
*
7-
* `--surface-4`/`--surface-5` are near-white in light mode (`#f5f5f5`/`#f3f3f3`),
8-
* so skeleton geometry built on them dissolves on a white card. Mixing
9-
* `--text-secondary` into transparent instead gives a real mid-grey that inverts
10-
* with the theme — the same idiom the workflow editor's empty state uses for the
11-
* one bar it needs you to actually see.
6+
* `--surface-4`/`--surface-5` are near-white in light mode (#f5f5f5/#f3f3f3), so
7+
* skeleton geometry built on them dissolves against the page. Mixing
8+
* `--text-secondary` into transparent gives a real mid-grey that inverts with the
9+
* theme — the idiom the workflow editor's vignette uses for the one bar it needs
10+
* you to actually see.
1211
*/
1312
const INK = {
14-
header: 'color-mix(in srgb, var(--text-secondary) 32%, transparent)',
15-
headerType: 'color-mix(in srgb, var(--text-secondary) 26%, transparent)',
16-
cell: 'color-mix(in srgb, var(--text-secondary) 17%, transparent)',
17-
selection: 'color-mix(in srgb, var(--text-secondary) 30%, transparent)',
13+
header: 'color-mix(in srgb, var(--text-secondary) 30%, transparent)',
14+
cell: 'color-mix(in srgb, var(--text-secondary) 15%, transparent)',
15+
selection: 'color-mix(in srgb, var(--text-secondary) 32%, transparent)',
1816
} as const
1917

20-
const COLUMN_TEMPLATE = '84px 66px 66px 66px'
18+
/**
19+
* Crisp at the top-left, dissolving through the bottom-right — the same
20+
* two-gradient intersect the landing page's workflow vignette uses, so the grid
21+
* blends into the page rather than sitting on it as a card.
22+
*/
23+
const CORNER_FADE =
24+
'[-webkit-mask-image:linear-gradient(to_right,#000_62%,transparent_100%),linear-gradient(to_bottom,#000_56%,transparent_100%)] [mask-image:linear-gradient(to_right,#000_62%,transparent_100%),linear-gradient(to_bottom,#000_56%,transparent_100%)] [-webkit-mask-composite:source-in] [mask-composite:intersect]'
2125

22-
/** Header label widths, then per-row cell widths — varied so the grid reads as data. */
23-
const HEADER_WIDTHS = [34, 26, 24, 26] as const
26+
const COLUMN_TEMPLATE = '88px 72px 72px 72px'
27+
28+
const HEADER_WIDTHS = [36, 28, 26, 28] as const
2429

2530
const CELL_WIDTHS = [
26-
[52, 34, 26, 38],
27-
[44, 30, 32, 30],
28-
[58, 38, 22, 40],
29-
[38, 26, 30, 32],
31+
[54, 34, 26, 38],
32+
[44, 30, 34, 30],
33+
[60, 38, 22, 40],
34+
[40, 26, 30, 34],
35+
[50, 32, 28, 36],
3036
] as const
3137

3238
/**
33-
* A crisp table card whose columns run past its right edge.
34-
*
35-
* The workflow editor's vignette keeps its block fully opaque and fades only the
36-
* connector strokes leaving the frame; masking the whole composition is what
37-
* makes a miniature look washed rather than deliberate. So the card here stays
38-
* sharp and the continuation is drawn the way a real table draws it — an
39-
* overflow fade at the edge the columns run off.
39+
* The one cell held in an edit ring, placed in the top-left quadrant the corner
40+
* fade leaves fully opaque — a selection dissolving mid-stroke would read as a
41+
* rendering fault rather than a detail.
4042
*/
43+
const SELECTED_CELL = { row: 1, column: 0 } as const
44+
45+
/** Nothing but ruled lines and the ink sitting in them, running off two edges. */
4146
function TablesGraphic() {
4247
return (
43-
<div aria-hidden='true' className='relative h-[148px] w-[320px]'>
44-
<div className='absolute top-[16px] left-[34px] h-[116px] w-[252px] overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-2)]'>
45-
<div
46-
className='grid border-[var(--border-1)] border-b bg-[var(--surface-3)]'
47-
style={{ gridTemplateColumns: COLUMN_TEMPLATE }}
48-
>
48+
<div aria-hidden='true' className={`relative h-[148px] w-[320px] ${CORNER_FADE}`}>
49+
<div className='absolute top-[14px] left-[54px] border-[var(--border-1)] border-t border-l'>
50+
<div className='grid' style={{ gridTemplateColumns: COLUMN_TEMPLATE }}>
4951
{HEADER_WIDTHS.map((width, column) => (
5052
<div
5153
key={`header-${column}`}
52-
className='flex h-[28px] items-center gap-[6px] border-[var(--border-1)] border-r px-2.5'
54+
className='flex h-[26px] items-center border-[var(--border-1)] border-r border-b px-3'
5355
>
5456
<span
55-
className='size-[7px] shrink-0 rounded-[2px]'
56-
style={{ background: INK.headerType }}
57-
/>
58-
<span
59-
className='block h-[6px] rounded-full'
57+
className='block h-[5px] rounded-full'
6058
style={{ width, background: INK.header }}
6159
/>
6260
</div>
@@ -66,22 +64,19 @@ function TablesGraphic() {
6664
{CELL_WIDTHS.map((row, rowIndex) => (
6765
<div
6866
key={`row-${rowIndex}`}
69-
className={cn(
70-
'grid',
71-
rowIndex < CELL_WIDTHS.length - 1 && 'border-[var(--border-1)] border-b'
72-
)}
67+
className='grid'
7368
style={{ gridTemplateColumns: COLUMN_TEMPLATE }}
7469
>
7570
{row.map((width, column) => (
7671
<div
7772
key={`cell-${rowIndex}-${column}`}
78-
className='relative flex h-[22px] items-center border-[var(--border-1)] border-r px-2.5'
73+
className='relative flex h-[24px] items-center border-[var(--border-1)] border-r border-b px-3'
7974
>
8075
<span
81-
className='block h-[6px] rounded-full'
76+
className='block h-[5px] rounded-full'
8277
style={{ width, background: INK.cell }}
8378
/>
84-
{rowIndex === 1 && column === 1 ? (
79+
{rowIndex === SELECTED_CELL.row && column === SELECTED_CELL.column ? (
8580
<span
8681
className='absolute inset-[-1px] rounded-[3px] border-[1.5px]'
8782
style={{ borderColor: INK.selection }}
@@ -91,9 +86,6 @@ function TablesGraphic() {
9186
))}
9287
</div>
9388
))}
94-
95-
<span className='absolute top-0 right-0 h-[28px] w-[30px] bg-gradient-to-l from-[var(--surface-3)] to-transparent' />
96-
<span className='absolute top-[28px] right-0 bottom-0 w-[30px] bg-gradient-to-l from-[var(--surface-2)] to-transparent' />
9789
</div>
9890
</div>
9991
)

0 commit comments

Comments
 (0)