feat(knowledge): empty state for a base that holds no documents - #6855
Conversation
#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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
On the knowledge base page, Reviewed by Cursor Bugbot for commit 62c016b. Configure here. |
Greptile SummaryAdds a dedicated zero-document state to knowledge bases while preserving existing loading, error, search, filter, and pagination behavior.
Confidence Score: 5/5The 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.
|
| 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
#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:
HAIRLINEwas byte-identical between the folder and this mark, so it moves to a shared module besidemask.tsrather than being copied a second time.--text-secondary, because--surface-4/--surface-5are 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 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
isResourceListEmptythe 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:pagination.totalrather than the visible rows. This list is paginated server-side, and an empty page 2 is a paging position, not an empty base.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.tsxblanks the rows and strips search/sort/filter without surfacing any error, so a failed load renders as a silent empty table.