Skip to content

Commit 3af0944

Browse files
committed
tested all to_test
1 parent 8f30612 commit 3af0944

10 files changed

Lines changed: 38 additions & 4 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Hero Icons in Dropdowns
2+
3+
## Overview
4+
5+
Show hero portrait icons next to hero names in all hero filter/select dropdowns across the app. Use the small hero icons from the Valve/Steam CDN (the same minimap-style icons already used elsewhere in the app via `HeroIcon`).
6+
7+
## Problem
8+
9+
Hero dropdowns currently show plain text names only, making it harder to quickly identify heroes visually.
10+
11+
## Approach
12+
13+
Native `<select>` / `<option>` elements don't support images. Options:
14+
15+
1. **Replace `<select>` with a custom dropdown component** — renders a styled list with `<img>` tags next to each name. Most work but best UX.
16+
2. **Use a lightweight existing component** — e.g. a simple popover list that mimics a select.
17+
18+
The custom component is the right approach since `HeroIcon` already handles the CDN image URL logic.
19+
20+
## Scope
21+
22+
Apply to all hero dropdowns:
23+
- Goals list page (`/goals`) — hero filter
24+
- Goal details page (`/goals/[goalId]`) — hero filter + edit form hero select
25+
- Analysis page (`/analysis`) — hero filter
26+
- Goal creation flow (if any inline forms)
27+
28+
## Acceptance Criteria
29+
- [ ] Hero icon shown to the left of hero name in all dropdowns
30+
- [ ] Favorites section still appears at the top
31+
- [ ] Selected hero shows its icon in the collapsed state
32+
- [ ] Keyboard navigation still works (or is acceptable without it)
33+
- [ ] Consistent sizing with the rest of the UI
File renamed without changes.

meta/tasks/to_test/difficulty-levels-for-suggestions.md renamed to meta/tasks/done/difficulty-levels-for-suggestions.md

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/routes/goals/[goalId]/+page.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,15 @@
201201
function formatGoalDescription(g) {
202202
if (!g) return "";
203203
const heroName = g.hero_id !== null ? getHeroName(g.hero_id) : "Any Hero";
204+
const modeStr = g.game_mode ? ` (${g.game_mode})` : "";
204205
if (g.metric === "ItemTiming") {
205206
const itemName = g.item_id !== null ? getItemName(g.item_id) : "Unknown Item";
206207
const timeStr = formatSeconds(g.target_value);
207-
return `${heroName}: ${itemName} by ${timeStr}`;
208+
return `${heroName}: ${itemName} by ${timeStr}${modeStr}`;
208209
}
209210
const unit = getMetricUnit(g.metric);
210211
const valueStr = unit ? `${g.target_value} ${unit}` : `Level ${g.target_value}`;
211-
return `${heroName}: ${valueStr} by ${g.target_time_minutes} min`;
212+
return `${heroName}: ${valueStr} by ${g.target_time_minutes} min${modeStr}`;
212213
}
213214
214215
function formatStatValue(value, metric) {
@@ -318,13 +319,13 @@
318319
{#if favoriteHeroList.length > 0}
319320
<optgroup label="⭐ Favorites">
320321
{#each favoriteHeroList as hero}
321-
<option value={hero.id}>{hero.name}</option>
322+
<option value={String(hero.id)}>{hero.name}</option>
322323
{/each}
323324
</optgroup>
324325
{/if}
325326
<optgroup label="All Heroes">
326327
{#each otherHeroList as hero}
327-
<option value={hero.id}>{hero.name}</option>
328+
<option value={String(hero.id)}>{hero.name}</option>
328329
{/each}
329330
</optgroup>
330331
</select>

0 commit comments

Comments
 (0)