Skip to content

fix(tui): distinguish asynchronous UI states - #36759

Merged
kitlangton merged 3 commits into
v2from
fix-dialog-states
Jul 14, 2026
Merged

kitlangton merged 3 commits into
v2from
fix-dialog-states

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Give asynchronous V2 TUI surfaces distinct loading, loaded-empty, filtered-empty, and failure states.

This implements the state-copy decision tracked in #36707 across shared selectors, skills, integrations, project directories, session search, prompt autocomplete, pairing, and the diff viewer.

Before / After

Before: Several surfaces rendered No results found or No matching items while data was still loading or after a request failed. Pairing could show a transport error and Loading server information... simultaneously, failed diff requests appeared as No diff!, and stale autocomplete results remained selectable during a new search.

After: Loading, source-empty, filtered-empty, and failure states are mutually exclusive. Session search filters the preloaded sessions immediately, then uses the server to find older matches; Searching sessions… appears only when there is no local match. Errors take precedence over empty states, and failure copy names the real recovery path.

How

  • Add a separate noMatchView to DialogSelect; its default source-empty state is now No items available while filtered misses remain No results found.
  • Give Skills and Move Session explicit loading, available-empty, filtered-empty, and failure views.
  • Distinguish integration and session-search empty states from filtered misses.
  • Filter preloaded sessions immediately while the debounced server search expands results beyond the initial 50.
  • Preserve file-search failure state in autocomplete and stop carrying stale options into a new query or mode.
  • Make Pair render exactly one of loading, content, or failure.
  • Guard failed diff resources before reading them, prioritize failure over empty, and hide the file count until loading succeeds.

Scope

This PR does not add loading/error state to the shared bootstrap data model, surface stale-data refresh failures for project directories, or change stash persistence. Those require data-layer work rather than dialog copy changes.

It also does not change static selector terminology or unrelated dialog actions.

Testing

  • bun run test from packages/tui (221 passed, 1 skipped)
  • bun typecheck from packages/tui
  • Pre-push hook: bun turbo typecheck --concurrency=3 (32/32 tasks passed)
  • Prettier check for all changed files

Demo

Synchronized opencode-drive v0.4.0 recording. BEFORE runs the exact PR base (748b0d8836); AFTER runs the state-copy commit (06e3bfe4d0). The local-first session-search follow-up (579fdaebd7) preserves the shown no-local-match states. The video demonstrates command autocomplete no-match, Sessions loaded-empty and filtered-empty, and Diff loaded-empty states.

pr-36759-before-after.mp4

@kitlangton
kitlangton merged commit 26e27c7 into v2 Jul 14, 2026
7 checks passed
@kitlangton
kitlangton deleted the fix-dialog-states branch July 14, 2026 14:56
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant