Repository navigation
feat(stories): the whole widget, interactive, on fixtures alone - #481
Conversation
Ladle sorts groups alphabetically. A story order lists Atoms, Molecules, Organisms, Views, then Interactive, with any later group below them and each group still alphabetical inside. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ladle booted i18n from the English snapshot alone, so every aria-label from `config/a11y/` read as its raw key in a story and to the accessibility gate. It now boots from the app's own resources. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`Interactive / Full Widget` renders the real App on a stand-in host page, in a 640px box: browse, open a class and register, search, filter. - Ladle talks to no API: `.ladle/backend.ts` answers every SahajCloud read from the browser lane's fixtures, through the app's real fetchers, and the IP lookup with Cambridge. A view's idle prefetch no longer reaches production either. - Ladle points the app's SahajCloud origin at its own and serves the Turnstile challenge there, from the page the lane already used, now shared in `src/mocks/challenge-page.ts`. - The widget story reads a bigger atlas on top (`sahajcloud-demo.ts`: 28 countries, the UK's 12 regions, classes enough that every list scrolls). `sahajcloud.test.ts` reads it through the real fetchers too. The browser lane still reads `sahajcloud.ts` alone. - In Ladle, react-map-gl never reuses a map, the canvas follows its own box, and mapbox-gl accepts a container inside the viewport iframe. A canvas carried between that iframe and the page had lost its WebGL context, and the map drew only its controls. - Each story starts its router at `/`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
All three commits serve the one story: the Interactive tier needs the sidebar order, the a11y strings keep the gate honest on it, and the backend is what lets it render. Nothing is smuggled, and nothing a host can observe moves.
Four bespoke mechanisms plus a 533-line second atlas, for one story — so I checked the lighter answers: no msw in the tree, Ladle ships no network layer, and neither mapbox-gl 3.35.0 nor react-map-gl 8.1.3 observes its container, so FollowBox is forced. The one aggregate alternative, turning Ladle's width addon off, retires both halves of react-map-gl.tsx and costs the view stories their frame. Keep the frame.
Findings
- should-fix
.ladle/react-map-gl.tsx:32— this docblock andMap.tsx:509claim opposite things. - should-fix Streamline
sahajcloud-demo.ts:532,sahajcloud-demo.ts:362,App.stories.tsx:14— three threads below. - should-fix The body understates its reach: the outline lists 12 of 21 files, and "touches only Ladle, the mocks, and the lane's challenge page" omits four
src/files and three docs. - consider
config/a11y/a11y.ts:15still mountsEN_A11Y"into the boot resource (config/i18n.ts)". This PR moved that toi18n-options.ts.
What was checked
Read whole: six .ladle/ files, four src/mocks/ files, App.stories.tsx, i18n.ts, i18n-options.ts, a11y.ts, tests/browser/fixtures.ts, Map.tsx. mapbox-gl and react-map-gl read in node_modules for ResizeObserver/trackResize. Streamliner: 47 pieces walked, 43 kept, 3 of 4 posted — I dropped one that would tie a deterministic fixture to ICU data. Ladder walked the seven files the script skipped. .claude/workflow.json has no fixture block; the story id resolves and every path the body names is in git ls-tree. No new dependency, no contract surface.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The padding comment claimed react-map-gl resizes its own container. Neither mapbox-gl 3.35.0 nor react-map-gl 8.1.3 observes a container: mapbox-gl has only `_onWindowResize` behind `trackResize`, which is why `.ladle/react-map-gl.tsx` carries a ResizeObserver at all. The two docblocks said opposite things. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbNg9Ukdx3R1vhdT2
`answerDemo` wrapped `answerSahajCloud(request, demo)` for a single caller, and the two exported types existed for that wrapper's signature alone. `.ladle/backend.ts` now calls the router itself and lazy-imports `demo`, so the atlas is still built on the first read and nothing earlier. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbNg9Ukdx3R1vhdT2
`taken` held exactly the slugs `nodes` already held — both seeded from `regionNodes`, every push paired with an add — so it was a second binding to keep in step for an invariant one array can answer. At ~200 nodes the Set buys nothing over the `find` above it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbNg9Ukdx3R1vhdT2
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | ea09767 | Nov 25 2026, 05:37 PM |
`HostPage` had one caller in the same file and no second in sight, so the stand-in page is now the story's own return. The two reasons its docblock carried — raw markup on purpose, and the host's `h1` above the widget's `h2` — sit beside the markup they explain. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbNg9Ukdx3R1vhdT2
`bootResources` moved to `config/i18n-options.ts` in this branch, so both notes naming `config/i18n.ts` as where the English strings mount were false. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbNg9Ukdx3R1vhdT2
|
Every thread adopted,
From the review body:
Lean gate, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
- The inline column takes #476's header: Back names where it goes, above the view's own controls. `NavHeader` passes `isPlace` through, so a region's title still gives way to the page heading inline. - "Close map" renders beside the cog now that the peek strips are gone, and reads the sheet's live top from a wrapper the sheet-top loop also writes. - The inline embed reads #481's fixture names (`sahajcloud.ts`, `sahajcloud-demo.ts`); the branch's own copies of the Ladle backend and the demo atlas give way to main's. - The deep-link scenarios assert #476's climb past one-class places, inline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Takes the loop's #481 merge and its glyph-tint expression. Its 78d0d76 dropped the cog's hide on the claim that both drawers cover the column whole. They do on the desktop calendar, but at a 390x844 phone's near-full stop the sheet's top sits at 25px and the column's at 16px, so find-me and the credits showed 9px slivers above it (measured). The owner chose one switch that hides the whole column there (`useMapControls`), which also serves the inline view's toolbar later, so this side of those hunks is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Ladle groundwork split out of #466, so it can merge first:
Interactive / Full Widgetrenders the realAppon a stand-in host page, in a 640px box. You can browse, open a class and register, search and filter..ladle/backend.tsanswers every SahajCloud read from the browser lane's fixtures, through the app's real fetchers. Onmain, a view story's idle prefetch reached production. Ladle also serves the Turnstile challenge on its own origin, using the page the lane already framed, now shared assrc/mocks/challenge-page.ts.src/mocks/sahajcloud-demo.ts: 28 countries, the UK's 12 regions, and enough classes that every list scrolls.sahajcloud.test.tsreads it through the real fetchers. The browser lane still readssahajcloud.tsalone..ladle/react-map-gl.tsx:aria-labelfromconfig/a11y/read as its raw key, both in stories and to the accessibility gate.Change outline
Flow — what answers a story's SahajCloud read
installBackendpatches the globalfetch, the one the app's SDK calls, so a story's reads still go through the real fetchers and their zod parses.Files — one set of fixtures, read by both the lane and the playground
Files — the playground's own wiring
Preview
Design playground:
interactive--full-widget(Interactive › Full Widget). Thesahajatlas-designbuild succeeds, but no branch alias has been published for it yet, so preview pending.Test results
.claude/skills/pr-prep/check.sh), re-run after the review commits: lint and typecheck pass, and 2412 unit tests pass across 191 files.pnpm test:browser: 10 passed. The lane now frames the shared challenge page.pnpm ladle:buildpasses and emitsapi/atlas/challenge.html.interactive--full-widgetis clean.views--regionandviews--registrationare clean.organisms--mapboxshows its two known map-control findings (STORYBOOK.md).interactive--full-widgethas one finding: the collapsed sheet's "Show more" answers at 89×32px on a phone. That is the contained map's own sheet, whichmainalready has. No story rendered it before. feat(widget): open every embed inline; expand the map over the page #466 replaces this form with the inline embed.Notes for reviewer
No host can observe this change, and nothing it adds ships in the app bundle. The app-code edits are five exports plus
bootResourcesmoving fromconfig/i18n.tstoconfig/i18n-options.ts— all behaviour-preserving — soCHANGELOG.mdanddocs/embedding.mdstay untouched.Four docs carry it:
STORYBOOK.md,docs/testing.md,docs/environment.md(the playground's triggers needVITE_MAPBOX_ACCESSTOKENtoo), anddocs/rules/i18n-and-state.md.#466 drops these commits when it rebases. Its version of the story then renders the inline form and adds the White background control.
Every thread of the adversarial review is adopted and resolved; nothing was rebutted. The run's comment carries each one and its commit.
🤖 Generated with Claude Code