Skip to content

feat(knowledge): empty state for a base that holds no documents - #6855

Merged
waleedlatif1 merged 1 commit into
stagingfrom
feat/kb-documents-empty-state
Aug 19, 2026
Merged

feat(knowledge): empty state for a base that holds no documents#6855
waleedlatif1 merged 1 commit into
stagingfrom
feat/kb-documents-empty-state

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

#6828 gave the four workspace resource lists a zero-data graphic. It left the one list a level below them still painting column headers over a blank body — and that is the list every user meets first, because creating a base does not require a file and does not navigate anywhere on success.

The graphic

A stack of sheets, the front one dog-eared and ruled.

The dog-ear is the one signifier the set does not already use. The folder is a container and the knowledge mark is a shelf of volumes; this one has to read as the pages inside one of them rather than as either. Everything else is the recipe the other four settled on:

  • Hairline contours. HAIRLINE was byte-identical between the folder and this mark, so it moves to a shared module beside mask.ts rather than being copied a second time.
  • Depth from the surface ramp, not shadow. Back sheet a tier down, front sheet at the top. Shadows would need separate light and dark recipes; the ramp inverts on its own.
  • Ink mixed off --text-secondary, because --surface-4/--surface-5 are near-white in light mode and ruling built on them dissolves against the page. The heading line takes the stronger mix so the sheet reads as a document rather than as blank ruling.
  • The fade runs the direction the stack recedes — upward, so the sheets behind dissolve while the front one stays crisp where the copy begins.

The frame is derived from the artwork's own bounds rather than a round-numbered viewBox. The sheets step up and to the right, which left the drawn mass far enough off-centre that the mark sat visibly right of the copy beneath it.

Visibility

Goes through the same isResourceListEmpty the four pages use, so the loading, placeholder, error, search and filter gates are the ones already shipped and tested. Two call-site differences, both documented where they are made:

  • It counts the server's pagination.total rather than the visible rows. This list is paginated server-side, and an empty page 2 is a paging position, not an empty base.
  • The folder arguments are omitted — a base's documents are flat.

The empty state's chip runs the same handler as the header's "New documents" action and inherits its disabled state.

Verification

Type-check, biome, 29/29 audits, 2220 tests. The mark was rendered in both themes against a centre guide rather than eyeballed from the geometry — that is what caught the off-centre frame.

Not included

The chunk list inside a document. A completed document essentially always has chunks, and non-completed ones already show a processing-status row.

Worth a separate fix, found while surveying: on a chunk-load error document.tsx blanks the rows and strips search/sort/filter without surfacing any error, so a failed load renders as a silent empty table.

#6828 gave the four workspace resource lists a zero-data graphic and left the
one list a level below them still painting column headers over a blank body —
the list every user meets immediately, because creating a base does not require
a file and does not navigate anywhere on success.

The mark is a stack of sheets with the front one dog-eared and ruled. The
dog-ear is the one signifier the set does not already use: the folder is a
container and the knowledge mark is a shelf of volumes, and this has to read as
the pages inside one of them rather than as either.

It reuses the rest of the recipe — hairline contours, the surface ramp for
depth, ink mixed off `--text-secondary` because the ramp is near-white in light
mode, and a fade running the direction the stack recedes. `HAIRLINE` was
byte-identical between the folder and this mark, so it moves to a shared module
beside `mask.ts`.

Visibility goes through the same `isResourceListEmpty` the four pages use, with
one difference the call site documents: it counts the server's `total` rather
than the visible rows, because this list is paginated and an empty page 2 is a
paging position, not an empty base. The folder arguments are omitted — a base's
documents are flat.

The frame is derived from the artwork's bounds rather than a round-numbered
viewBox. The sheets step up and to the right, which left the drawn mass far
enough off-centre that the mark sat visibly right of the copy beneath it.
@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:30pm

Request Review

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only empty-state and illustration refactor; no API, auth, or data-model changes.

Overview
Adds a documents empty state for knowledge bases with zero documents, replacing a blank table body under column headers. The graphic is a stack of ruled sheets with a dog-eared front page, aligned with the other resource empty-state illustrations (shared hairline strokes, surface-ramp depth, upward fade).

HAIRLINE contour styling moves from files-empty-state into a shared hairline.ts module so folder and documents graphics stay consistent.

On the knowledge base page, DocumentsEmptyState is shown when isResourceListEmpty passes—using server pagination.total (not visible row count) so paginated empty pages don’t show the zero-data UI—and the New documents chip mirrors the header action and edit permissions.

Reviewed by Cursor Bugbot for commit 62c016b. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a dedicated zero-document state to knowledge bases while preserving existing loading, error, search, filter, and pagination behavior.

  • Introduces a document-stack illustration and upload/docs actions.
  • Uses the server pagination total to distinguish an empty base from an empty page.
  • Extracts the shared illustration hairline styling for reuse.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The empty state is limited to genuinely empty, fully resolved document lists, and its upload action preserves the existing handler and authorization behavior.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx Gates and renders the new document empty state using existing resource-list semantics and the same upload action and permission condition as the header.
apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/documents-empty-state.tsx Adds the document-specific empty-state illustration, copy, upload action, and documentation link without introducing a behavioral issue.
apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/hairline.ts Safely extracts unchanged SVG contour styling for reuse by the files and documents illustrations.
apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/files-empty-state.tsx Replaces the local hairline constant with the byte-equivalent shared export.
apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-empty-state/index.ts Exports the new DocumentsEmptyState component through the existing resource empty-state barrel.

Reviews (1): Last reviewed commit: "feat(knowledge): empty state for a base ..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit ede762f into staging Aug 19, 2026
25 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/kb-documents-empty-state branch August 19, 2026 19:34
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