Visitar URL original
fix(ui): respect display density and default icon sizes by rdimitrov · Pull Request #1728 · modelcontextprotocol/registry · GitHub
Skip to content

fix(ui): respect display density and default icon sizes - #1728

Merged
rdimitrov merged 1 commit into
mainfrom
codex/fix-icon-size-selection
Oct 23, 2026
Merged

rdimitrov merged 1 commit into
mainfrom
codex/fix-icon-size-selection

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

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.

@rdimitrov
rdimitrov merged commit 876f408 into main Oct 23, 2026
9 checks passed
@rdimitrov
rdimitrov deleted the codex/fix-icon-size-selection branch October 23, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant