0.6.0: a spinner widget - #88
Merged
Merged
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ui.spinner({ label, text }): a spinning glyph, a label, and an optional right-hand readout on one row.RenderArgs.elapsed; while active, the container callsctx.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: falsesettles it on a done mark (✓, or*without Unicode) with no layout change, so "loading" and "loaded" share a line.dots(default),arc,line,ascii, or your own array;intervalin ms;color,labelColor,background,align.spinnerFrame()is exported so a status line elsewhere can show the same glyph.asciiautomatically.First consumer:
gh-pulse showin 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
bun run typecheckandbun run buildclean.🤖 Generated with Claude Code
https://claude.ai/code/session_011gfb1vcQH5rf82HfbJvf1Z