Repository navigation
fix(stories): load the country flags in Ladle - #480
Merged
Merged
Conversation
Two faults, both Ladle's dev server alone:
- Vite resolved `new URL('/flags/', import.meta.url)` as an asset under
Ladle's root and rewrote it to `/@fs/flags`, dropping the slash. The
build already left it to runtime; `@vite-ignore` makes every server do so.
- Ladle's server is Koa, which presets 404, so the flag middleware's
answers arrived as 404s. It now sets 200.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8ed1fd9)
Contributor
|
🤖 no session running Written by the sydevs dispatcher. Sessions never edit this comment. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 8c72a02 | Nov 25 2026, 03:26 PM |
Contributor
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is
Contributor
|
Adversarial review skipped: 2 file(s), 9 changed line(s), under 🤖 sydevs dispatcher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Country flags did not load in the Ladle design playground. Two faults stacked:
src/lib/flag-cdn.ts: Vite's dev server treatednew URL('/flags/', import.meta.url)as an asset reference and rewrote it to/@fs/flags(slash dropped), so every flagsrcwas/@fs/flagsin.svg.scripts/circle-flags.mjs: Ladle's server is Koa, which presets the status to 404 before middleware runs, so even a correct/flags/in.svganswer arrived as a 404 and the browser drew nothing.Change outline
Preview
Design playground story
views--countries(Views > Countries): the country list shows its flags again. Preview pending for the deployed playground.Test results
views--countries, countingimg[data-testid=circle-country-flag]withnaturalWidth > 0:main(fix reverted): 12 flag imgs, 0 loaded (src=/@fs/flagsin.svg)src=/flags/in.svg).claude/skills/pr-prep/check.sh: lint and typecheck pass. Unit tests: 2390 passed, 1 failed (Modal.focus-opener.test.tsx, which also fails alone and touches neither changed file).pnpm buildpasses. The bundle emitsnew URL("/flags/", import.meta.url).hrefunchanged, so there is no host-observable change and CHANGELOG.md is untouched.pnpm sizeran.Notes for reviewer
Split out of #466 so it can merge first. #466 drops the commit when it rebases.
🤖 Generated with Claude Code