Skip to content

fix(tui): make PS panel detail updates non-blocking for responsive UI#376

Open
proboscis wants to merge 1 commit intomainfrom
issue/orch-379/run-20260130-123902
Open

fix(tui): make PS panel detail updates non-blocking for responsive UI#376
proboscis wants to merge 1 commit intomainfrom
issue/orch-379/run-20260130-123902

Conversation

@proboscis
Copy link
Owner

Summary

  • Fix PS panel responsiveness by making detail panel updates non-blocking
  • Add loading indicators to Stats/Issue/Changes tabs while data is being fetched
  • Apply same async pattern to OrchMonitorApp for consistency

Problem

The PS panel had severe responsiveness issues:

  • Slow table loading
  • UI freezes during data fetch
  • Tabs remained empty while data was loading

Root Cause: _update_run_detail_panel made blocking calls (HTTP requests, subprocess calls, daemon API) on the main UI thread.

Solution

Split detail panel updates into two phases:

  1. Immediate update (non-blocking):

    • Show run metadata from Run object (Status, Elapsed, Agent, Model, Branch, PR URL)
    • Display loading indicators for async content
    • Show Changes tab data immediately (already in Run object)
  2. Async fetch (background worker):

    • Fetch chat messages for opencode runs (HTTP request)
    • Capture session output for tmux sessions (subprocess)
    • Fetch issue details from daemon API
    • Update UI via call_from_thread when data arrives

Changes

runs_dashboard.hy

  • New _update_run_detail_panel_immediate: Shows data without blocking calls
  • New _fetch_additional_detail_data: Worker to fetch chat/session/issue data async
  • New _apply_additional_detail_data: Updates tabs with fetched data
  • Modified _set_selected_run: Calls immediate update then triggers async fetch

orch_monitor_app.hy

  • New _show_run_detail_immediate: Shows immediate data with loading indicator
  • New _fetch_run_session_output: Worker to fetch session output async
  • New _apply_run_session_output: Updates detail panel with fetched data
  • Modified _show_run_detail_callback: Uses new async pattern

Acceptance Criteria

  • PS panel table loads within 1 second - table now loads immediately
  • UI remains responsive during data fetch - async workers handle blocking calls
  • Stats tab shows run metadata when run is selected - immediate display
  • Issue tab shows issue details when run is selected - loading indicator then async update
  • Changes tab shows diff stats when run is selected - immediate from Run object

Testing

  • Hy files compile successfully
  • Existing tests pass (17 failures are pre-existing, unrelated to this change)
  • Code follows existing patterns using Textual's @work decorator

Fixes orch-379

Previously, _update_run_detail_panel made blocking calls to fetch chat
messages, session output, and issue data on the main UI thread, causing
the panel to freeze while loading.

This change:
- Splits detail panel updates into immediate (non-blocking) and async parts
- Shows loading indicators while async data is being fetched
- Uses Textual's @work decorator with separate worker groups for detail data
- Updates UI from background thread via call_from_thread
- Applies same pattern to OrchMonitorApp for consistency

The runs table now loads immediately, tabs show loading state, and
populate asynchronously without blocking user input.

Fixes orch-379

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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