Skip to content

polish(resources): stop the tables empty-state grid reappearing past its fade - #6853

Merged
waleedlatif1 merged 1 commit into
stagingfrom
resources-empty-states-polish
Aug 19, 2026
Merged

polish(resources): stop the tables empty-state grid reappearing past its fade#6853
waleedlatif1 merged 1 commit into
stagingfrom
resources-empty-states-polish

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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-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 the point where the fade had finished dissolving.

The frame now clips, and every fade in the set pins no-repeat through a shared MASK_NO_REPEAT rather 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.tsx was already using the canonical token two lines above the new code.
  • createIsoLineProps returns SVGAttributes<SVGElement>. It never returns a ref, and ref was the only member forcing an element type — which had pushed the knowledge mark into 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, before the table's own data.
  • 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.

Test

Adds the predicate's unit test. isResourceListEmpty is 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.

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.
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 19, 2026 7:00pm

Request Review

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only empty-state masking, design tokens, and import/API refactors with new unit tests; no auth, data, or security paths touched.

Overview
Fixes a tables empty-state rendering bug where oversized grid art faded correctly then reappeared past the fade: mask gradients default to repeating, so overflow drew into the next tile at the opaque head. The tables graphic now uses overflow-hidden, and all four resource empty-state fades share MASK_NO_REPEAT so no-repeat is explicit.

Token and API cleanups: resource empty-state hairlines and borders move from --border-1 to --border; createIsoLineProps is reordered (stroke, optional strokeWidth, optional className) and returns SVGAttributes<SVGElement> so paths and circles share one spread; landing iso marks and the knowledge mark update their call sites.

Resource list wiring: isResourceListEmpty is exported from the workspace components barrel (files, knowledge, logs, tables import it there); Resource.Table props put columns/rows before emptyState; TSDoc on the empty slot and folder graphic matches actual layout behavior.

Adds isResourceListEmpty unit tests (loading, placeholder data, search/filter/folder guards, whitespace-only search).

Reviewed by Cursor Bugbot for commit 9420a65. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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/5

The 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.

Important Files Changed

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

@waleedlatif1
waleedlatif1 merged commit fc2087b into staging Aug 19, 2026
24 checks passed
@waleedlatif1
waleedlatif1 deleted the resources-empty-states-polish branch August 19, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant