feat(frontend): multi-select weapon-type-by-skill filter + auto OD column

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-15 08:44:00 +02:00
parent b4bee24773
commit d6fa0fa9b0
7 changed files with 37 additions and 18 deletions

View file

@ -1,5 +1,5 @@
import type { InventorySearch } from './useInventorySearch';
import { RATING_DEFS } from './constants';
import { RATING_DEFS, WEAPON_TYPES } from './constants';
interface Chip { label: string; gold?: boolean; remove: () => void; }
@ -12,9 +12,13 @@ export function ActiveChips({ search }: { search: InventorySearch }) {
remove: () => update({ characters: 'all' }),
});
if (f.itemType !== 'all') chips.push({
label: f.itemType[0].toUpperCase() + f.itemType.slice(1) + (f.weaponType ? `: ${f.weaponType}` : ''),
remove: () => update({ itemType: 'all', weaponType: '' }),
label: f.itemType[0].toUpperCase() + f.itemType.slice(1),
remove: () => update({ itemType: 'all', weaponTypes: [] }),
});
for (const wt of f.weaponTypes) {
const label = WEAPON_TYPES.find(w => w.value === wt)?.label ?? wt;
chips.push({ label, remove: () => update({ weaponTypes: f.weaponTypes.filter(x => x !== wt) }) });
}
for (const s of f.slots) chips.push({ label: `Slot: ${s}`, remove: () => update({ slots: f.slots.filter(x => x !== s) }) });
for (const c of f.cantrips) chips.push({
label: c.replace(/^Legendary /, 'Leg. '), gold: true,