polish(resources): stop the tables empty-state grid reappearing past its fade - #6853
Conversation
The grid is authored larger than the box it fades inside — 358x160 drawn into 320x148, deliberately, so it runs off two edges. But a mask tile is sized to the element box and `mask-repeat` starts at `repeat`, so the overflow landed in the *next* tile at the opaque head of the gradient: a solid strip of cells reappeared just past where the fade had finished dissolving. The frame now clips, and every fade in the set pins `no-repeat` rather than relying on its subject happening to fit. Also: - `--border-1` is a legacy alias; the new files use the canonical `--border`, which `resource.tsx` was already using two lines above them. - `createIsoLineProps` returns `SVGAttributes<SVGElement>`. It never returns a `ref`, and `ref` was the only member forcing an element type — which had made the knowledge mark reach for an `SVGPathElement & SVGCircleElement` intersection to spread onto both. `className` moves last so no caller passes `undefined` positionally to skip it. - `isResourceListEmpty` is exported from the components barrel its four callers already import `Resource` from, instead of being reached past it. - `emptyState` sits after `rows` on all four tables; three had it leading. - Two TSDoc blocks claimed things the code stopped doing: the folder graphic does not have three fill tiers, and the empty-state wrapper grows the slot but does not centre it. Adds the predicate's unit test — it is a pure eight-clause function that decides whether a page tells someone they have nothing, and it had none. Verified it fails when the placeholder and folder guards are removed.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Token and API cleanups: resource empty-state hairlines and borders move from Resource list wiring: Adds Reviewed by Cursor Bugbot for commit 9420a65. Configure here. |
Greptile SummaryThe PR fixes repeated mask tiles and clips the deliberately oversized tables empty-state graphic so cells cannot reappear after the fade. It also standardizes border tokens and imports, simplifies shared SVG contour typing, reorders table props, corrects documentation, and adds unit coverage for the resource-list empty-state predicate. Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or build issues identified. The mask utilities are statically discoverable, clipping matches the intended frame geometry, all helper callers use the revised signature, and the new barrel export remains acyclic and compatible with its client consumers.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/mask.ts | Introduces a shared no-repeat mask utility used consistently by all four faded empty-state graphics. |
| apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/tables-empty-state.tsx | Prevents mask tiling and clips only the intentionally oversized portion of the table grid. |
| apps/sim/components/iso/iso-illustration-style.ts | Reorders the contour helper parameters and returns element-neutral SVG attributes without leaving stale callers. |
| apps/sim/app/workspace/[workspaceId]/components/index.ts | Adds the pure empty-list predicate to the established workspace components barrel without creating a dependency cycle. |
| apps/sim/app/workspace/[workspaceId]/components/resource/is-resource-list-empty.test.ts | Covers rows, loading and placeholder states, errors, filters, folders, and whitespace-only searches for the empty-state predicate. |
Reviews (1): Last reviewed commit: "polish(resources): stop the tables grid ..." | Re-trigger Greptile
Follow-up to #6828, which merged while this round was still in review. One rendering bug and the review cleanups that did not make the merge.
The bug
The tables empty-state grid is authored larger than the box it fades inside — 358×160 drawn into 320×148 — deliberately, so it runs off two edges. But a mask tile is sized to the element box and
mask-repeatstarts atrepeat, so the overflow landed in the next tile, at the opaque head of the gradient. A solid strip of cells reappeared just past the point where the fade had finished dissolving.The frame now clips, and every fade in the set pins
no-repeatthrough a sharedMASK_NO_REPEATrather than relying on its subject happening to fit. The other three were only safe by accident — an SVG root clips, and the logs feed is auto-height.Cleanups
--border-1→--border. The former is a legacy alias;resource.tsxwas already using the canonical token two lines above the new code.createIsoLinePropsreturnsSVGAttributes<SVGElement>. It never returns aref, andrefwas the only member forcing an element type — which had pushed the knowledge mark into anSVGPathElement & SVGCircleElementintersection to spread onto both.classNamemoves last so no caller passesundefinedpositionally to skip it.isResourceListEmptyis exported from the components barrel its four callers already importResourcefrom, instead of being reached past it.emptyStatesits afterrowson all four tables; three had it leading, before the table's own data.Test
Adds the predicate's unit test.
isResourceListEmptyis a pure eight-clause function that decides whether a page tells someone they have nothing, and it shipped with none. Verified it goes red when the placeholder and folder guards are removed.Also documents one deliberate behaviour that looks like a bug: a whitespace-only search still shows the graphic, because
.trim()means the rows are not filtered by it either.