fix(tui): clear stale status filter when no sessions match#362
Closed
mstege wants to merge 1 commit intoasheshgoplani:mainfrom
Closed
fix(tui): clear stale status filter when no sessions match#362mstege wants to merge 1 commit intoasheshgoplani:mainfrom
mstege wants to merge 1 commit intoasheshgoplani:mainfrom
Conversation
when all sessions matching the persisted status filter get removed, rebuildFlatItems() produces an empty list on next startup because loadUIState() restores the old filter. the header bar shows the correct count but the session list stays empty. this clears the filter automatically when it would result in an empty list but sessions actually exist.
8dade22 to
88111bd
Compare
Owner
|
Closing: this fix is already on main. The stale status filter auto-clear logic was applied in an earlier commit. Thank you for the contribution! |
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.
Had a fun time debugging this one. After upgrading to 0.26.3, my TUI showed "No Sessions Yet" even though sessions clearly existed (header bar had the correct count).
Turns out
loadUIState()restores the persisted status filter on startup. If the sessions that matched that filter got removed in the meantime,rebuildFlatItems()filters everything out and you end up with an empty list. The header counts are fine because they read fromh.instancesdirectly, not fromflatItems.In my case I had 18 sessions in error state (tmux server wasnt running), removed them all with
ad rm, created new ones, and the TUI just showed nothing. The old "error" filter was still saved in the sqlite metadata and kept hiding everything.The fix just clears the status filter when it would produce an empty result but sessions are actually there.
repro steps
workaround
quit AD, then run: