Repository navigation
fix(themes): neutral and y2k skeletons show on their light page - #12014
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. The Neutral and Y2K remaps do make Skeleton placeholders visible on both light pages, and two follow-ups are needed before this can merge:
- The committed Swift themes still carry the old light skeleton (
NeutralTheme.swiftandY2kTheme.swift, line 141), so iOS apps keep the invisible placeholder and the required Swift drift test intest-nodefails; runpnpm -F @astryxdesign/native generate:swift-iosand commit the result. scripts/check-skeleton-contrast.test.mjsre-implements the token resolver and contrast maths thatscripts/lib/theme-contrast.mjsand core'scontrastRatioalready provide, and already measures slightly differently, so please import those and delete the local copies.
Optional: the CLI changeset could also say that astryx theme edit with a neutral colour now writes the darker skeleton stop.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim, Neutral changeset: the light skeleton takes a darker stop and reads at the pulse peak on the page and every surface. Verified:
neutralTheme.ts:168; 1.28:1 on the page, 1.44:1 on surface, card and popover. - Claim, Y2K changeset: the same for Y2K. Verified:
y2kTheme.ts:231; 1.26:1 on the page, 1.84:1 on surface and card, 1.53:1 on muted. - Claim, CLI changeset: themes scaffolded by
astryx theme ejecttake the same stops. Verified: the bundled copies are byte-identical to the packages and the eject tests pass. - Claim: Neutral's skeleton matched its page (1.00:1) and Y2K's read 1.11:1. Verified by running the new guard against the base.
- Claim: only the token mapping changes and every palette regenerates byte-for-byte. Verified: the Neutral and Y2K palette-ref checks are in sync and no palette file changes.
- Claim: Skeleton pulses up to 0.925 opacity. Verified in Skeleton's keyframes.
- Claim: Core's default reads 1.33:1 in light and 2.35:1 in dark by the same measure. Verified.
- Claim: each new stop is the nearest to Core's default that clears 1.2:1. Verified: the next lighter stops give 1.14:1 (Neutral) and 1.11:1 (Y2K).
- Claim: dark modes and the other five themes already clear 1.2:1 and are unchanged. Verified: the guard flags only Neutral and Y2K light on the base.
- Claim: the selected refs and the CLI's bundled copies were regenerated from the sources. Verified: regenerating them changes nothing.
- Claim: the new guard fails before the change and passes after. Verified.
- Claim: before and after crops show the bars on the page and the card. Consistent with this review's own captures.
- Claim: the listed test command passes 29 files and 161 tests. Verified.
- Claim: the palette-ref checks, Prettier and the changeset check pass. Verified for the changed themes, the changed files and all changesets.
- Claim: no new public API, default or interaction model rides under the fix. Verified: the built API surface of both themes is unchanged.
- File
.changeset/cli-bundled-themes-skeleton-visible.md: clear (optional wording note above). - File
.changeset/theme-neutral-skeleton-visible.md: clear. - File
.changeset/theme-y2k-skeleton-visible.md: clear. - File
packages/cli/assets/templates/themes/neutral/neutralTheme.ts: clear. - File
packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts: clear. - File
packages/cli/assets/templates/themes/y2k/y2kTheme.ts: clear. - File
packages/themes/neutral/src/neutralTheme.ts: its Swift theme was not regenerated. - File
packages/themes/y2k/src/y2kPaletteRefs.generated.ts: clear. - File
packages/themes/y2k/src/y2kTheme.ts: its Swift theme was not regenerated. - File
scripts/check-skeleton-contrast.test.mjs: duplicates the shared contrast helpers.
… shared contrast helpers
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the CI workflow was refused admission while CI was full, so it needs a re-run. Both earlier follow-ups are done: the Swift Neutral and Y2K themes are regenerated, and the skeleton guard now uses the shared contrast helpers.
- Miss (optional): on Neutral's palette-tinted Cards the skeleton loses its luminance contrast (blue goes from 1.28:1 to 1.00:1 at the pulse peak, so the bars show only by hue, much as Core's own tints sit at 1.03–1.27:1), and one clause in the Neutral changeset would tell users about that trade-off.
- Optional: the CLI changeset could also say that
astryx theme editwith a neutral colour now writes the darker skeleton stop.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none since the last review.
- Claim, Neutral changeset: the light skeleton takes a darker stop and reads at the pulse peak on the page and every surface. Verified:
neutralTheme.ts:168; 1.28:1 on the page and muted background, 1.44:1 on surface, card and popover (hue tints are not surfaces; see the note above). - Claim, Y2K changeset: the same for Y2K. Verified:
y2kTheme.ts:231; 1.26:1 on the page, 1.53:1 muted, 1.84:1 on surface, card and popover. - Claim, CLI changeset: themes that
astryx theme ejectscaffolds take the same stops. Verified: the bundled copies are byte-identical to the packages, rerunning the bundler changes nothing, and the eject tests pass. - Claim: Neutral's skeleton matched its page (1.00:1) and Y2K's read 1.11:1. Verified by running the new guard against the base.
- Claim: only the token mapping changes and every palette regenerates byte-for-byte. Verified: no palette file changes and all six palette-ref checks are in sync.
- Claim: Skeleton pulses up to 0.925 opacity. Verified in Skeleton's keyframes.
- Claim: Core's default reads 1.33:1 in light and 2.35:1 in dark by the same measure. Verified.
- Claim: each new stop is the one nearest Core's default that clears 1.2:1 on page, surface and card. Verified: the next lighter stops give 1.14:1 (Neutral) and 1.11:1 (Y2K), the next darker 1.46:1.
- Claim: dark modes and the other five themes already clear 1.2:1 and are unchanged. Verified on page, surface and card; the guard flags only Neutral and Y2K light on the base.
- Claim: the selected refs, the CLI copies and the Swift themes are regenerated, and the Swift output changes only the two skeleton colours. Verified: refs in sync, bundler output unchanged, Swift drift test passes, one line per Swift file.
- Claim: the new guard uses the shared theme-contrast library and core's contrast measure, fails before the change and passes after. Verified.
- Claim: before and after crops show the bars on the page and the card. Consistent with this review's own captures.
- Claim: the listed test command passes 29 files and 161 tests. Verified.
- Claim: the palette-ref checks, Prettier and the changeset check pass. Verified.
- Claim: no new public API, default or interaction model rides under the fix. Verified: the built API surfaces of both themes are unchanged.
- File
.changeset/cli-bundled-themes-skeleton-visible.md: clear (optional wording note above). - File
.changeset/theme-neutral-skeleton-visible.md: clear (optional trade-off note above). - File
.changeset/theme-y2k-skeleton-visible.md: clear. - File
packages/cli/assets/templates/themes/neutral/neutralTheme.ts: clear. - File
packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts: clear. - File
packages/cli/assets/templates/themes/y2k/y2kTheme.ts: clear. - File
packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift: clear. - File
packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift: clear. - File
packages/themes/neutral/src/neutralTheme.ts: clear. - File
packages/themes/y2k/src/y2kPaletteRefs.generated.ts: clear. - File
packages/themes/y2k/src/y2kTheme.ts: clear. - File
scripts/check-skeleton-contrast.test.mjs: clear.
User impact
Skeleton placeholders were invisible on two official themes' light pages. Neutral's
--color-skeletonused the same light stop as its page (#f1f1f1on#f1f1f1, 1.00:1 at any opacity), and y2k's was 1.11:1 on its lavender page. With this change both themes take a darker neutral stop, so the placeholder reads at Skeleton's pulse peak against the page and every surface.Problem and solution fit
Only the token mapping changes (a different palette stop for
--color-skeleton); no generated palette value changes, and every palette regenerates byte-for-byte.Expected behavior and authority
Skeleton pulses its opacity up to 0.925. At that peak a placeholder should read against the page and the surfaces it sits on. Core's own default reads at 1.33:1 (light) and 2.35:1 (dark) by the same measure; each new stop is the one that clears 1.2:1 against every background and is closest to Core's default.
Smallest restoration
neutral.light[95]#f1f1f1neutral.light[85]#d4d4d4neutral.light[80]#d1c5b8neutral.light[75]#c4b8a9NeutralTheme.swift,Y2kTheme.swift) are regenerated from the sources (generate:y2k-palette-refs,generate-cli-themes,generate:swift-ios); the Swift output changes only the two skeleton colors.Evidence
scripts/check-skeleton-contrast.test.mjs(resolves tokens withscripts/lib/theme-contrast.mjsand measures with core'scontrastRatio, as the other contrast guards do): for every first-party theme, both modes, the skeleton at the pulse peak against--color-background-body,-surfaceand-cardmust be at least 1.2:1. Before this change it fails on neutral (page 1.00:1, surfaces 1.12:1) and y2k (page 1.11:1); after, it passes.Scope
Themes: neutral, y2k
Testing
vitest run scripts/check-skeleton-contrast.test.mjs scripts/check-theme-template.test.mjs scripts/check-muted-status-contrast.test.mjs packages/themes packages/cli/api/theme/eject: 29 files, 161 tests pass.generate:*-palette-refs --checkis in sync; prettier and the changeset check pass.