Conversation
There was a problem hiding this comment.
Pull request overview
Adds end-to-end library sorting/filtering (including mod categorization metadata) across the React UI and Tauri backend so users can tag/map/champion-categorize mods and filter/sort the installed library accordingly.
Changes:
- Introduces a Zustand-backed library filter/sort store plus derived hooks for filter options and filtered/sorted mod lists.
- Adds UI components for filter controls (MultiSelect-based) and sort dropdown; displays tags/champions/maps in cards and mod details.
- Extends Tauri/Rust + TS API models to persist and surface
tags,champions, andmaps, and bumpsleague-modcrates to support the new metadata.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/stores/libraryFilter.ts | New Zustand store for selected tags/champions/maps and sort config, plus helper hook. |
| src/stores/index.ts | Re-export library filter store. |
| src/routes/workshop/$projectName/index.tsx | Adds workshop project “Categorization” UI and submits tags/champions/maps to backend. |
| src/pages/Library.tsx | Wires FilterBar into the Library page using computed filter options. |
| src/modules/workshop/components/ProjectCard.tsx | Stops click propagation for action/menu areas to prevent unintended card navigation. |
| src/modules/library/utils/labels.ts | Adds tag/map label helpers with fallbacks. |
| src/modules/library/utils/index.ts | Exports new label utilities. |
| src/modules/library/index.ts | Re-exports utils from the library module. |
| src/modules/library/components/index.ts | Exports new filter/sort UI components. |
| src/modules/library/components/SortDropdown.tsx | Adds sort dropdown controlling the filter store sort config. |
| src/modules/library/components/ModDetailsDialog.tsx | Displays tags/champions/maps in the mod details dialog. |
| src/modules/library/components/ModCard.tsx | Shows tag/champion “pills” on mod cards; uses shared InstalledMod type. |
| src/modules/library/components/LibraryToolbar.tsx | Adds SortDropdown to the toolbar. |
| src/modules/library/components/LibraryContent.tsx | Switches to filtered/sorted mods and disables DnD when non-priority sort/search/filters are active. |
| src/modules/library/components/FilterPopover.tsx | Adds (currently unused) popover-based filter UI. |
| src/modules/library/components/FilterBar.tsx | Adds MultiSelect-based filter bar for tags/champions/maps. |
| src/modules/library/components/ActiveFilterChips.tsx | Adds (currently unused) chip display for active filters. |
| src/modules/library/api/useFilteredMods.ts | Adds hook to apply search + store filters + sorting. |
| src/modules/library/api/useFilterOptions.ts | Adds hook to compute available tags/champions/maps from installed mods. |
| src/modules/library/api/index.ts | Exports new filter hooks/types. |
| src/lib/tauri.ts | Extends TS interfaces for InstalledMod, WorkshopProject, and save args with tags/champions/maps. |
| src/lib/form/index.ts | Adds ComboboxField to the app form hook and exports. |
| src/lib/form/components.tsx | Implements a pre-bound ComboboxField for TanStack React Form. |
| src/components/index.ts | Exports new Combobox and MultiSelect components. |
| src/components/Select.tsx | Enhances Select with prefix, positioner props passthrough, and scrollable popup. |
| src/components/MultiSelect.tsx | Adds a MultiSelect component built on Base UI Combobox. |
| src/components/Combobox.tsx | Adds a styled wrapper/compound API around Base UI Combobox plus a simple ComboboxField. |
| src-tauri/src/workshop/projects.rs | Persists tags/champions/maps in project config and import paths; initializes new fields for new projects. |
| src-tauri/src/workshop/mod.rs | Extends workshop structs/serialization to include tags/champions/maps and loads them from config. |
| src-tauri/src/overlay/modpkg_content.rs | Initializes new ModProject metadata fields for modpkg overlay content. |
| src-tauri/src/overlay/fantome_content.rs | Initializes new ModProject metadata fields for fantome overlay content. |
| src-tauri/src/mods/mod.rs | Extends installed mod struct for UI payload with tags/champions/maps. |
| src-tauri/src/mods/library.rs | Populates tags/champions/maps from mod project metadata and fantome/modpkg extraction. |
| src-tauri/Cargo.toml | Bumps league-mod crate versions to support metadata additions. |
| Cargo.lock | Updates lockfile for dependency bumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/stores/libraryFilter.ts
Outdated
| setTags: (tags) => set({ selectedTags: tags }), | ||
| setChampions: (champions) => set({ selectedChampions: champions }), | ||
| setMaps: (maps) => set({ selectedMaps: maps }), |
There was a problem hiding this comment.
setTags/setChampions/setMaps store the passed-in Set by reference. If the caller mutates that Set later, the Zustand state can change without a set() call and subscribers may not re-render. Prefer cloning (e.g., store new Set(tags) etc.) to keep store state immutable from the outside.
No description provided.