Skip to content

Conversation

@matleh
Copy link
Contributor

@matleh matleh commented Jan 22, 2026

Summary

Adds a toggle key (h) in the TUI to hide beans with completed or scrapped status, 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:

  • Added hideCompleted boolean field to listModel to track toggle state
  • Modified loadBeans() to apply GraphQL ExcludeStatus filter when toggle is active
  • Implemented toggleHideCompleted() method to flip the filter state
  • Added h key binding handler in list view

User Experience:

  • Press h in list view to toggle hiding of completed/scrapped beans
  • Title dynamically updates to reflect active filters:
    • Default: "Beans"
    • With toggle: "Beans [hiding completed]"
    • With both filters: "Beans [tag: bug] [hiding completed]"
  • Added h shortcut to help overlay (press ? to view)
  • Updated both View() and ViewConstrained() for consistency in two-column mode

Filter Behavior:

  • Hide-completed filter works independently from tag filter (both can be active)
  • Default state shows all beans (no behavior change for existing users)
  • Press esc to clear tag filter only; h controls completed/scrapped visibility separately
  • Uses existing GraphQL ExcludeStatus filter for efficient server-side filtering

Technical Details

Filtering Approach:
The implementation leverages the existing GraphQL BeanFilter.ExcludeStatus field to filter at query time, ensuring efficient operation even with large bean sets. The filter is applied in loadBeans() 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:

  • Status represents semantic completion state (what's done)
  • Archive directory is organizational (tidiness)
  • Beans in archive/ are always loaded per project design (see commit d7b01db)
  • Most archived beans are completed/scrapped anyway, so toggle handles the primary use case

Testing

  • ✅ All existing tests pass (11/11 TUI tests)
  • ✅ No compilation errors or vet warnings
  • ✅ GraphQL ExcludeStatus filter verified working correctly
  • ✅ Tested with 53 total beans (25 completed/scrapped)
  • ✅ Filter correctly excludes completed/scrapped beans
  • ✅ Builds successfully
  • ✅ Works in both single-column and two-column preview modes

Checklist

  • Code follows project conventions
  • All tests pass
  • No breaking changes
  • Feature works in both single and two-column modes
  • Help overlay updated with new shortcut
  • Default behavior unchanged (shows all beans)

- Add hideCompleted boolean field to listModel
- Use GraphQL ExcludeStatus filter when toggle is active
- Update list title to show active filters
- Add 'h' shortcut to help overlay
- Both tag and hide-completed filters can be active simultaneously
- Default state shows all beans (matching current behavior)
@matleh
Copy link
Contributor Author

matleh commented Jan 23, 2026

Closing to recreate with correct feature branch (hide-completed-toggle)

@matleh matleh closed this Jan 23, 2026
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