Skip to content

0.6.0: a spinner widget - #88

Merged
ralyodio merged 1 commit into
mainfrom
worktree-spinner
Sep 13, 2026
Merged

0.6.0: a spinner widget#88
ralyodio merged 1 commit into
mainfrom
worktree-spinner

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

ui.spinner({ label, text }): a spinning glyph, a label, and an optional right-hand readout on one row.

  • No timer in the caller. The frame comes from RenderArgs.elapsed; while active, the container calls ctx.invalidate() so the app draws another frame after this one. The animation costs one frame per tick only while a spinner is on screen and active.
  • active: false settles it on a done mark (, or * without Unicode) with no layout change, so "loading" and "loaded" share a line.
  • Frame sets dots (default), arc, line, ascii, or your own array; interval in ms; color, labelColor, background, align. spinnerFrame() is exported so a status line elsewhere can show the same glyph.
  • Terminals without Unicode get ascii automatically.

First consumer: gh-pulse show in cli-tools, which fetches a range from GitHub in the background and needed a busy line.

Version

0.5.1 → 0.6.0 in every hand-written place the version test ties together (library, CLI constant, demo, site badge, cobol adapter, workspace specifiers) and bun.lock.

Tested

  • 4 new tests (frame arithmetic, glyph/label/readout layout, done mark and no re-render request when inactive, named and custom frames, truncation). Suite: 311 pass.
  • bun run typecheck and bun run build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_011gfb1vcQH5rf82HfbJvf1Z

`ui.spinner({ label, text })` draws a spinning glyph, a label and a
right-hand readout on one row. It keeps no timer of its own: the frame comes
from the app clock (RenderArgs.elapsed) and, while the spinner is active, the
container asks the app for another frame after this one, so a caller shows a
busy line with no interval to manage. `active: false` settles it on a done
mark without a layout change. Named frame sets (dots, arc, line, ascii) or
your own; terminals without Unicode get ascii and a plain done mark.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011gfb1vcQH5rf82HfbJvf1Z
@ralyodio
ralyodio merged commit c78de7c into main Sep 13, 2026
14 checks passed
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