fix(tui): distinguish dialog empty states#36727
Open
kitlangton wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Give
DialogSelectexplicit empty-state semantics so loading, an empty collection, and a filtered miss no longer all read asNo results found.Sessions now says
No sessions yetwhen the collection is empty. Skills saysNo skills availablewhen no skills load, while preserving its existing inline load error. Both resource-backed dialogs showLoading...while appropriate, and filtered misses use the existing app conventionNo matching results.Before / After
Before: Opening an empty Sessions dialog immediately showed
No results found. Searching Sessions or Skills for a missing item showed the same copy, including while a debounced remote session query had not completed, so users could not tell whether the collection was empty, the filter missed, or data was still loading.After: An unfiltered empty collection uses the consumer's domain copy, a pending empty result uses
Loading..., and a non-empty filter with no visible options usesNo matching results. Session search ties loading to the visible query as well as the debounced resource key, so stale results cannot briefly claim there are no matches.How
loadingprop toDialogSelectand resolve empty content in this order: loading, filtered miss, consumeremptyView, genericNo itemsfallback.@opentui/solidtestRendercoverage for loading, custom unfiltered empty/error content, filtered no-match content, and the generic fallback.flowchart TD A[No visible options] --> B{loading?} B -->|yes| C[Loading...] B -->|no| D{filter non-empty?} D -->|yes| E[No matching results] D -->|no| F[Consumer emptyView or No items]Scope
packages/tuionly.packages/opencodeV1 is unchanged.Testing
bun run test test/ui/dialog-select.test.tsxfrompackages/tui(2 passed)bun typecheckfrompackages/tuibun turbo typecheck --concurrency=3(32 tasks passed)opencode-drive check ./dialog-empty-states.drive.tsbefore each recordingorigin/v2and this branchDemo
Left: unmodified
origin/v2. Right: this branch. The drive fixture has no user sessions. V2 always contributes the built-in OpenCode and Report skills, so the Skills segment honestly demonstrates a filtered miss; the SessionsLoading...frame is the real 150 ms debounce/resource transition, not an artificial delay.dialog-empty-before-after.mp4