Skip to content

Resolve badge and alert state icons through static tags - #2

Merged
oneleggedswede merged 1 commit into
mainfrom
fix/badge-icon-windows-race
Sep 6, 2026
Merged

Resolve badge and alert state icons through static tags#2
oneleggedswede merged 1 commit into
mainfrom
fix/badge-icon-windows-race

Conversation

@oneleggedswede

Copy link
Copy Markdown
Contributor

Summary

  • Badge and alert both branch on tone to pick one of four built-in icons, and did so through <x-shape::icon :name="$glyph" />, which drops into Laravel's <x-dynamic-component> for any name not known at compile time.
  • That path writes a temp file the first time a given icon name is rendered in the process and reads it back — on windows-latest that first read has come back empty, deterministically for whichever test file happens to touch a given icon name first. That's why BadgeTest's icon assertions failed in full on P8.5 - L13.* - prefer-lowest - windows-latest, while AlertTest — exercising the very same icon names moments later in the same run — passed.
  • The four built-in states are a fixed, known set, so badge and alert now reach them with a literal <x-shape::icon.shape-{tone} /> tag instead. That folds and memoizes like any other anonymous component and never touches the dynamic-component temp file. A caller's own :icon name still goes through the dynamic path, since there's no fixed set of those to special-case against.

Test plan

  • composer test locally (passing on macOS/prefer-stable already)
  • Confirm the P8.5 - L13.* - prefer-lowest - windows-latest lane, which reproduced this failure on main, passes here

Badge and alert both branch on tone to pick one of four built-in
icons, and did so through <x-shape::icon :name="$glyph" />, which
falls through Laravel's <x-dynamic-component> for any name not known
at compile time. That path writes a temp file on first use of a given
icon name and reads it back, and on windows-latest CI that first
read has come back empty — deterministically for whichever test file
happens to touch a given icon name first, which is why BadgeTest's
icon assertions failed in full on the P8.5/L13/prefer-lowest Windows
lane while AlertTest, exercising the very same icon names moments
later, passed.

The four built-in states are always the same fixed set of components,
so they can be reached with a literal tag per tone instead, which
folds and memoizes like any other anonymous component and never goes
near the dynamic-component temp file. A caller's own :icon name still
needs the dynamic path, since there's no fixed set of those to
special-case against.
@oneleggedswede
oneleggedswede merged commit 818fc42 into main Sep 6, 2026
24 checks passed
@oneleggedswede
oneleggedswede deleted the fix/badge-icon-windows-race branch September 6, 2026 11:23
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