Skip to content

feat: Add animated spinners and elapsed time to sequant run phase execution #244

Closed

Description

@admarble

Summary

The sequant run command shows static grayed-out text during phase execution with no visual feedback that work is happening. With phases taking 2-30+ minutes, users need clear indication the tool is working.

Current Behavior

    Running spec to determine workflow...
    ⏳ spec...
    █  ← just a cursor, no animation
  • Static hourglass emoji (⏳) - no animation
  • Text is faded gray - looks inactive/disabled
  • No elapsed time indicator
  • No phase progress (1/3, 2/3, etc.)

Expected Behavior

  Issue #240
    Worktree: /Users/tony/.../240-fix-loop-skill...
    
    ⠋ spec (1/3)... 2m 15s     ← animated spinner + elapsed time
    
    ✓ spec completed (5m 30s)
    ⠋ exec (2/3)... 0:45
  • Animated ora spinner (⠋ ⠙ ⠹ ⠸ cycling)
  • Elapsed time updates every few seconds
  • Phase progress indicator (1/3, 2/3, 3/3)
  • Active text in prominent color, not grayed out
  • Clear completion states with duration

Acceptance Criteria

Core Functionality

  • Phase execution shows animated ora spinner while running
  • Spinner text includes elapsed time, updating every 5-10 seconds
  • Active phase text is prominent (cyan/white), not grayed out
  • Phase progress shown (e.g., "spec (1/3)")
  • Completion shows checkmark with total duration

Compatibility

  • Graceful fallback to static text in CI/non-TTY environments
  • Verbose mode uses text-only output (no spinner animation)

Plan Gap AC (Technical Edge Cases)

  • Verbose mode pauses/hides spinner during SDK streaming output (line 1022-1024 conflict)
  • Parallel mode uses sequential spinners (one at a time) - multiple ora spinners corrupt terminal
  • Elapsed time interval cleaned up in all exit paths (success, fail, timeout, interrupt)
  • Spinner registered with ShutdownManager for graceful Ctrl+C cleanup
  • Auto-detect flow handles nested spinner contexts (spec first, then remaining phases)
  • Quality loop iterations show clear spinner transitions between retries
  • Unit tests mock ora spinner to verify start/succeed/fail calls

Technical Notes

  • src/lib/cli-ui.ts already has ui.spinner() using ora library
  • Changes needed in src/commands/run.ts:
    • executePhase() function (~line 892) - spinner lifecycle
    • runIssueWithLogging() function (~line 2104) - spinner per phase
    • Replace chalk.gray("⏳ ${phase}...") with ui.spinner()
    • Add elapsed time tracking with setInterval()
    • Integrate with ShutdownManager for cleanup

Key Code Locations

Line Current Code Issue
1022-1024 process.stdout.write(chalk.gray(textContent)) Verbose streaming corrupts spinners
2175 chalk.gray("\⏳ spec...") Static emoji for auto-detect spec
2343 chalk.gray("\⏳ ${phase}...") Static emoji for phase loop

Related Issues

Priority

High - This is the primary user-facing command and current UX feels broken/unresponsive during long operations.

Activity

  1. added
    enhancement
    cli
    ui
    on Feb 2, 2026
  2. admarble commented on Feb 2, 2026

    @admarble
    ContributorAuthor

    📋 Plan: Animated Spinners for Phase Execution

    Acceptance Criteria

    AC Description Verification
    AC-1 Phase execution shows animated ora spinner while running Integration + Manual
    AC-2 Spinner text includes elapsed time, updating every 5-10 seconds Unit Test
    AC-3 Active phase text is prominent (cyan/white), not grayed out Manual
    AC-4 Phase progress shown (e.g., "spec (1/3)") Unit Test
    AC-5 Completion shows checkmark with total duration Unit Test
    AC-6 Graceful fallback to static text in CI/non-TTY Unit Test
    AC-7 Verbose mode uses text-only output Unit Test
    AC-8 Verbose mode pauses spinner during SDK streaming Integration
    AC-9 Parallel mode uses sequential spinners Unit Test
    AC-10 Elapsed time interval cleaned up in all exit paths Unit Test
    AC-11 Spinner registered with ShutdownManager Unit Test
    AC-12 Auto-detect flow handles nested spinner contexts Integration
    AC-13 Quality loop iterations show clear transitions Integration
    AC-14 Unit tests mock ora to verify calls Unit Test

    Implementation Plan

    Phase 1: Create PhaseSpinner Utility

    • New src/lib/phase-spinner.ts wrapping ui.spinner()
    • Elapsed time tracking with setInterval (5s updates)
    • Format: {phase} ({index}/{total})... {elapsed}

    Phase 2: Integrate in run.ts

    • Replace lines 2175, 2343 (static ⏳ emoji)
    • Pause/resume during verbose streaming (lines 1022-1024)
    • Pass phase count for progress indicator

    Phase 3: ShutdownManager Integration

    • Register/unregister cleanup for graceful Ctrl+C
    • Ensure interval cleanup on all exit paths

    Phase 4: Quality Loop Transitions

    • Clean spinner transitions between retry iterations

    Phase 5: Unit Tests

    • New src/lib/phase-spinner.test.ts
    • Mock ora, verify start/succeed/fail calls
    • Test all fallback conditions

    Key Files

    • src/lib/phase-spinner.ts (new)
    • src/commands/run.ts (modify)
    • src/lib/phase-spinner.test.ts (new)

    Assumptions

    • Elapsed time updates every 5 seconds (balances responsiveness with overhead)
    • Only one spinner active at a time (prevents terminal corruption)

    Generated by /spec - Phase 1 Planning

  3. added
    planned
    on Feb 2, 2026
  4. added 2 commits that reference this issue on Feb 2, 2026
  5. added a commit that references this issue on May 10, 2026
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

    clienhancementplannedui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions