feat: add 'h' key toggle to hide completed/scrapped beans in TUI #74
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.
Summary
Adds a toggle key (
h) in the TUI to hide beans withcompletedorscrappedstatus, making it easier to focus on active work while keeping finished beans accessible when needed.Motivation
When working with projects that accumulate many completed/scrapped beans, the TUI list can become cluttered with finished work. While archived beans provide valuable project memory and context, users often want to focus only on active work during day-to-day usage.
This change provides a simple toggle to hide finished beans without removing the ability to see them when context is needed.
Changes
Core Implementation:
hideCompletedboolean field tolistModelto track toggle stateloadBeans()to apply GraphQLExcludeStatusfilter when toggle is activetoggleHideCompleted()method to flip the filter statehkey binding handler in list viewUser Experience:
hin list view to toggle hiding of completed/scrapped beans"Beans""Beans [hiding completed]""Beans [tag: bug] [hiding completed]"hshortcut to help overlay (press?to view)View()andViewConstrained()for consistency in two-column modeFilter Behavior:
escto clear tag filter only;hcontrols completed/scrapped visibility separatelyExcludeStatusfilter for efficient server-side filteringTechnical Details
Filtering Approach:
The implementation leverages the existing GraphQL
BeanFilter.ExcludeStatusfield to filter at query time, ensuring efficient operation even with large bean sets. The filter is applied inloadBeans()alongside any active tag filters.Status vs Archive Directory:
This toggle filters by bean status (
completed/scrapped), not by archive directory location. This is intentional:archive/are always loaded per project design (see commit d7b01db)Testing
ExcludeStatusfilter verified working correctlyChecklist