Skip to content

feat: per-deck color-label filter toggle - #69

Merged
aaronjmars merged 2 commits into
mainfrom
feat/color-label-filter
Jun 11, 2026
Merged

aaronjmars merged 2 commits into
mainfrom
feat/color-label-filter

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

What

Add a compact color-label filter pill row above the deck column grid. Operators with tagged columns can single-click to isolate one color group — same ergonomics as GitHub label filters.

Why

Column color labels (PR #61) and deck color labels (PR #62) let operators visually group columns, but at 15+ columns per deck the tagged columns are still found by scrolling. No way to isolate a color group until now. From repo-actions-2026-06-10.md idea #5 — 11th rung on the per-column UX axis after width, keyboard nav, and refresh-all.

Changes

  • lib/store/use-deck-store.ts: added activeColorFilter: Record<deckId, string | null> view-state field, setColorFilter(deckId, color | null) action, deleteDeck scrub. Same lifecycle as widthByColumn/searchByColumn (view-state only, NOT persisted, NOT exported).
  • lib/store/use-deck-store.ts: getVisibleColumnIds takes an optional colorFilter arg and applies it AFTER tab filtering, BEFORE pinned-first partition — composes cleanly with existing filters. Both sides go through normalizeColumnColor so case folding can't cause a miss.
  • components/deck/deck-board.tsx: new filter pill row above the grid — one chip per used color (dot + count) + "All" outlined pill, brand-ring on the active chip, hidden when fewer than 2 distinct colors are in use. flex-wrap so it wraps on small screens. A useEffect auto-clears the filter when the active color is no longer present in any column. Zero-match placeholder with a "Clear filter" affordance instead of an empty grid.
  • components/deck/deck-view.tsx: deck-header "Refresh all" button now reads activeColorFilter[deckId] and passes it to getVisibleColumnIds, so a color-filtered refresh-all only refreshes the visible columns (otherwise filtered-out columns would receive a pending refresh signal they'd never drain, pinning the spinner on forever — same rationale as the tab filter).

Design constraints honored

  • No DB migration, no server action change, no export schema bump (DECK_EXPORT_VERSION untouched) — purely view-state.
  • Filter is per-deck (sticky during a session across deck switches), not per-tab.
  • Pinned columns are NOT exempt from the color filter — pinning is routing (always visible across tabs), color is labeling. An orange-tagged pin survives a "show orange" filter; a blue-tagged pin does not.
  • Pill row hidden when usedColors.length < 2.

Test plan

  • Deck with 1 color → filter bar hidden
  • Deck with ≥2 colors → filter bar visible, default "All" active
  • Click a color chip → only matching columns visible, brand-ring on active chip
  • Click "All" → all columns visible again
  • Change the active-filter color on every column → filter auto-clears (no stuck state)
  • Per-deck independent: switching decks preserves each deck's filter state for the session
  • Delete a filtered deck → no orphan entry left in activeColorFilter
  • Deck-header "Refresh all" with an active filter → only filtered columns refresh

Could NOT run Next 16 build/typecheck (offline sandbox — same constraint as PRs #49-#68). Verified by reading; ready for CI typecheck on merge.

Built autonomously by Aeon — from repo-actions-2026-06-10.md idea #5.

Aeon and others added 2 commits June 11, 2026 12:12
The colorCounts useMemo was declared after the `if (!deck) return`
early return, so the hook count changed when a DeckBoard rendered with
a missing deck (e.g. a stale activeDeckId after hydration/share-import),
tripping React's Rules of Hooks ("rendered fewer hooks than expected").

Move it up beside usedColors — its sibling color rollup — before the
guard, keeping the internal `if (!deck)` check so it mirrors usedColors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aaronjmars
aaronjmars merged commit d8b0f9a into main Jun 11, 2026
1 check passed
@aaronjmars
aaronjmars deleted the feat/color-label-filter branch June 11, 2026 13:27
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.

2 participants