tui: gallery — filter popover with chips (tags / model / lora / nsfw) #137

Closed
opened 2026-04-14 20:12:22 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a user with hundreds of images, I want a filter overlay where I can pick tags, model, LoRA, and NSFW flag in one place, so that I don't have to discover separate keybinds for each filter dimension.

Background

GalleryFilter has fields for tags, model, lora, hide_nsfw that the storage list() already honours, but only search is settable from the UI. GTK has a filter popover with chip indicators in crates/loom-gtk/src/pages/gallery/mod.rs:841-855.

Acceptance criteria

Filter overlay

  • New OverlayKind::GalleryFilter opens via f (uppercase F)
  • Tabbed sections: Tags · Model · LoRA · Misc
  • Tags tab: list of all tags from storage.list_tags(), multi-select with Space
  • Model tab: fuzzy-search list of model names from storage (distinct values)
  • LoRA tab: same as Model for LoRAs
  • Misc tab: NSFW toggle checkbox, sort order radio
  • Enter applies; Esc cancels; r resets all filters

Active-filter chip bar

  • When any filter is active, a chip bar appears above the grid showing each active filter (e.g. tag:portrait × · model:sd-xl × · NSFW hidden ×)
  • Each chip is removable by clicking or x keypress when chip-focused
  • Empty filter clears the chip bar entirely

Storage

  • Add pub fn list_tags(&self) -> Result<Vec<String>> to GalleryStorage if not present
  • Add pub fn list_distinct_models(&self) -> Result<Vec<String>> and same for LoRAs

Tests

  • Unit: filter applies all four dimensions independently
  • Unit: clearing the filter bar restores the unfiltered list

Out of scope

  • Saved filter presets
  • Date-range filter
  • Folder filter (already works via folder selection)

References

  • crates/loom-tui/src/screens/gallery.rs (filter: GalleryFilter)
  • crates/loom-gtk/src/pages/gallery/mod.rs:841-855 (GTK reference)
  • crates/loom-core/src/services/storage.rs (storage methods to add)
## User story As a user with hundreds of images, I want a filter overlay where I can pick tags, model, LoRA, and NSFW flag in one place, so that I don't have to discover separate keybinds for each filter dimension. ## Background `GalleryFilter` has fields for `tags`, `model`, `lora`, `hide_nsfw` that the storage `list()` already honours, but only `search` is settable from the UI. GTK has a filter popover with chip indicators in `crates/loom-gtk/src/pages/gallery/mod.rs:841-855`. ## Acceptance criteria ### Filter overlay - [ ] New `OverlayKind::GalleryFilter` opens via `f` (uppercase `F`) - [ ] Tabbed sections: Tags · Model · LoRA · Misc - [ ] Tags tab: list of all tags from `storage.list_tags()`, multi-select with `Space` - [ ] Model tab: fuzzy-search list of model names from storage (distinct values) - [ ] LoRA tab: same as Model for LoRAs - [ ] Misc tab: NSFW toggle checkbox, sort order radio - [ ] `Enter` applies; `Esc` cancels; `r` resets all filters ### Active-filter chip bar - [ ] When any filter is active, a chip bar appears above the grid showing each active filter (e.g. `tag:portrait × · model:sd-xl × · NSFW hidden ×`) - [ ] Each chip is removable by clicking or `x` keypress when chip-focused - [ ] Empty filter clears the chip bar entirely ### Storage - [ ] Add `pub fn list_tags(&self) -> Result<Vec<String>>` to `GalleryStorage` if not present - [ ] Add `pub fn list_distinct_models(&self) -> Result<Vec<String>>` and same for LoRAs ### Tests - [ ] Unit: filter applies all four dimensions independently - [ ] Unit: clearing the filter bar restores the unfiltered list ## Out of scope - Saved filter presets - Date-range filter - Folder filter (already works via folder selection) ## References - `crates/loom-tui/src/screens/gallery.rs` (`filter: GalleryFilter`) - `crates/loom-gtk/src/pages/gallery/mod.rs:841-855` (GTK reference) - `crates/loom-core/src/services/storage.rs` (storage methods to add)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#137
No description provided.