Skip to content

Animate the Todo task in progress with a spinner #222

Closed

Description

@a1exk-dev

Parent

Spec: ctui 0.5.0, sections "Spinner" (Implementation Decisions) and stories 21–22. Decided in the Todo spinner spike on 2026-10-09: prototype/todo-spinner (commit 6fa9e40).

What to build

In the Todo section, the task in progress shows an animated spinner in place of the fixed ◐, and waiting tasks show ⠶ in place of ○.

  • In progress: frames ⠴ ⠦ ⠖ ⠲, one every 100 ms, in warning; the text stays the activeForm in main.
  • Waiting: ⠶ in faint, text in muted. Done rows are unchanged (✓, muted).
  • A new surface module ctui/plugins/todo/spinner.tsx (props { frames, ms, color }, frame index as local state, one surface.every started while state is undefined) animates on the surface's own frame clock, so the Sidebar doesn't redraw. The Todo view draws it as a Client with module="./spinner.tsx" (a literal) and key spinner-<item.id ?? index>, in a 1-cell Box, followed by a Text with a space and the task text, inside one row Box.
  • Widen the Sidebar plugin's ui type in ctui/plugins/plugin.ts to the Sidebar's terminal/desktop table so the view gets Client without a cast.
  • The spinner isn't pressable, so it stays a Client while the Pane is focused. The folded summary stays text.

The spike's spinner.tsx is the starting point; its sample lists, the 40-row cap and the PROTOTYPE comments in todo/index.tsx don't ship.

Branch: bugfix/todo-spinner from release/0.5.0, with its pull request into release/0.5.0 once the release pull request into main is open (AGENTS.md, Branches).

Acceptance criteria

  • todo-sidebar.test.tsx: the task in progress draws through the spinner.tsx Client, first frame ⠴ in warning, with its activeForm in main; waiting tasks draw ⠶ in faint; done rows unchanged. tests/clients.tsx gains a spinner.tsx stub.
  • A unit test for spinner.tsx: each every tick steps to the next frame and wraps after ⠲.
  • No PROTOTYPE comments or sample lists remain; Todo's cap is 8.
  • MEMORY.md, "The todo Sidebar plugin turns the task tools on by default": Guidance names the rows (✓ muted, the ⠴⠦⠖⠲ spinner at 100 ms in warning drawn by the spinner.tsx Client on its own frame clock, ⠶ faint for waiting); Reason gains the spinner spike.
  • docs/design/sidebar.html draws the in-progress row as ⠴ and waiting rows as ⠶; the PNGs are re-exported.
  • docs/testing/live-checks.md: the Todo row's glyphs read ⠶ in subtle and a spinner turning through ⠴ ⠦ ⠖ ⠲ in warning; a new row: with the Pane focused (ctrl+x tab) the spinner keeps turning, and a /theme switch recolors it within 0.5 s. Both run and passed on 2.1.292; the PR says so.
  • node scripts/check.ts exits 0.

Blocked by

  • None (can start once the release/0.5.0 pull request is open)

Activity

  1. a1exk-dev commented on Oct 9, 2026

    @a1exk-dev
    OwnerAuthor

    Fixed by #224 (#224), merged into release/0.5.0; it ships with ctui 0.5.0 (#223).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions