Skip to content

Add Status (idle/busy/done) state machine and Spinner#5

Open
calebpanza wants to merge 1 commit into
mainfrom
cyrus/cui-7-add-status-idlebusydone-spinner
Open

Add Status (idle/busy/done) state machine and Spinner#5
calebpanza wants to merge 1 commit into
mainfrom
cyrus/cui-7-add-status-idlebusydone-spinner

Conversation

@calebpanza

Copy link
Copy Markdown
Contributor

Assignee: @calebpanza (caleb)

Summary

Adds two site-agnostic UI primitives under app/ui, per CUI-7:

  • Spinner (app/ui/spinner.tsx) — a spun central loading icon. Renders lucide's LoaderCircleIcon with size-4 animate-spin, role="status", and aria-label="Loading". Fully className/prop overridable.
  • Status (app/ui/status.tsx) — the action state machine idle → busy → done. Consumers declare slots with <StatusPanel value="..."> and Status cross-fades + zooms the active panel in (and the previous one out), animating the box size to fit so differently-sized states resize smoothly instead of jumping. Honors prefers-reduced-motion (fade only, no scale/size animation). Exports useStatus() for reading the active state inside the subtree. Composes with — but is independent of — Spinner (drop a <Spinner /> inside the busy panel).

This is the action Status, distinct from the Status Indicator dot.

Implementation notes

The reference imported LoadingIcon from ~/icons, which does not exist in this repo. I adapted it to the established app/ui convention of importing lucide icons directly (cf. select.tsx), using LoaderCircleIcon — the canonical spinner glyph.

Testing

  • bun run typecheck — passes
  • bun run lint — passes

Linear

CUI-7 — Add Status (idle/busy/done) + Spinner


Tip: I will respond to comments that @ mention @cyrus-daymoon on this PR. You can also submit a review with all your feedback at once, and I will automatically wake up to address each comment.

Add two site-agnostic UI primitives under app/ui:

- Spinner: a spun loading icon (lucide LoaderCircleIcon), size-4
  animate-spin, role=status / aria-label=Loading.
- Status: an idle -> busy -> done state machine that cross-fades and
  zooms between declarative <StatusPanel> slots, animating the box size
  to fit the active panel. Reduced-motion aware (fade only). Composes
  with Spinner inside the busy panel.

Adapts the reference (which imported LoadingIcon from ~/icons) to this
repo's convention of importing lucide icons directly (cf. select.tsx).

CUI-7
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crescent-ui Ready Ready Preview, Comment Jun 28, 2026 7:31pm

Request Review

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