You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Favorites: wire the editable-favorites frontend (Phase 2)
Lets users curate the volume switcher's Favorites section end to end, on top of the Phase 1 backend store. Resolves issue #27 (no way to change the favorite folders).
- **Add to favorites** on three surfaces: an `favorites.add` command (palette, the Go menu's "Add to favorites", default ⌘D) favoriting the focused pane's current folder; plus context-menu items on folder rows and the `..` parent row. The context-menu add is handled in Rust (`FAVORITES_ADD_CONTEXT_ID` intercepted in `on_menu_event`, favoriting `MenuState.context.path`) so a folder row favorites the right-clicked folder and `..` favorites the parent dir, never the focused dir. `..` gets a dedicated one-item native menu via `show_parent_row_context_menu`.
- **Per-item Remove / Rename** on the switcher's existing dropdown row menu (right-click a favorite). Rename swaps the label for an inline input (Enter commits, Escape/blur cancels).
- **Reorder** by drag within the section AND keyboard (Alt+Up / Alt+Down on a focused favorite, since Cmdr is keyboard-first). Both persist the full order via `reorderFavorites`. Pure index math in `favorites-reorder.ts`. Drag cue respects `prefers-reduced-motion` (no animated transition).
- **Empty state**: the `favorite` group now always renders (it's a real state — users can clear every favorite); shows a single disabled, non-focusable placeholder "(Your favorites will show here)".
- All mutations go through typed `commands.*` wrappers in `tauri-commands/favorites.ts`; the `fav-` prefix on the switcher's `LocationInfo.id` is stripped via `stripFavoritePrefix` before remove/rename/reorder. Live updates ride the backend's `volumes-changed` re-emit (no manual refresh).
- Tests: command registration + handler, the empty-state placeholder, drag/keyboard reorder calling `reorderFavorites` with the right bare-id order, rename, remove, id-prefix stripping, the reorder math, and an a11y pass. Updated the dispatchable-count and menu-roundtrip pins.
Note: `VolumeBreadcrumb.svelte` now exceeds its file-length allowlist (1701 vs 1414, warn-only); left for a follow-up split rather than bumping the allowlist.
0 commit comments