From 606eb7bf1f02addb02c911bc3317ab4472d6c458 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Fri, 22 May 2026 20:57:53 +0700 Subject: [PATCH] style(frontend): trim JSDoc fluff on DataTable empty-state additions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JSDoc blocks added in afb9b63 mostly paraphrased the 12 lines of code below them. Reviewing line-by-line: - "two axes" / "filter active vs no filter" / per-state copy — code reads identically and is right next to the comment. - "kept inline because tightly coupled to effectiveQuery" — every helper in this file is inline, that's the existing convention. - "colSpan={columns.length} parent" — the one call site is 10 lines below in the same file. - "for callers that have not migrated yet" — `empty?:` being optional already says this. - "so existing tests stay green" — the test itself documents the contract; deleting the fallback fails it loudly. Kept the one piece TypeScript can't express: a single-line hint that `entityName` wants the plural lowercase form so the generated copy reads naturally mid-sentence. That shows up in IDE autocomplete and saves a "Flows" → "No Flows match" first-try mistake. No behaviour change. 28/28 DataTable tests pass, 0 ESLint errors. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/src/components/ui/data-table.tsx | 25 +---------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/frontend/src/components/ui/data-table.tsx b/frontend/src/components/ui/data-table.tsx index 0f2957a5..0e83a5b2 100644 --- a/frontend/src/components/ui/data-table.tsx +++ b/frontend/src/components/ui/data-table.tsx @@ -74,18 +74,7 @@ interface DataTableProps { columns: ColumnDef[]; columnVisibility?: VisibilityState; data: TData[]; - /** - * Empty-state copy. When provided, the bare "No results." cell is replaced - * with a shadcn `` block whose title and description adapt to whether - * a filter is currently active: - * - filter empty + filter active → "No matches" + `No match "". Try a different query.` - * - filter empty + no filter → `No yet.` - * - * Pass the plural lowercase form (`"flows"`, `"knowledge documents"`, - * `"API tokens"`) so the generated copy reads naturally. Omitting the prop - * preserves the legacy `"No results."` fallback for callers that have not - * migrated yet. - */ + /** Plural lowercase, e.g. `"flows"`, `"knowledge documents"`, `"API tokens"`. */ empty?: { entityName?: string }; /** * Search target(s) for the filter input. Three modes: @@ -175,18 +164,6 @@ interface DataTableFilterProps { query: string; } -/** - * Renders the body-row "no data" cell content. Two axes: - * - `filterValue` empty/non-empty: distinguishes a truly empty dataset from a - * filter that excluded every row. - * - `entityName` provided/omitted: callers that pass `empty.entityName` get the - * shadcn `` block with a filter-aware copy; callers that don't keep - * the legacy bare `"No results."` label so existing tests stay green. - * - * Kept inline (rather than exported) because the props are tightly coupled to - * `DataTable`'s internal `effectiveQuery` and the layout assumes it lives - * inside a `` with `colSpan={columns.length}`. - */ function DataTableEmptyState({ entityName, filterValue }: DataTableEmptyStateProps) { if (!entityName) { return <>No results.;