Skip to content

fix(event): one meaning of "inactive", "Today" once, and no Full chip - #500

Merged
Ardnived merged 16 commits into
mainfrom
fix/inactive-type-and-today-tags
Nov 26, 2026
Merged

Ardnived merged 16 commits into
mainfrom
fix/inactive-type-and-today-tags

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Every listing that reads "Contact host for timings" carries no type tag. Stirling (1505) no longer shows "One-off event".
  • "Today" shows once: in a class page's when line, or as the chip on a card that leads with its pattern.
  • The "Full" chip is gone. A full class says so in its register slot.
  • Joined, agreed in session on 26 Nov:
    • An all-null schedule group now parses as no schedule, which ends the 1970 dates.
    • "Inactive" has one meaning, decided by isInactive.
    • Each surface's chips and lines are decided once, in surfaceView.

Change outline

Types — the schedule at the parse boundary

SahajCloud sends an inactive listing a schedule group whose fields are all null. z.coerce.date() turned that into a 1970 schedule, so !schedule never fired for live data.

 src/types/event.ts
+  OptionalScheduleSchema = preprocess(group with no firstDate → null, EventScheduleSchema.nullish())
 AgnosticFeedEventSchema.schedule, EventDocSchema.schedule
-  EventScheduleSchema.nullish()
+  OptionalScheduleSchema
 PreviewEventSchema.schedule                              src/lib/live-preview/submission.ts
-  EventScheduleSchema.nullish().catch(null)
+  OptionalScheduleSchema.catch(null)

Flow — one meaning of "inactive"

Before this PR there were four meanings: the flag, the resolver's status, the map's clock-free copy, and the type-label rule. Now there is one verdict, and every reader goes through it.

 src/lib/shape/event.ts
+  sessionsOf(schedule, now) / nextSession(...)           # upcomingDates, else the pending first session
+  isInactive(event, now) = flag || !schedule || (class && no session left)
 resolveEventDisplay(event)
-  dormant = flag || !schedule → 'inactive'; class with no next → 'inactive'
+  isInactive → 'inactive'; anything else with no next → 'ended'
-  EventDisplay.dormant
 hasApproximatePlace(event, now)                          # the map's area, the town-only where line
-  flag || !schedule || (class && !upcomingDates[0]) || vague    # clock-free copy
+  isInactive(event, now) || vague
 useEventDisplay → typeLabel
-  null when display.dormant
+  null when status === 'inactive'

Behaviour — what each surface shows, decided once

EventFacts, EventChips and the map-pin popover each used to re-derive pieces of this from status, full and their own variant. Now one pure function decides it, and the components only render.

 src/hooks/use-event-display.ts
+  type EventSurface = 'page' | 'card' | 'summary'
+  surfaceView(parts, surface) → { when: { primary, time, detail }, type, today }
+    primary: the pattern if recurring, else the when line (time only while a session is ahead)
+    time:    card → start time; page, summary → range
+    today:   card && pattern && status today && !full     # a full class gets no chip
+    detail:  started → course ? when line : none
+             card && (running || today chip) → none       # "Today" once
+             else → when line
+    type:    card && plain weekly → none; else typeLabel (null when inactive)
+  useEventDisplay(event).surfaces = { page, card, summary }
-  typeLabel, isDefaultType, recurrenceLine, whenLine, eventStartTime, eventTimeRange
-  calendarLineParts, composeCalendarLine
 EventFacts({ surface })        renders surfaces[surface].when              # was variant default/compact/card
 EventChips({ surface })        renders type, languages, today              # was variant default/compact; no Full chip
 EventPinCard                   renders surfaces.card.when
Surface Before After
Class page, meeting today TODAY chip + when line when line
Recurring card, today TODAY chip + faded line TODAY chip
Full recurring card, today FULL chip + faded line faded line
Full class, any day FULL chip no chip; the register slot says it
One-off card, today TODAY chip + lead line lead line
Class with no session left WEEKLY CLASS + "Contact host for timings" "Contact host for timings"
All-null schedule, unflagged "This event has ended", 1970 JSON-LD "Contact host for timings", no dates

Preview

  • Stirling, at 390×844: only ENGLISH under the title, then "Contact host for timings". Main also shows ONE-OFF EVENT.
  • Component library: preview pending. Open:
    • Views › Search: "Evening Meditation" shows TODAY with no faded "Today"; "Fully Booked Evening Meditation" shows no chip and keeps its faded "Today"; "Inactive Venue Programme" has no type tag.
    • Molecules › Event Chips: the "Page" and "Card" sections, with TODAY only under Card.
    • Molecules › Event Facts: the "Card" and "Summary" sections.
    • Views › Event, Example "Today": "Today" once, in the time line.

Test results

  • Lean gate: ✓ lint, typecheck, unit (2592 passed, 1 skipped)
  • Targeted specs:
    • surfaceView covers every surface rule.
    • isInactive is checked against the resolver status.
    • The all-null group is checked at both schema sites.
    • "Today" appears once across five card and page combinations.
    • Each was watched failing against a broken rule.
  • Build: N/A (CI)

Manual verification

  1. Open Stirling at 390×844 on the app preview: ENGLISH only. In devtools, its JSON-LD has no startDate and says EventPostponed.
  2. On a Friday, /gb/south-east/london/1817 (Mayfair Library, weekly on Fridays) shows the card and page rules on live data.
  3. Check one full class on its page: no chip, and the register slot says "This event is full".

Notes for reviewer

  • The type rule changed since review. It now follows the status, so a class with no session left loses its tag too. Devindra agreed on 26 Nov, replacing the 12 Nov flag-only ruling. That retired display.dormant, which the loop had added.
  • chip_full is retiring. It joins RETIRING_KEYS under chore(translations): drop the retired event.display.chip_starts, chip_ended and chip_full atlas keys SahajCloud#1283. That issue lists chip_starts and chip_ended, and needs chip_full added.
  • The map's area now reads the clock. hasApproximatePlace used upcomingDates[0] without a clock. It now shares nextSession, so the map and the panel agree. The one change: a class with no precomputed dates whose first session is still ahead draws at its door, not as an area.
  • Not ported: f3be230's Online tag. Main's list card has no Online tag for it to match.
  • Dismissed review finding: "one exported predicate for the hook, the resolver and the map" is now done, as isInactive.

🤖 Generated with Claude Code

Ardnived and others added 5 commits November 25, 2026 18:37
… recurring card

An inactive listing such as Stirling was tagged "One-off event". SahajCloud
sends it an all-null schedule group, so the no-schedule rule (#370) missed it
and its kind derived as one-off. The `inactive` flag now decides alone, so a
real one-off an admin flags inactive loses its type tag too.

A class meeting today said "Today" twice on its page: as a tag, and in the
when line right under it. The Today chip now shows only on a list card that
leads with the recurrence pattern ("Every Wednesday").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comments now carry only the why, and the docblocks that listed EventChips'
chips point at the component instead, so the rule lives in one place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A flagged listing with a stored weekly schedule had no type label, yet
`isDefaultType` still called it the plain weekly class. Nothing reads one
without the other today, but the pair now agree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A card for a recurring class meeting today still printed a muted "Today"
under its pattern, beside the Today chip. The card now drops that line
wherever the chip shows. A full class's chip says "Full", so its line keeps
"Today". This is the line the proposal branches carry (e353663), plus the
full-class exception.

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

sydevs-dispatcher Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
conflict held since 16:45Z, waiting for the base to settle

recent dispatches
  • 03:51Z address-review · attempt 1 · session · done
  • 03:51Z address-review · attempt 1 · session
  • 03:43Z review-pr · attempt 1 · session · done
  • 03:43Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design f56acf0 Nov 26 2026, 05:17 PM

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

Both rules are right, and each is one condition. Nine of the fourteen files are one-line comment or doc edits. The new EventFacts.test.tsx case renders both components together and counts the string — the right way to pin a rule spanning two of them.

What it leaves behind sits in one file. The diff grows use-event-display.ts, and that file now carries a verbatim copy of the resolver's own gate, a conjunct that cannot change an output, and a dead statusChip still returning "Today" under the rule this PR narrows. No contract surface moves, so the CHANGELOG's "no parameter, origin, CSP, storage or Permissions-Policy change" holds.

Findings

  • should-fix use-event-display.ts:147 — duplicates the resolver's event.inactive || !schedule gate (lib/shape/event.ts:396).
  • should-fix use-event-display.ts:170 — the typeLabel !== null conjunct is a no-op; its one consumer already gates on it.
  • should-fix use-event-display.ts:175 — statusChip is unread and still holds the old "Today" rule.
  • should-fix EventChips.stories.tsx:52 — an internal condition in a Ladle description.

What was checked

Read whole on the branch: use-event-display.ts, EventChips.tsx, EventFacts.tsx, EventListItem.tsx, lib/shape/event.ts, mocks/events.ts. new-pieces.mjs answered NONE, so no streamliner ran. Traced every surface that can say "Today": both EventChips call sites, EventFacts' three variants, and Map.tsx's popover through calendarLineParts. Each says it once, and the popover is unchanged. Repo-wide greps for isDefaultType, statusChip and chip_today. No consumer side to follow: the diff touches no generated type, atlas-url-contract.json or docs/embedding.md. mockEventToday is DAILY, so the Event Chips story claim holds.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/hooks/use-event-display.ts Resolved
Comment thread src/hooks/use-event-display.ts Resolved
Comment thread src/hooks/use-event-display.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
`useEventDisplay` carried a verbatim copy of `resolveEventDisplay`'s own
`event.inactive || !schedule` gate, so one rule sat in two modules. The copies
would have drifted silently the moment either half moved.

`EventDisplay.dormant` reports which terminal branch the resolver took, so the
hook reads `display` rather than the raw event, as its docblock promises. The
status cannot answer this: it also covers an unflagged class with no session
left, and that listing keeps its type.

No behaviour change. The new spec in `event.test.ts` separates the two
`inactive` statuses, and was watched failing with `dormant` widened to the
dateless branch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUq2Bv6ajH5MZwtWVK
The `typeLabel !== null` conjunct could not change an output. Its one consumer,
`EventChips`, already reads `typeLabel !== null && (!compact || !isDefaultType)`,
so the label check ran either way — and the name went on claiming a shape while
testing a label.

The paired assertion in `use-event-display.test.ts` goes with it: it pinned the
conjunct, not a rendered difference.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUq2Bv6ajH5MZwtWVK
Ladle renders this docblock as the description a designer reads, and "only
beside a recurrence pattern" is the component's internal condition. The samples
already show the rule: Today carries a chip under Compact and none under
Default. The why stays in EventChips.tsx, beside the condition it explains.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUq2Bv6ajH5MZwtWVK
Nothing in `src/` read `statusChip`: `EventChips` derives `full` and `today`
itself, and only two comments still named it. Its `status === 'today'` branch
returned "Today" unconditionally, so wiring it up later would have restored the
duplicate "Today" this branch removes.

`chip_starts` and `chip_ended` lose their last call site with it, so both go to
`RETIRING_KEYS` until sydevs/SahajCloud#1283 drops them from
`sy-atlas-translations`. `chip_full` and `started_on` keep theirs.

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

Copy link
Copy Markdown
Contributor

Four findings, all adopted. origin/main merged in clean, two contract-sync commits.

No behaviour change. Lean gate green, 2547 passed. ## Change outline refreshed — it showed the two reverted lines.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 26, 2026
Ardnived and others added 3 commits November 26, 2026 09:52
…-today-tags

# Conflicts:
#	CHANGELOG.md
#	src/components/molecules/EventFacts/EventFacts.test.tsx
SahajCloud sends an inactive listing a schedule group whose fields are all
null, and z.coerce.date() read its null firstDate as 1970-01-01. The listing
then had a schedule: `!schedule` never fired, the "once" cadence filter
matched it, and its JSON-LD and og:event:start_time read 1970.

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

- `isInactive` (lib/shape/event.ts) is the one verdict: the SahajCloud flag,
  no schedule, or a class with no session left. The resolver's `inactive`
  status, `hasApproximatePlace` (the map's area) and the missing type tag all
  read it. `display.dormant` and the map's clock-free copy go, so a class
  with no session left now loses its type tag too (agreed 26 Nov).
- `surfaceView` (hooks/use-event-display.ts) decides what the page, a card
  and the summary show: the lead line, its time and faded detail, the type
  chip, and the one availability chip. EventFacts, EventChips and the map-pin
  popover only render it, so "Today once" lives in one function.
  `calendarLineParts`, `composeCalendarLine`, `typeLabel`, `isDefaultType`
  and the raw time strings leave the hook's public shape.
- One surface name for both components: 'page' | 'card' | 'summary',
  replacing EventFacts' default/compact/card and EventChips' default/compact.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived and others added 3 commits November 26, 2026 10:07
A full class says so where you would sign up ("This event is full"), so the
card and the class page drop the chip. A full class meeting today still gets
no Today chip, since its session cannot be joined; its faded line keeps
"Today". `event.display.chip_full` loses its last call site and joins
RETIRING_KEYS under sydevs/SahajCloud#1283.

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

# Conflicts:
#	CHANGELOG.md
#	src/components/molecules/EventFacts/EventFacts.test.tsx
#	src/components/molecules/EventFacts/EventFacts.tsx
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@Ardnived Ardnived changed the title fix(event): no type tag on an inactive listing, and "Today" once on every surface fix(event): one meaning of "inactive", "Today" once, and no Full chip Nov 26, 2026
@Ardnived
Ardnived added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 7927eeb Nov 26, 2026
14 checks passed
@Ardnived
Ardnived deleted the fix/inactive-type-and-today-tags branch November 26, 2026 17:42
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 26, 2026
Ardnived added a commit to sydevs/SahajCloud that referenced this pull request Nov 26, 2026
…_ended and chip_full atlas keys (#1284)

The widget renders none of them since sydevs/SahajAtlasWeb#500: the unused
statusChip string was the only call site for the first two, and the Full chip,
now gone, for the third. Translators were still asked to fill all three.

Removes them from the schema, the ten seed files and the generated types, and
adds a data migration sweeping the stored copy out of event_display on the main
and every version row, since the group declares additionalProperties: false
and a leftover would refuse every later save. down restores nothing: the old
schema declares the keys but requires none. chip_today's and started_on's
descriptions stop calling themselves status chips where none is left, and the
strict-budget specs pin chip_today in chip_full's place.

Closes #1283

Co-authored-by: Claude Opus 5.5 <[email protected]>
Ardnived added a commit that referenced this pull request Nov 27, 2026
Brings in #500–#530. Resolutions:
- CompactEmbedView stays deleted; its #529 label change and changelog line are moot.
- DrawerStack keeps the inline arm (`canCollapse` reads `sheeted`) on main's dismiss,
  showResults, sheetTall and dimmed scrim, beside "Close map".
- LocatorProvider wraps MapProviders, so the inline map and its filters share one
  locator, and the expanded map gets its own.
- Registration, Share and the form take `form-column` over main's new markup.
- The panel stays 384px; the EventActions story previews 336px and 272px.
- Translations take main's production snapshot; the two keys #466 wires leave PENDING_KEYS.
- The story harness gains `expanded`, so the sticky-Register story shows the sheet.
- embed.spec picks the expanded dialog first: the panel inside now reads the same name.

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

Development

Successfully merging this pull request may close these issues.

3 participants