Repository navigation
refactor(components): genericize event panel family + card/story cleanup - #27
Merged
Merged
Conversation
Adds @radix-ui/react-checkbox and a CheckIcon. The `switch` appearance is the former Switch verbatim (the default, so existing toggles are visually unchanged); the new `checkbox` appearance (role="checkbox") unblocks the registration mailing-list consent field. Migrates the sole consumer, SearchBar, to <Checkbox appearance="switch"> — pixel-identical. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Modal now accepts an optional `trigger` (rendered via Dialog.Trigger asChild) and makes isOpen/onOpenChange optional, so it works uncontrolled when opened by its trigger while staying backward-compatible with the controlled callers. Adds ModalClose (Dialog.Close asChild) for close-from-inside buttons. This is the single dialog abstraction reused by the share and registration dialogs. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Promotes the private EventDetail row to a generic molecules/DetailRow (icon slot + title + content + optional link) and moves the three detail subcomponents (contact/timing/location) + platform/directions helpers into the EventView folder as private files. EventView now owns the card ordering rule and composes the rows directly; the EventDetails organism is deleted. EventView stays out of the organisms barrel (still lazy-loaded from pages/event.tsx). Rendered output is unchanged. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ImageCarousel takes generic slides ({ src, alt?, caption? }) instead of
event images, and folds the former Lightbox atom in as a private,
React.lazy-loaded module so YARL and its CSS stay in their own chunk
(verified: dist/assets/lightbox-*.js, out of the main bundle). The
images→slides mapping moves up into EventView. Deletes the Lightbox atom
and the EventImages folder (Swiper config + single-slide arrow handling
preserved).
Part of #25
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Renames EventRegistration to a form-only, config-driven RegistrationForm
({ eventId, upcomingDates, questions, isOnline, eventTitle, eventUrl,
onClose? }). EventView now owns the external-vs-native decision, the trigger
Button, and the upcomingDates/enabledQuestions derivation, wrapping the form
in the trigger-based Modal (RegistrationButton deleted). Because Radix
unmounts dialog content on close, the manual reset-on-close is dropped — the
form remounts fresh on reopen.
Adds the opt-in mailing-list consent checkbox (Checkbox appearance="checkbox",
unchecked by default) above the privacy note, a `subscribe` boolean on
RegistrationSchema sent in the register body, and the
registration.mailing_list_consent key across all 10 locales. The widget
sends `subscribe` regardless; SahajCloud records it once sydevs/SahajCloud#524
lands.
Also makes Button forwardRef so Radix asChild (Dialog.Trigger / Dialog.Close)
can attach to it.
Part of #25
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ShareContent Renames EventShare to ShareContent (folder = primary export), keeping the ShareContent block and its private CopyField and deleting the ShareButton trigger + private ShareModal. EventView now renders the share trigger and wraps ShareContent in the trigger-based Modal with the "invite a friend" header — reproducing today's dialog. RegistrationForm's thank-you screen still reuses ShareContent. Barrel drops ShareButton/ShareButtonProps. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Navbar is the only consumer, so both move in as private files (no stories, no atoms-barrel exports). Their absolute @/ imports are unchanged; Navbar imports them locally. Resolves two atoms that carried molecule-level responsibility. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ListItem → RegionCard and EventItem → EventCard (folders, components, and Props types), with all usages updated (pages index/country/region, EventsList). The List, RegionCard, and EventCard stories now group under "Molecules / List" (distinct storyNames keep them from colliding). The RegionListItem data type is unrelated and unchanged. Rendered output is identical. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Panel (Suspense + ErrorBoundary page container) and the Loading/Error fallbacks it composes carried molecule-level responsibility, so both move to the molecules tier together (Panel imports Fallbacks — moving them as a pair avoids an atom→molecule dependency). Updates the atoms/molecules barrels, the six page importers, App.tsx, and Panel's Fallbacks import; story titles move to Molecules. Resolves the tier inversion. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Aligns folder tier with Ladle label: SearchBar → Molecules, Map/MapSearch → Organisms (every story's tier now matches its folder). Exports Select/ SelectItem (+ Props) from the atoms barrel. Refreshes DESIGN_SYSTEM.md (new Checkbox/DetailRow/ImageCarousel/RegionCard/EventCard/RegistrationForm/ EventView entries; Panel/Fallbacks now molecules; ShareContent-only; Modal trigger API in the exception list; Switch/Lightbox/LanguageSelector/ ThemeSwitch removed) and STORYBOOK.md (permit `Tier / Group` nested titles, e.g. Molecules / List). Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ionForm) The code-split NOTE in organisms/index.ts still named EventRegistration, which Phase E renamed to RegistrationForm. Comment-only. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deploying atlas-legacy with
|
| Latest commit: |
941298d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9a824f24.syatlas.pages.dev |
| Branch Preview URL: | https://refactor-genericize-componen.syatlas.pages.dev |
Adds a `highlighted` boolean (tv-driven) that fills the leading icon slot with the brand tint, replacing the caller-smuggled bg styling. EventView's contact-for-timing card now passes `highlighted` (rendered output is unchanged). Expands the story with clear per-variant sections — plain / internal link / external link / highlighted / icon-vs-badge slot + a realistic stack. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adds a States section: a never-resolving lazy child shows the Panel's Suspense LoadingFallback, and a throwing child shows its ErrorBoundary ErrorFallback — so the story actually exercises the fallbacks it describes. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
EventView has no chrome of its own (the app wraps it in a Panel), so the story dropped the misleading `border border-gray-6` and shows it in its base state, only width-limited. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The MapSearch Geocoder now reads the project's brand CSS tokens (neutral ramp, surface, primary accent) instead of a hardcoded rgba border, so the input and its suggestion dropdown follow light/dark mode and the tenant palette. Border matches our form inputs (gray-7); default rounded corners. Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ew slides Per the /simplify altitude pass: DetailRow's leading slot now owns its tint via a `tone` variant (`icon` default / `highlight` / `plain`), replacing the half-done `highlighted` boolean whose icon colour was still smuggled through a load-bearing empty-string ternary at the call site. The three detail callers now pass a bare icon + `tone`; the date badge opts out with `tone="plain"`. Rendered output is unchanged. Also memoizes EventView's `slides` mapping so a stable array threads to the carousel/lightbox across re-renders (the mapping had become eager when it moved up from the old lazy lightbox branch). Part of #25 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
34 tasks
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
A sweeping, phased restructuring that genericizes the event-detail component family and cleans up the card/story taxonomy — with no visual change to any existing surface. The sole intentional new UI is an opt-in mailing-list consent checkbox on the registration form.
ImageCarousel,DetailRow,RegistrationForm,ShareContent,RegionCard,EventCard).Modaltrigger+ModalClose), composed byEventViewfor both the register and share dialogs.DESIGN_SYSTEM.md/STORYBOOK.md.Changes
Phases A–J (self-contained commits):
Switch→Checkboxatom withappearance: 'switch' | 'checkbox'(defaultswitch, so existing toggles are unchanged); adds@radix-ui/react-checkbox+ aCheckIcon.Modal— optionaltrigger(uncontrolled) /isOpen(controlled) +ModalClose;Buttonis nowforwardReffor RadixasChild.EventPanel→EventView; extracted genericmolecules/DetailRow; the detail cards + ordering moved private intoEventView/;EventDetailsdeleted.EventImages→genericImageCarousel(slides); folded theLightboxatom in as aReact.lazymodule — YARL stays in its own chunk (dist/assets/lightbox-*.js, out of the main bundle).EventRegistration→form-onlyRegistrationForm;EventViewowns the external-vs-native decision + trigger; new opt-in consent checkbox +subscribefield (schema + register body) +registration.mailing_list_consentin all 10 locales.ShareButton/ShareModal;EventViewcomposesShareContentin aModal.LanguageSelector+ThemeSwitchintoNavbaras private files.ListItem→RegionCard,EventItem→EventCard; stories grouped underMolecules / List.Panel+Fallbacksup from atoms to molecules.Selectbarrel export, doc refresh.The
RegionListItemdata type is unrelated to theListItemcomponent and is unchanged.Follow-up adjustments
DetailRowgained a first-classtonevariant (icon/highlight/plain) that fully owns the leading-slot tint (the emphasised host-contact card, and the date-badge opt-out) — the callers pass a bare icon; rendered output unchanged. Its story now demonstrates every variant.Panelstory now exercises its real SuspenseLoadingFallback+ ErrorBoundaryErrorFallback.EventViewstory shows the view unadorned (no faux panel border), only width-limited;EventViewmemoizes itsslides.MapSearch) is rethemed to the project's brand CSS tokens, so its input + suggestion dropdown follow light/dark and the tenant palette.Verification
pnpm lint,--max-warnings 0)pnpm typecheck)pnpm test:run) — added asubscribecase toRegistrationSchemapnpm build) — YARL remains a separate lazy chunkpnpm ladle:build) — nestedMolecules / Listtitle buildsReview: two adversarial passes (multi-dimension code-review + security, each finding refuted by skeptics; plus a 4-angle
/simplifypass and a focused code+security re-review of the follow-up adjustments) returned no confirmed correctness/parity/security findings. The only actioned items were a stale-comment fix and theDetailRowtonedeepening above.Manual / visual verification (please confirm)
I ran the gates only (no runtime screenshot pass), and automated checks can't diff pixels:
main(incl. the emphasised contact card when there's no upcoming date).subscribe: true.Notes for reviewer
subscriberegardless; SahajCloud records it only once feat(events): accept mailing-list consent flag on event registration SahajCloud#524 lands (a no-op server-side until then).Selectis barrel-exported per the issue even though onlyRegistrationFormconsumes it (public API surface).DESIGN_SYSTEM.md/STORYBOOK.mdmentions of "NextUI" (leftover from refactor(ui): migrate components from NextUI to Radix UI #24's Radix migration) were left untouched — out of scope here.Closes #25
🤖 Generated with Claude Code