WORK-419
Setting up your dashboard 0 entities found · 9/32 branches scanned
ID:WORK-419Status:done

icon: image-src resolver

The inline icon shorthand discussed when the icon rune landed: ![GitHub](icon:github) resolves to the named icon's inline SVG — the same source the {% icon %} rune uses.

Priority:mediumComplexity:moderateMilestone:v0.22.0Source:SPEC-106
claude/spec-106-image-src-schemes View source

Criteria completion

Criteria completion: 3 of 3 (100%) checked; tracking started on Jun 13, no incremental history yet0%25%50%75%100%Jun 13Jun 15

Tracking started Jun 13 — check back for trends.

Branches 2
claude/spec-106-image-src-schemes current done
claude/spec-image-src-scheme-sugar pendingmain done
History 2
  1. 3358f53
    Created (done)by bjornolofandersson
  2. 8bc0dca
    Content editedby Claude
    plan: break SPEC-106 into WORK-418..422 under v0.22.0

Scope

  • Register an icon:<name> resolver (via WORK-418) that looks the name up in the theme's global icon group and inlines its SVG, with alt as the accessible label (aria-label/role="img").
  • Unknown icon name → dev warning + graceful fallback (neutral glyph or passthrough), not a hard error.
  • Reuse the {% icon %} rune's resolution path rather than duplicating it.

Acceptance Criteria

  • ![label](icon:<name>) renders the icon set's SVG inline, with alt exposed as the accessible label.
  • An unknown icon name warns (dev) and falls back gracefully.
  • Resolution shares the {% icon %} rune's icon source; tests cover a known + unknown name.

Dependencies

  • Requires WORK-418 (the scheme registry).

References

  • SPEC-106 · {% icon %} rune (packages/runes/src/index.ts) + theme global icon group.

Resolution

Completed: 2026-06-13

Branch: claude/spec-106-image-src-schemes

What was done

  • Extracted the icon-registry lookup into packages/runes/src/lib/icon-resolve.ts (resolveIcon, splitIconName) so the {% icon %} rune and the icon: scheme share exactly one resolution path (config.variables.__icons).
  • Refactored packages/runes/src/tags/icon.ts to delegate to resolveIcon (behaviour unchanged; still silent on misses).
  • Registered the icon:<name> scheme in image-schemes.ts: resolves the name (incl. group/name) to inline SVG, sets role="img" + aria-label from the image alt, and console.warns + falls back to a neutral <span> glyph on unknown names.
  • Tests cover a known icon (svg + a11y label, no leaked <img>) and an unknown name (warn + fallback span).

Notes

  • resolveIcon returns { tag, found }; the rune ignores found (stays silent), the scheme uses it to decide whether to warn — so the rune's existing behaviour is unchanged while the scheme warns as specified.