Repository navigation
refactor(components): remove the unused Spacer and Box atoms and dead exports - #318
sydevs-bot wants to merge 17 commits into
Conversation
Neither has ever had a production consumer: both came in with the 2025-10-31 atom scaffold, and their only importers were their own stories and the atoms barrel. Nothing SahajCloud sends could drive either. Its ten page blocks include no spacing block and no generic box, the legacy whitespace blocks were dropped at import, and the two "box" blocks it does have already render through the text-box organisms and HeroQuote. Spacer also built its height class at runtime, which the Tailwind scanner cannot see. The docs that listed them now list what is left. STORYBOOK.md's reference examples cited both stories as patterns to copy, so each row now names a story that still shows the pattern: Badge for a two-axis grid with separate sections, Spinner for heavy subsection use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
…rops FormBuilder is FormField's only caller, and it passes neither. Nor could it: SahajCloud's form fields (text, email, textarea, select, checkbox, number, country, state, message) carry no help text and no alignment, so no authored form can supply one. The props survived only in the story and in the tests that pinned their aria-describedby wiring. The error keeps that wiring, and a control that names its own description still keeps it beside the error's id. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The Image atom read `useLightbox` and `LightboxSlide` out of `molecules/Lightbox/LightboxProvider`, so an atom depended on a molecule and the provider could not change without reaching under the atom. The slide shape, the context and its hook move to `atoms/Image/lightbox-context.ts`; the provider imports them from there and keeps everything it owns (the slide registry and the overlay). Behaviour is unchanged: the Image tests pass as they were, and a gallery image in the RichText story still opens the overlay on click and closes on Escape. `useLightbox` and `LightboxSlide` leave the molecules barrel for the atoms one; nothing imported them from either. tests/guards/atomic-imports.test.ts makes the direction a failing test for every level (atom < molecule < organism < template), reading static imports, re-exports and import() from the source. It failed on this import and on nothing else in the tree or on any open branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The unlinked mark renders a `<div>`, so it filtered the anchor-only props out of a `props as any` destructure whose bindings were never read (seven no-unused-vars warnings). The cast also hid two leaks: `media` was not in the list and reached the div, and so did the caller's anchor-typed `ref`. `splitAnchorProps` now returns the anchor-only attributes and the rest, typed as `HTMLAttributes<HTMLElement>`, which both a `<div>` and the `Link` atom accept. The link takes both halves; the div takes only the shared one. Logo.attributes.test.tsx pins which attributes reach which element; its unlinked case fails on the old code over `media`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Nothing reads it, on main or on any open branch: `isLocale` and `KNOWN_LOCALES` are what every caller uses, and a locale list a page needs comes from the site config's `availableLocales`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`types/vike.d.ts` sent readers to `env.ts` for the environment schemas, but that file was removed in #15 because nothing used it. `.env.example` is where each variable is documented now. `lib/live-preview/frame-editor.ts` named `./messages.ts` as the home of the unsaved-edit stream, and `document.tsx` described its endpoint check as replacing a filter that "used to live" there. That module is gone; the stream is `./document.tsx`, and its endpoint check is the one filter, which is what the comment now says. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
… guard
Removing FormField's description prop left six opening tags that now fit on
one line, so prettier flagged each; they are collapsed, and the story adds
no warning that main's copy lacks.
The atomic-import guard now also reads `import('...')` type references
(`type X = import('../x').Y`, `typeof import(...)`), which a type-only
upward dependency could otherwise use to pass it; the self-check samples
both. Its docblock states the rule instead of the history.
Logo's anchor-only split documents that the unlinked mark takes no ref:
the ref is typed for an anchor and no caller passes one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The reviewer wants both props kept: they are likely to be used soon, so the removal would cost a re-add rather than save maintenance. FormField.tsx, its test and its story go back to main's version verbatim, so the description renders again, an error still hides it, and `aria-describedby` names both ids when both are present. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV33z27Pf9dyhHh9rr
|
Adopted — keep Merged Nothing rebutted, nothing asked. Lean gate on the merged branch: lint 0 errors, Title and body refreshed: the FormField removal is gone from the Summary and from What changed and why, and now sits under Not in this PR. The #313 conflict drops to 4 files, because 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 2099bc0 | Commit Preview URL Branch Preview URL |
Nov 22 2026, 10:14 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 2099bc0 | Commit Preview URL Branch Preview URL |
Nov 22 2026, 10:14 PM |
#313 and #283 both landed on main and both touched this branch's files. - `Box.tsx`, `Spacer.tsx` (modify/delete): main's change to each was prettier reformatting only, so the deletion stands. - `Logo.tsx`: kept main's `inline` variant and its formatting, and kept this branch's typed `splitAnchorProps`. The `as any` destructure main guarded with an `eslint-disable` is gone, because the typed split is what makes the disable unnecessary. - `types/vike.d.ts`: kept main's move of `ImportMetaEnv` inside `declare global`, and re-applied this branch's `@see` fix to the comment that moved with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXF1P3KeuL9FKNxXts
|
Merged
#313 also made any lint warning fail the gate, so the body's "1068 warnings" no longer passes. Re-ran the lean gate on the merge: 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`LogoProps` extended `ComponentProps<'a'>`, so the atom had to filter the anchor-only half out of the unlinked `<div>`. No call site passes any of it — Header twice, MobileMenu and ContentCard pass only `align`, `className`, `href`, `onClick`, `size` and `variant` — so the narrower `HTMLAttributes<HTMLElement>` spreads into either branch untouched, and the split, its type and the test that covered it all go. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZJNLiJcegsqwE57Fn
The PR dropped `useLightbox` and `LightboxSlide` from the molecules barrel as unused, then re-added them to the atoms barrel and the `Image` barrel. Every consumer reaches `lightbox-context` by path instead, so both barrel lines go, and `LightboxContextValue` loses an `export` no module outside its own file ever read. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZJNLiJcegsqwE57Fn
The hook wrapped `use(LightboxContext)` for a single call site. `Image` reads the context directly now, and the module is back to the contract itself: the slide type, the context value and the context. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZJNLiJcegsqwE57Fn
The new atomic-imports guard exported a `specifiers` nothing imported, and walked the same `moduleSpecifier` nodes `ladle-watch-paths` already walked. `_source-scan` owns that walk now and reports `typeOnly` with each specifier, which is the only thing the second copy added; its spelling self-check moves beside it, into `_source-scan.test.ts`. A dynamic `import()` now counts as a value import for the WATCH list, where the hand-rolled walk missed it. No `server/` module is reached that way today, so the list is unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZJNLiJcegsqwE57Fn
|
All four critic findings adopted, one commit each.
Nothing rebutted. Lean gate: lint clean, Body refreshed. #313 and #283 are in main, so the merge-order plan and the warning count are gone, and #327 now conflicts here. One question, in the body. Five deferred dead props are unblocked, but each is the shape you asked us to keep on 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#327 reorganised the tree by topic and moved every cross-folder import onto the `@/` alias, which touched all seven files this branch edits. - `Box.stories.tsx`, `Spacer.stories.tsx` (modify/delete): main only re-pointed their imports, so the deletion stands. - `Image.tsx`, `Lightbox.tsx`, `Lightbox.stories.tsx`: main's `@/` paths, with this branch's `lightbox-context` as the source of `LightboxSlide` and `LightboxContext`. `LightboxProvider.tsx` merged clean but kept a `../../atoms` path, which the new lint rule rejects; it reads `@/` now. - `Logo.tsx`: main's `inline` variant, this branch's `HTMLAttributes` props. - `types/sahajcloud.ts`: took main's side. The locale and translation blocks this branch edited moved to `lib/i18n/locales.ts` and `lib/i18n/web-translations.ts`, so the unused `LOCALES` export is removed at its new home instead. - `docs/STORYBOOK.md`: this branch's Badge and Spinner rows, at main's path for the file's move under `docs/`. `tests/guards/atomic-imports.test.ts` read relative specifiers only. Every cross-level import is spelled `@/` now, and lint forbids `../` outside a folder, so the guard had nothing left to see. It resolves both spellings through a `resolveModule` shared with `ladle-watch-paths.test.ts`, which already had its own copy. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVqxmDisHDFCXAMVyL
|
Merged
Lean gate green: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
This branch dropped `LOCALES` because nothing read it. #328 then landed `lib/i18n/a11y/a11y.test.ts` on main, which reads it to assert that every locale SahajCloud defines has a screen-reader file. Neither side conflicts textually, so the merge queue was the first run to typecheck the two together and it failed there with TS2305 while the PR's own checks stayed green. The export is one line derived from `KNOWN_LOCALES`, so it costs nothing to keep and the a11y gate needs it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZbEMkVnKuP6aRKfam
sydevs-bot pushed a commit after this approval, and the approval did not cover it. Review the new commits, then approve again.
Summary
Visitors and editors see no change. For developers:
SpacerandBoxatoms are gone from the code, the barrels, the Ladle playground and the docs.Imageatom no longer imports from a molecule. A new guard test fails any component that imports from a higher atomic level.Logono longer needsas any: its props narrow to what the call sites actually pass, so it has no anchor-only attribute to keep out of its<div>.Preview
Nothing visible should change. These are the places to confirm that:
atoms--spacerandatoms--boxare gone; main's playground still lists both.LogoPropsis an element's attributes rather than an anchor's.What changed and why
F13, Spacer and Box. Deleted both atoms (component, index and story), their lines in
components/atoms/index.ts, and their mentions in DESIGN_SYSTEM.md,components/atoms/README.mdand STORYBOOK.md. Nothing uses either one on main or on any open branch. STORYBOOK.md listed both as "Reference examples" to copy, so those two rows now name Badge (a shape × colour grid with Sizes and Examples sections) and Spinner (7 subsections). The Layout order row now readsLayout (Container) | Sizes -> Examples. Ladle's meta.json no longer listsatoms--spaceroratoms--box. Radio, MasonryGrid, SplashLoader, LocationSearch, TriangleDecorationSvg, SocialShare, DiscoverMeditation, TechniqueCard and Countdown are untouched.F15e, Image imported a molecule.
LightboxSlide,LightboxContextValueandLightboxContextmoved frommolecules/Lightbox/LightboxProvider.tsxto a newcomponents/atoms/Image/lightbox-context.ts. NowImage.tsximports from its own folder, andLightboxProviderand the Lightbox story import down from the atom. Behaviour is unchanged. The task left the location open ("atoms or lib"). I chose the atom overlib/because the Image atom defines what a slide is (buildLightboxSlide), so the dependency points down with no third location. The module holds onlycreateContextand two types, never the browser-only lightbox package, so it is safe to server-render.useLightboxmoved with them and is now gone altogether: it wrappeduse(LightboxContext)for one call site, andImage.tsxreads the context itself. Nothing is re-exported from a barrel, because every consumer importslightbox-contextby path;LightboxContextValueis not exported at all.tests/guards/atomic-imports.test.ts: no file undercomponents/<level>may import, re-export,import(), or reference as animport('…')type anything from a higher level (atoms < molecules < organisms < templates). On main it fails with exactlycomponents/atoms/Image/Image.tsx: ../../molecules/Lightbox/LightboxProvider, and it passes here. A second check fails if the guard finds no files. Stories and tests are excluded.tests/guards/_source-scan.ts, beside theparse/walk/readSourceplumbing it uses, and reportstypeOnlyper specifier soladle-watch-paths.test.tsdrops its own copy of the same walk. Its spelling self-check moved there too, into_source-scan.test.ts. A dynamicimport()now counts as a value import for the WATCH list, where the hand-rolled walk missed it; noserver/module is reached that way today, so the list is unchanged.organisms--rich-text): clicking a gallery image opens the overlay with 3 slides, Escape closes it, and the console shows no errors.Logo.tsx,
props as any.LogoPropsextendedComponentProps<'a'>, which is what forced the cast: the atom renders a<div>without anhref, and an anchor's attributes do not belong on one. The cast is gone because the surface is.LogoPropsnow extendsOmit<HTMLAttributes<HTMLElement>, 'children'>, whichLinkand a<div>both accept, so{...props}spreads into either branch with nothing to filter.Nothing passed the anchor half. The four call sites —
Header.tsx:145,Header.tsx:204,MobileMenu.tsx:141andContentCard.tsx:185— and the story pass onlyalign,className,href,onClick,sizeandvariant. A caller that later wantstargetorrelon the linked mark adds it toLogoPropsthen, against a real need.F15i,
LOCALES. No longer removed. The export was dead when this branch dropped it, andrefactor(i18n): screen-reader strings live in the repo, machine-translated #328 then gave it a reader on main:
lib/i18n/a11y/a11y.test.tsasserts thatevery locale SahajCloud defines has a screen-reader file. Neither side conflicts textually, so the
merge queue was the first run to typecheck the two together, and it failed there (TS2305) while
this PR's own checks stayed green.
lib/i18n/locales.tsmatches main again.F15i, stale pointers.
types/vike.d.ts: "@see env.ts", a file removed in commit 1cc6c43, now points at.env.example.lib/live-preview/frame-editor.tsanddocument.tsxpointed at the deleted./messages.ts. They now name./document.tsx, which carries the unsaved-edit stream. I re-checked every other file pointer inlib/live-previewagainst main after feat(preview): stream unsaved lecture edits into the preview panel #290 merged, and each one resolves.Not in this PR
Dead props whose blocking PR has now merged — a question for the reviewer
Each prop below was deferred because an open PR edited its file. Five of those PRs have merged
(#301, #304, #283,
#303, #298), so the merge-order blocker is gone. They are
still not removed here, because the only instruction on this PR points the other way: "keep
descriptionandalign, these are very likely to be used in the future"(thread). Every prop
left is that same shape, and three now have a story or a test exercising them:
FormBuildervariant,alignContentOverlayvariantContentOverlay.stories.tsx— thehighContrastandboxsectionsHeaderbreadcrumbsHeader.stories.tsx×2SubtleSystemdefaultViewSubtleSystemonNodeSelectSubtleSystem.keyboard.test.tsx— it asserts the callback's argumentMusicLibraryonFilterChangeA — leave all six, and close the dead-prop sweep here. This PR merges as reviewed. The props
stay as documented surface with no production caller, consistent with the
FormFielddecision.Recommended, because it is the call the reviewer already made on this PR for an identical prop.
B — remove them. Four story sections and the
SubtleSystemkeyboard test go or change withthem, so the removal is a design decision about each component's surface rather than a mechanical
sweep. It wants its own PR, after the
FormFieldquestion is settled as policy.Still blocked by an open PR, either way:
AccordionallowMultiple/defaultOpenItems/onToggle: fix(components): popovers are disclosures or dialogs, and a closed Accordion panel is hidden #302.ContentGridcardVariant/breakpointCols: feat(components): a MeditationLibrary for the meditations index block #293 and the layout bundle,which removes react-masonry-css.
Also left alone
FormField'sdescriptionandalign: the reviewer asked to keep both, so this branch restores main'sFormField, its test and its story unchanged (thread).Authorhero variant: it has a caller, added by feat(preview): stream unsaved lecture edits into the preview panel #290.pages/[slug]/+route.ts: feat(server): switch wemeditate.com over to the new site #288 rewrites it.lib/content-blocks.tslines 310-330: they no longer hold a dead branch, and several open PRs edit that file.No translation keys are needed.
Reconciled with open PRs
mainnow, and merged into thisbranch at
1c3e88f. Both touched this branch's files, and the resolutions are recorded inthis comment: main's
prettier reformatting of
Box.tsxandSpacer.tsxdid not save either atom from deletion,Logo.tsxkept main'sinlinevariant beside this branch's typed props, andtypes/vike.d.tskept main's move of
ImportMetaEnvwith this branch's@seefix re-applied. No merge order isleft to suggest.
tests/guards/atomic-imports.test.ts.specifiersfromtests/guards/_source-scan.tsrather than writing its own walk.LightboxSlide, it must editcomponents/atoms/Image/lightbox-context.ts.git merge-treeagainst every other open PR branch: one conflicts in a file this PR touches.refactor: reorganise folders by topic, import through @/, and keep server/ server-only #327 (
claude/reorg-layout) movesDESIGN_SYSTEM.mdandSTORYBOOK.mdunder
docs/and reworks the Lightbox, so it conflicts onImage.tsx,Logo.tsx,Lightbox.tsx,Lightbox.stories.tsx, and modify/delete on theBoxandSpacerstories.Whichever merges second: keep
BoxandSpacerdeleted, keep this branch'sLogoPropsand thelightbox-contextimport path, and take refactor: reorganise folders by topic, import through @/, and keep server/ server-only #327's file locations.feat(components): layout blocks open on their default tab, keep every item and link, and card grids stop reflowing #317 conflicts too, in no file this PR touches.
Test results
mainis merged in at19e8e9b..claude/skills/pr-prep/check.shon the result:pnpm lint: clean. fix(ci): any lint warning fails the gate, and the repo is formatted to pass it #313 made any warning fail the gate, so there is nowarning count to report any more.
tsc --noEmit: clean.pnpm buildwas not run: no dependency, CSS, bundling or CI changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw