Skip to content

refactor(ui): consolidate design-system exports, stories, and props - #15

Merged
Ardnived merged 14 commits into
mainfrom
refactor/design-system-exports
Jun 30, 2026
Merged

Ardnived merged 14 commits into
mainfrom
refactor/design-system-exports

Conversation

@Ardnived

@Ardnived Ardnived commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Standardizes the design system (src/components/{atoms,molecules,organisms}/) on
the cleaner conventions tracked in #14 — explicit named exports, single-level
story titles, and disciplined prop naming — plus inlining single-use internals
and adding a pure-domain-utils home. No runtime behavior change: the diff
touches exports, structure, prop names, and story titles only; no className,
tv() variant, paint/layout, or rendered markup changed (verified below).

Closes #14

What changed

1. Strict export surface. Every export * in the component and tier barrels
is now an explicit export { X } + export type { XProps }. Each public
component exports a named <Name>Props type. Documented multi-export exceptions
(in DESIGN_SYSTEM.md): Icons/ (icon-set module, keeps export *), Dropdown
(compound), Mapbox/ (sub-module), EventsList/ (container + presentational),
EventShare/ (ShareButton + shared ShareContent), Fallbacks/ (pending split).

2. Pure domain utils → src/lib/events.ts. isSoon() (and a new
formatTimeZone() helper) moved out of the EventSoon component so non-UI
consumers (EventsList sorting) use the predicate without importing a component.
Added unit tests (src/lib/events.test.ts).

3. Inlined single-use internals.

  • TimezoneChip → a private composition inside EventTime; Chip is now a pure
    presentational atom (props type renamed ChipProps, NextUI's import aliased to
    NextUIChipProps).
  • ShareModal, RegistrationModal, RegistrationFields, and the EventDetail
    row primitive are now module-private (dropped from barrels + their previews).

4. Consolidated EventDetails. The three detail cards + their shared row
primitive fold into one <EventDetails event={event} /> (one export, one story);
the contact-ordering logic moves next to the cards. Renders byte-identical markup.

5. Prop renames (all call sites updated): ListItem.link→href,
ListHeader/SearchBar.returnLink→backHref, Lightbox.open/close→
isOpen/onClose, EventTimingDetails.convertTimeZone→showTimeZone,
RegistrationModal.isOnline→online. Naming rule documented: state/behavior
booleans use isX, handlers onX, schema-field pass-throughs keep the field
name (online), router links use href/backHref.

6. Flattened story titles. Every story's title is the bare tier
('Atoms'/'Molecules'/'Organisms'); the Ladle sidebar now has exactly three
top-level groups (component name stays in Default.storyName).

7. Docs. DESIGN_SYSTEM.md, STORYBOOK.md, and .claude/rules/components.md
updated for the new export/story/naming conventions.

Follow-on: lint cleanup + zero-warning CI gate

This PR also clears all 14 pre-existing ESLint warnings and hardens the gate so
they can't creep back: pnpm lint now runs --max-warnings 0 (CI + local fail on
any warning), and eslint.config.js allows console.warn/error. The warning
fixes are behavior-preserving: rules-of-hooks are fixed by hoisting hooks above
early returns (same guards), the SearchBar "jump to events" span becomes a
keyboard-accessible <button>, debug console.logs are removed, and Mapbox
prop-ordering / an import blank line are tidied. Docs updated (lint is no longer
"report only").

Decisions (issue left two open)

  • EventDetails → consolidated into one component (the issue's stated preferred
    path; the cards render consecutively so it's safe).
  • ShareContent → kept exported as a shared molecule (it's genuinely multi-use:
    share modal + registration "thank you" screen), per the issue's own "multi-use
    composition → a thin molecule" rule. ShareModal still went private.

Verification

  • pnpm lint (0 errors), pnpm typecheck, pnpm test:run (48 tests),
    pnpm ladle:build, and pnpm build all pass.
  • No visual/bundle regression, by construction: the branch diff changes no
    className/style values (every styling line is either identical markup
    relocated or a prop-name change), and the production build's chunk structure is
    byte-for-byte equivalent to main (same 7 chunks, same sizes; the lazy
    EventPanel family code-split is preserved).

Manual verification still recommended

The acceptance criteria ask for a Playwright spot-check of the event panel,
share/registration modals, and list/search navigation. Automated visual
verification was deferred this session (the Playwright-MCP browser profile was
locked by an external instance); given the diff is DOM/style-preserving, a quick
manual pass in the running widget is the remaining check. The §6 cosmetic
modal/chip/header alignment was reviewed and intentionally not applied, to
keep this PR a strict no-behavior-change refactor — happy to do it as a follow-up.

🤖 Generated with Claude Code

Ardnived and others added 9 commits June 30, 2026 10:50
Move the pure `isSoon` predicate (and a new `formatTimeZone` helper) out of
the EventSoon component into a domain-utils home so non-UI consumers can use
them without importing a component. Repoint EventsList and EventSoonChip to
`@/lib`.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Move the single-use TimezoneChip composition into its only parent (EventTime)
as a private component, leaving Chip a pure presentational atom with no
date/tooltip logic. Chip's props type is now `ChipProps` (NextUI's import is
aliased to `NextUIChipProps`).

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Fold the three detail cards (contact/timing/location) and their shared
EventDetail row primitive into a single `<EventDetails event={event} />`,
keeping the contact-ordering logic next to the cards instead of in EventPanel.
The cards and the row primitive are now private to the module; the timing
card's `convertTimeZone` prop is renamed `showTimeZone` to match EventTime.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ShareModal, RegistrationModal, and RegistrationFields are single-use internals
reached only through their trigger buttons, so drop their exports (and their
dedicated Ladle preview sections). ShareButton/ShareContent and
RegistrationButton stay public; RegistrationModal's isOnline prop is renamed
`online` to match the Event schema field.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Rename props for cross-component consistency and update every call site:
- ListItem `link` → `href`
- ListHeader / SearchBar `returnLink` → `backHref`
- Lightbox `open`/`close` → `isOpen`/`onClose` (mapped to YARL's API internally)

State/behavior booleans use `isX`; handlers use `onX`; pass-through links use
`href`/`backHref`.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace every `export *` in the component and tier barrels with explicit
`export { X }` + `export type { XProps }`, so each folder's public surface is
exactly its primary component(s) and props type. Export the previously-private
`Props` types to back this. Documented multi-export exceptions kept: the Icons
icon-set module (`export *`), the Dropdown compound, the Mapbox sub-module, the
EventsList container/presentational pair, and EventShare's shared ShareContent.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the ad-hoc second-level subcategories (`Atoms / Feedback`,
`Molecules / Display`, …) so every story's title is just its tier. The Ladle
sidebar now shows exactly three top-level groups (Atoms / Molecules /
Organisms); the component name stays in `Default.storyName`.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- DESIGN_SYSTEM.md: rewrite the exports section (explicit named exports, the
  "what not to export" list, the documented multi-export exceptions, atoms stay
  primitive / domain logic → src/lib, inline-single-use); add src/lib to the
  file layout; refresh the classification tables; update props-typing (ChipProps
  + the isX/onX/schema-field naming rule).
- STORYBOOK.md: replace the subcategory map with the single-level title convention.
- components.md: update the structure/export bullets.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Apply the two consistency findings from the /simplify review:
- Export `NavbarProps` (aliased from NextUI's, mirroring the Chip pattern) so
  Navbar matches every other public molecule's `<Name>Props` surface.
- Fix the `formatTimeZone` JSDoc `offset` example (`+01:00` → `+1`) to match the
  luxon `Z` token the code uses (and the test asserts).

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Deploying atlas-legacy with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4118c7f
Status: ✅  Deploy successful!
Preview URL: https://f3bee922.syatlas.pages.dev
Branch Preview URL: https://refactor-design-system-expor.syatlas.pages.dev

View logs

Ardnived and others added 5 commits June 30, 2026 11:45
Address the /review nit: the prop-naming rule said behavior booleans use `isX`,
but the issue-mandated `showTimeZone` (matching EventTime's existing prop) is a
`showX` visibility toggle. Broaden the rule to accept showX/hideX so the doc and
code agree, rather than rename against the issue's spec.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Fix the 14 pre-existing warnings and make `pnpm lint` fail on any warning
(`--max-warnings 0`), so CI and future sessions catch them:

- rules-of-hooks: hoist hooks above early returns in EventSoonChip,
  RegistrationButton, and App's Fathom effect (behavior-preserving — the same
  null-guards / conditions remain).
- jsx-a11y: SearchBar's "jump to events" span is now a <button> (keyboard-accessible).
- no-console: allow console.warn/error in the config (legit error logging in
  Map.tsx) and drop three debug `console.log` onSelect handlers in pages.
- jsx-sort-props: order Map/MapSearch props callbacks-last (each // @ts-ignore
  kept with its prop); import/order: drop a stray blank line in App.tsx.

Docs (CLAUDE.md, code-style.md) updated: lint is no longer "report only".

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…nents

- EventMetadata: drop its story (head-only, renders no visible UI); document
  the no-story exception.
- EventSoon: the "Not Soon" story used a near-future fixed date (4 days out →
  actually within the 1-week window); switch to a now-relative date a month out.
- EventTime: the "Time Zone" story flattened two inline-fragment components into
  one flex column; wrap each in a block so they read as separate lines.
- EventTime: re-implement the timezone tooltip on @floating-ui/react (matching
  the Dropdown atom) — portaled (no clipping by the panel's overflow),
  viewport-aware (flip/shift), with an inline-flex <button> trigger so it never
  stretches the time line and stays keyboard-accessible.
- ListHeader: move it into List/ as a contained sub-component (List now exports
  List + ListHeader), reduce the oversized 30px title to text-lg, and merge its
  story into the List story.
- EventItem/ListItem: give the row a dark-mode hover (dark:hover:bg-default-100)
  so it no longer washes out on dark surfaces; swap the timing text's fixed
  text-gray-500 for the theme-adaptive text-default-500.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- EventDetails: the timing card built its title from `timing.type` (a free-form
  category, e.g. "recurring"), which has no `recurrence.*` locale key — so it
  rendered the raw key `recurrence.recurring`. Use `timing.recurrenceType` (the
  typed enum that matches the locale keys), consistent with EventItem.
- EventTime: give the tooltip a light, theme-adaptive surface
  (border + bg-content1 + text-foreground) instead of the dark bg-foreground bubble.
- ListItem: add a little spacing (mt-0.5) between the title and subtitle.

Refs #14

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Ardnived
Ardnived merged commit 1887965 into main Jun 30, 2026
3 checks passed
@Ardnived
Ardnived deleted the refactor/design-system-exports branch June 30, 2026 13:38
Ardnived added a commit that referenced this pull request Nov 10, 2026
…374)

* fix(map): draw an area, not a pin, for a listing with no real place

Twelve in-person listings give only a town (bug #15 of the 6 Nov sweep),
so their stored point is the town's centre and the map pinned it as a
venue — Sneek's on a supermarket, with a Directions button to it.

`hasApproximatePlace` decides it: an inactive listing (it meets only on
request), or a street that names no place — a placeholder, the town's
own name, or a "city centre" word (`hasVagueAddress`). Such a listing
draws a 1.5km area instead of a pin, frames its neighbourhood, shows
only the town, and offers no directions. Inactive listings already hid
the street and directions on their page; the map now agrees.

A lone "-" is not a placeholder: its one listing is a park whose point
is the park. SahajCloud's Atlas importer rewrites the six word-shaped
placeholders to the town's own name (sydevs/SahajCloud
fix/atlas-town-only-venues), so after the final sync the word list is
only a fallback.

The area drawing ports 7fa03d1.

Co-authored-by: antontcymbal <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(changelog): a class with no real venue shows an area, not a pin

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(map): draw the approximate dot outside clustering

The dot stands in for the 1.5km circle once that shrinks to nothing on screen,
which is zoomed out — and zoomed out is exactly where the `events` source
clusters (`clusterMaxZoom` 14). Filtering it on `!has point_count` there meant it
only ever drew at the zooms the circle was already large at, so framing a vague
class in a dense city left a ring with a cluster bubble over its centre.

Move the dot to `approximate-areas`, which does not cluster, and carry each
class's centre point in that source beside its polygon. `fill` and `line` ignore
a point, and the dot filters on `geometry-type`, so one source serves all three.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* fix(shape): fold accents in the town-repeat test

`hasVagueAddress` compared street against town with `toLowerCase` + `startsWith`
while `streetAndCity`, twenty lines below, compares them with `localeCompare` at
`sensitivity: 'base'`. So street "Silvianopolis" in "Silvianópolis" read as a
real place on the map while the address line already showed the town alone.

Fold the accents off both sides instead of switching to `localeCompare`: that
compares whole strings, and the placeholder match needs a position to slice the
town off. The word list is folded on the way in for the same reason.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* refactor(shape): type the vague-address shape from EventAddress

The street-and-city shape was written out by hand in three places here, while
`EventAddress` — generated from the feed schema, already imported in this file —
declares both fields nullish exactly as written.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* docs(mapbox): word the importer rewrite as pending, not shipped

Both the rule and the `hasVagueAddress` docblock described SahajCloud's
placeholder-street rewrite in the present tense, but `VENUE_FIELD_OVERRIDES` on
its `main` sets no street — the change lives on an unmerged branch. Someone
opening either file today would look for a mechanism that is not there, and
would read the word list as already redundant when every entry still guards a
live listing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* refactor(map): one interactive layer id array, not two

`CLASS_LAYER_IDS` was `INTERACTIVE_LAYER_IDS` minus the cluster, and both call
sites already hold the cluster: the click handler tests it in the branch above,
so a bare `else` is the rest, and the hover tracker needs only "not the cluster".
A second array that must be edited whenever the first is is a sync hazard, and
`layers.test.ts` pins the surviving one as the contract with both handlers.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* fix(shape): one reading of inactive for the map and the panel

`hasApproximatePlace` tested `inactive || !schedule`; the panel tested
`display.status === 'inactive'`, which `resolveEventDisplay` also returns for a
class whose occurrences have all passed. So such a class read town-only in the
panel — street and directions hidden — and still got a pin on the map, the
disagreement this feature set out to remove.

`hasApproximatePlace` now covers a dateless class too, through a shared
`eventKind`, so a course that is merely over keeps its pin and street. The panel
reads that one predicate rather than its own second copy.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUxkXJ7kcbkEb5Y8dS

* docs(mapbox): the importer rewrite has shipped, and waits on the next Atlas sync

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(map): a vague listing is a pin until its ring is worth drawing

Review feedback: rings showed at world zoom beside the cluster that also
counted them. Both the pin and the ring now read the clustering `events`
source, so a listing with no real place joins a cluster like any other,
and is an ordinary pin until the zoom where its ring's radius is as wide
as the pin (RING_ZOOM, about 9). From there it is a 3km ring, up from
1.5km, drawn to scale as a circle layer. The selection and hover
highlights hand over at the same zoom, and a framed vague listing lands
at zoom 11 so the larger ring fits.

The separate unclustered area source and `areaAround` are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(map): bound the vague ring above, handing over to a dot

The ring's radius doubles per zoom level with nothing stopping it: 111px at
zoom 11, 444px at 13, 888px at 14. Past about zoom 11.7 its outline is off
every screen, so an unselected listing was a flat 14% tint with no marker in
it — where `main` gave it a pin — and that tint answered every click and
hover across the map, with neighbours stacking theirs.

`RING_MAX_ZOOM` is where the ring is as wide as the narrowest map the full
interface renders in, so the three layers hand over at one zoom each and
exactly one of them draws at any zoom. The dot is a fixed size, in the ring's
own colours at a fraction of its weight, and is clickable like the pin and
the ring before it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVJXtttnitsB4QgSKS

* refactor(map): one meaning for approximate, one for vague

`approximate` named two different things. On `MapPoint` it is online-or-vague,
picking the softer selection sprite. On the map's own feature property it was
`hasApproximatePlace`, which excludes online — and `eventFrameZoom`'s option of
that name meant online alone, so one call read `online: isOnline(event)` beside
`point.approximate` and the reader had to tell three senses apart.

The feature property, the three layers and their ids now say `vague`, matching
`MapPoint.vague`, which already meant exactly this. `eventFrameZoom` takes
`online`, agreeing with the `onlineZoom` beside it. `MapPoint.approximate` keeps
its name as the union, and its comment now says so.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVJXtttnitsB4QgSKS

---------

Co-authored-by: antontcymbal <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ui): consolidate design-system exports, stories, and props

1 participant