Skip to content

feat(tui): animated neural pulse spinner with random verbs#54

Merged
broomva merged 1 commit intomainfrom
feature/tui-animated-spinner
Apr 5, 2026
Merged

feat(tui): animated neural pulse spinner with random verbs#54
broomva merged 1 commit intomainfrom
feature/tui-animated-spinner

Conversation

@broomva
Copy link
Copy Markdown
Owner

@broomva broomva commented Apr 5, 2026

Ports the shell's animated glyph system to the TUI. Shows neural pulse animation (·◦○◎●◉●◎○◦) with a random verb instead of static 'Thinking...' text. New verb picked on each RunStarted. 220 tests passing.

Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The app now displays an animated thinking indicator with a continuously updating spinner while processing tasks, replacing the previous static text. This enhancement provides more engaging visual feedback, making it clearer that the application is actively working on requests and progressing through task execution.

Port the shell's animated glyph system to the TUI. Instead of static
"Thinking..." text, the chat log now shows an animated neural pulse
glyph (·◦○◎●◉●◎○◦) with a random verb (Pondering, Arcaning,
Crystallizing, etc.) that changes on each new run.

- Add SpinnerKind (Neural/Tool) with verb list to TUI spinner widget
- Tick spinner on every TUI event loop tick when busy
- Pick new verb on RunStarted events
- Update e2e and integration tests for new indicator format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces an animated spinner indicator system for the TUI application. It adds the fastrand dependency, creates a SpinnerKind enum supporting Neural and Tool visualization modes, implements randomized verb selection in the Spinner widget, and integrates the animated spinner throughout the app's state management and UI rendering. Test assertions are updated to verify the new Unicode ellipsis character display.

Changes

Cohort / File(s) Summary
Dependency Addition
crates/arcan-tui/Cargo.toml
Added fastrand = "2" dependency under the Platform section to support randomization.
Spinner Widget Enhancement
crates/arcan-tui/src/widgets/spinner.rs
Replaced single fixed frame array with SpinnerKind enum (Neural, Tool) selecting between NEURAL_PULSE and TOOL_FRAMES. Added verb field for dynamic verb text, implemented verb(), new_verb() (randomized via fastrand), set_tool_mode(), and set_neural_mode() APIs. Updated tick() and current() to use frame sets based on active kind.
State Management Integration
crates/arcan-tui/src/models/state.rs
Added public spinner: Spinner field to AppState. Initialized spinner on construction and advanced it via new_verb() during AgentEvent::RunStarted.
UI Display Updates
crates/arcan-tui/src/widgets/chat_log.rs, crates/arcan-tui/src/app.rs
Replaced static "Thinking…" text with animated spinner: chat_log now renders {glyph} {verb}… using state.spinner.current() and state.spinner.verb(). App now calls self.state.spinner.tick() on TuiEvent::Tick when busy.
Test Assertions
crates/arcan-tui/src/e2e_test.rs, crates/arcan-tui/src/integration_test.rs
Updated busy-indicator assertions to expect Unicode ellipsis character (\u{2026}) instead of literal "Thinking" string. Added clarifying comment that animated spinner disappears after RunFinished.

Sequence Diagram

sequenceDiagram
    participant User
    participant App
    participant Spinner
    participant State
    participant ChatLog

    User->>App: Send message to agent
    App->>State: RunStarted event
    State->>Spinner: new_verb() - randomize verb
    State->>State: set is_busy = true

    loop Every Tick Until RunFinished
        App->>Spinner: tick()
        Spinner->>Spinner: advance frame index
        ChatLog->>Spinner: current() - get glyph
        ChatLog->>Spinner: verb() - get verb
        ChatLog->>ChatLog: render {glyph} {verb}…
    end

    User->>App: Agent finishes
    App->>State: RunFinished event
    State->>State: set is_busy = false
    ChatLog->>ChatLog: render without spinner
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Poem

🐰 With spinners twirling, verbs at play,
The UI dances night and day,
Fastrand picks the words with care,
Neural pulses float through air,
Tools and thoughts now spin so fair! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: introducing an animated neural pulse spinner with random verbs in the TUI, replacing static 'Thinking...' text.
Docstring Coverage ✅ Passed Docstring coverage is 95.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tui-animated-spinner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@broomva broomva merged commit 74c3f49 into main Apr 5, 2026
8 of 9 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