feat: complete inventory search frontend — weapons, filters, status column

- Add Weapons and Clothing equipment type radio options
- Add Weapon/Combat Stats filter card: damage, attack bonus, crit resist, tinks
- Add Item Properties filter card: material, level req, workmanship, value, burden
- Add Item State filter card: spell text search, bonded, attuned, rare checkboxes
- Add Status column (Equipped/Inventory) to results table
- Remove dead Slot View button and section (no JS handlers existed)
- Update clearAllFields() for all new inputs
- All changes frontend-only — suitbuilder and backend API untouched

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-04-08 17:10:35 +02:00
parent 8432c5f7c3
commit 5b26a19666
2 changed files with 126 additions and 18 deletions

View file

@ -171,6 +171,12 @@ function clearAllFields() {
// Reset slot filter
document.getElementById('slotFilter').value = '';
// Clear item state checkboxes (not covered by form.reset for standalone checkboxes)
['searchBonded', 'searchAttuned', 'searchIsRare'].forEach(id => {
const el = document.getElementById(id);
if (el) el.checked = false;
});
// Reset page
currentPage = 1;
@ -250,6 +256,10 @@ function buildSearchParameters() {
params.append('shirt_only', 'true');
} else if (equipmentType === 'pants') {
params.append('pants_only', 'true');
} else if (equipmentType === 'weapon') {
params.append('weapon_only', 'true');
} else if (equipmentType === 'clothing') {
params.append('clothing_only', 'true');
}
// If 'all' is selected, don't add any type filter
@ -294,7 +304,14 @@ function buildSearchParameters() {
addParam(params, 'min_vitality_rating', 'searchMinVitalityRating');
addParam(params, 'min_damage_resist_rating', 'searchMinDamageResistRating');
addParam(params, 'min_crit_damage_resist_rating', 'searchMinCritDamageResistRating');
// Weapon / combat stats
addParam(params, 'min_damage', 'searchMinDamage');
addParam(params, 'max_damage', 'searchMaxDamage');
addParam(params, 'min_attack_bonus', 'searchMinAttackBonus');
addParam(params, 'min_crit_resist_rating', 'searchMinCritResistRating');
addParam(params, 'min_tinks', 'searchMinTinks');
// Requirements parameters
addParam(params, 'min_level', 'searchMinLevel');
addParam(params, 'max_level', 'searchMaxLevel');
@ -305,7 +322,21 @@ function buildSearchParameters() {
addParam(params, 'min_value', 'searchMinValue');
addParam(params, 'max_value', 'searchMaxValue');
addParam(params, 'max_burden', 'searchMaxBurden');
// Spell text search
addParam(params, 'spell_contains', 'searchSpellContains');
// Item state filters (only send when checked)
if (document.getElementById('searchBonded')?.checked) {
params.append('bonded', 'true');
}
if (document.getElementById('searchAttuned')?.checked) {
params.append('attuned', 'true');
}
if (document.getElementById('searchIsRare')?.checked) {
params.append('is_rare', 'true');
}
// Equipment set filters
const selectedEquipmentSets = getSelectedEquipmentSets();
if (selectedEquipmentSets.length === 1) {
@ -418,6 +449,7 @@ function displayResults(data) {
<thead>
<tr>
<th class="sortable" data-sort="character_name">Character${getSortIcon('character_name')}</th>
<th class="sortable" data-sort="is_equipped">Status${getSortIcon('is_equipped')}</th>
<th class="sortable" data-sort="name">Item Name${getSortIcon('name')}</th>
<th class="sortable" data-sort="item_type_name">Type${getSortIcon('item_type_name')}</th>
<th class="text-right narrow-col sortable" data-sort="slot_name">Slot${getSortIcon('slot_name')}</th>
@ -508,6 +540,7 @@ function displayResults(data) {
html += `
<tr>
<td>${item.character_name}</td>
<td class="${statusClass}">${status}</td>
<td class="item-name">${displayName}</td>
<td>${itemType}</td>
<td class="text-right narrow-col">${slot}</td>