refactor(web): extract EmptyState — one shared empty-state line for all routes and sections #284
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/279"
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), following the
SectionCardextraction in #275.What
EmptyState(web/src/components/EmptyState.tsx) now owns the empty-state markup, and all 16 production<p class="empty">…</p>call sites render through it:The content stays a JSX slot rather than a
text: stringprop, because the call sites are not all static strings: History interpolates its outcome filter, RepoCRs passes a computedemptyText(), and Repos/RepoIssues/NewRun embed an<A>link mid-sentence. Children pass through untouched, so computed and reactive messages keep working exactly as they did inline — the colocated test pins both the JSX-element case and the signal-tracking case for that reason.Props surface is deliberately just
children— noclass, no icon slot, no conditionals — matching the "small props surface, plain markup out" shape ofSectionCard.No visual change
Same element, same
emptyclass, same text, character for character.web/src/styles/banners.cssis untouched. Prettier re-wrapped two of the messages across lines (Credentials, Secrets); JSX collapses that to the same rendered string.After the migration,
grep -rn 'class=\"empty\"' web/srcfinds onlyEmptyState.tsxitself plus one fixture inSectionCard.test.tsx— test fixtures may keep raw markup per the issue.Verification
Run in
web/, all green:npx vitest run— 70 files / 1002 tests passing, including the 6 newEmptyStatetests. The pre-existing tests that assert on the.emptyselector (RunChat, RepoIssues) and on the empty text (Imports, Schedules, Secrets) pass unchanged, which is the evidence the markup did not move.npx tsc --noEmit,npx eslint .,npx prettier --check .— cleannpm run build— production build succeedsCloses #279
🤖 Generated with Claude Code
[autoland] verdict: pass