Skip to content

UI/UX: /update command lacks visual feedback during long-running operationsΒ #401

@larock22

Description

@larock22

Problem

Users report that running /update appears to "never update" - the UI shows a static message with no visual feedback during operations that can take 5-120 seconds. The update does eventually complete, but the lack of progress indication makes users think the process is frozen.

Root Cause Analysis

The /update command has two long-running operations with minimal visual feedback:

Operation Duration Current Feedback Issue
PyPI Check 0-10 seconds Static text "Checking for updates..." Appears frozen
Package Installation 5-120 seconds Static text "Installing with {manager}..." Appears frozen

Key Gaps

  1. No LoadingIndicator: The app HAS a LoadingIndicator widget (app.py:161) used by agent requests, but it's NOT activated during update operations
  2. No viewport state: The #viewport.streaming CSS class (used by agent requests for active state) is not applied
  3. No status bar update: Status bar doesn't show "running: update" during installation
  4. Hidden subprocess output: subprocess.run() with capture_output=True hides ALL package manager progress output from users
  5. No cancellation: Once installation starts, there's no way for users to cancel

Comparison with Other Commands

Feature /update Agent Request /compact
LoadingIndicator ❌ No βœ… Yes ❌ No
Viewport outline ❌ No βœ… streaming ❌ No
Status bar "running: X" ❌ No βœ… Yes ❌ No
Resource bar label ❌ No βœ… Tokens βœ… Compacting

Relevant Code Locations

  • src/tunacode/ui/commands/update.py:70-130 - Main update logic
  • src/tunacode/ui/app.py:161 - LoadingIndicator widget
  • src/tunacode/ui/app.py:241-242 - Loading pattern (used by agent requests)
  • src/tunacode/ui/widgets/resource_bar.py:71-75 - Compaction status pattern
  • src/tunacode/configuration/paths.py:123-157 - PyPI version check

Proposed Solutions

Priority 1: Immediate Visual Feedback

  • Activate LoadingIndicator during PyPI check and installation
  • Add viewport streaming state during active operations
  • Update status bar to show "running: update"

Priority 2: Enhanced Progress Indicators

  • Add "Updating..." label to ResourceBar (similar to "Compacting..." pattern)
  • Add intermediate status messages ("Contacting PyPI...", "Downloading packages...")

Priority 3: Advanced Progress

  • Stream subprocess output to chat container for real-time package manager progress
  • Add cancellation support for the update worker

Environment

  • Timeout constants: PyPI check = 10s, Installation = 120s
  • Package managers supported: uv, pipx, pip
  • PyPI endpoint: https://pypi.org/pypi/tunacode-cli/json

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions