Repository navigation
Commit 876f408
authored
fix(ui): respect display density and default icon sizes (#1728)
Icon selection currently compares raster dimensions with a 40 CSS-pixel
tile, which selects undersized images on high-density displays. Use the
current device pixel ratio when scoring candidates: for example, a 2×
display now chooses a 96×96 icon over a 48×48 icon for that tile.
Treat omitted or empty `sizes` like `"any"`, matching the schema's
default that an icon without sizes is usable at any size. This keeps an
SVG without size metadata from losing to a fixed-size raster icon.
Follow-up to #1586.
Validation:
- Focused JavaScript assertions against the actual HTML helpers passed
for default/1×/1.5×/2×/3× density, omitted/empty/`any` sizes in both
candidate orders, undersized fallback, theme preference, unsafe schemes,
and attribute escaping.
- `go test ./internal/api/handlers/v0 -run '^TestUIHTML_' -count=1`
passed.
- `git diff --check` passed.1 parent c1d6a1c commit 876f408
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
570 | | - | |
| 571 | + | |
| 572 | + | |
571 | 573 | | |
572 | 574 | | |
573 | 575 | | |
574 | | - | |
575 | | - | |
| 576 | + | |
| 577 | + | |
576 | 578 | | |
577 | 579 | | |
578 | | - | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
| |||
0 commit comments