refactor(web): extract EmptyState — one shared empty-state line for all routes and sections #279
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#279
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of umbrella #276 (frontend component reuse, follow-up to #275).
The hand-rolled empty-state pattern
<p class="empty">…</p>appears at ~16 production call sites across the web frontend: the list routes (Tokens, Credentials, History, Repos, RepoIssues, RepoCRs), RunChat (four distinct messages), NewRun, and the repo-/user-settings sections (Imports, Secrets, Schedules, Notifications). A visual or spacing fix to the pattern currently means touching every one of them.Extract one shared component and migrate all call sites, preserving the current look. The agent brief follows in a comment.
Agent Brief
Category: enhancement
Summary: Extract a shared
EmptyStatecomponent and migrate every hand-rolled<p class="empty">call site to it.Current behavior:
Routes and settings sections render their "nothing here yet" line by hand as
<p class="empty">some text</p>. The pattern appears at roughly 16 production call sites: the list routes (Tokens, Credentials, History, Repos, RepoIssues, RepoCRs), RunChat (which has four distinct messages for ready / waiting for transcript / transcript gone / no messages), NewRun, and the repo- and user-settings sections (Imports, Secrets, Schedules, Notifications). Some messages are static strings; some are computed (History's per-outcome-filter message, RepoCRs'emptyText()).Desired behavior:
One shared component (suggested name
EmptyState) owns the empty-state markup and itsemptyclass; every production call site renders through it. Its content slot is JSX so both static and computed messages work unchanged. No visual change — same element, same class, same text as today.Key interfaces:
EmptyStatecomponent in the shared components directory, shaped and tested likeSectionCard(small props surface, plain markup out, a colocated test file in the same style)emptyCSS class stays the single styling hook and, after migration, is applied only by the component in production codeAcceptance criteria:
EmptyStateexists with a colocated test following theSectionCardtest style<p class="empty">is migrated (test fixtures may keep raw markup)class="empty"markup in production frontend code finds only the componentOut of scope: