refactor: compact pill-based filter toolbar
Merge the toggleable multi-line FilterBar and the separate ActiveFilterChips strip into a single always-visible row of pills. Each filter category is a pill that opens a small popover with its underlying control; when active, the pill shows its current value inline (so the chips strip is redundant). - New FilterPill primitive: outside-click + Escape to close, optional inline X to clear without opening the popover. - FilterBar rebuilt out of pills for Date/Type/Rating/Color/Flag/Tags/Sort, with a Clear-all pill on the right when any filter is active. - Drop filterBarOpen from filterStore, the SlidersHorizontal toggle from TopBar, the \\ shortcut from useKeyboardShortcuts, and the matching hint from KeyboardHints — the bar is always visible now. - Delete ActiveFilterChips; its information lives inside the pills. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { useHotkeys } from 'react-hotkeys-hook'
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { usePhotoStore } from '../store/photoStore'
|
||||
import { useFilterStore } from '../store/filterStore'
|
||||
import { photos as photosApi, heaps as heapsApi, type Heap } from '../services/api'
|
||||
import { HEAPS_QUERY_KEY } from './useHeapsQuery'
|
||||
import { toast } from '../components/ToastContainer'
|
||||
@@ -222,9 +221,7 @@ export function useKeyboardShortcuts(props: KeyboardShortcutsProps) {
|
||||
useHotkeys('tab', onToggleLeftSidebar, HK_OPTS)
|
||||
useHotkeys('i', onToggleRightSidebar, HK_OPTS)
|
||||
|
||||
// Filter bar toggle (\) and search focus (/ or Cmd/Ctrl+F).
|
||||
useHotkeys('\\', () => useFilterStore.getState().toggleFilterBar(), HK_OPTS)
|
||||
|
||||
// Search focus (/ or Cmd/Ctrl+F).
|
||||
const focusSearch = () => {
|
||||
const el = document.getElementById('topbar-search') as HTMLInputElement | null
|
||||
el?.focus()
|
||||
|
||||
Reference in New Issue
Block a user