Skip to content

fix(event): show the venue's room in the class view #316

Closed

Description

@Ardnived

Summary

The room a manager types on a class (address.room) is fetched and typed by the widget but rendered nowhere, so a class held in a hall's community room reads as if it were at the street address alone. Reported on sahajayoga.ca in #2.

Three changes, judged together — the second and third are the snapshot step this ticket's own copy criterion runs:

  • Render the room on the event view.
  • Fix pnpm sync:translations, which cannot reach production as written.
  • Let the regenerated snapshot stay green while the CMS holds copy ahead of its call site.

Goal context

Part of #255 — the atlas is ready for launch. Its "classes look right" check compares a class against the old atlas, so the launch needs the room shown.

Interfaces

Consumes event.address.room from SahajCloud — already selected by the feed and parsed here, so no contract change — plus one translation key, event.display.room, which production now serves as Room: %{room} (clients read, 2026-10-28).

Approach

The field is live, and SahajCloud already expects it shown. room is declared at src/fields/addressFields.ts:121 in SahajCloud: optional text, maxLength: 100, placeholder "Which room do seekers go to? (optional)". It is deliberately distinct from venueName — :18 there says room "says where inside the building to go." SahajCloud's own atlas SEO endpoint publishes it both ways: as AtlasSeoAddress.room (src/endpoints/responseTypes.ts:51) and inside the schema.org streetAddress (src/endpoints/atlas/seo/seoDocument.ts:332). Here it is selected at src/config/api/fetch.ts:86 and parsed at src/types/event.ts:32, and those two lines are the only mention of it in src/ — nothing renders it.

1. Derive the line in the one formatting layer. useEventDisplay (src/hooks/use-event-display.ts) builds every event string, and whereLine (:245) is the only place the address is composed. Add roomLine: string | null beside it — t('event.display.room', { room }) — null unless all three hold:

  • the event is physical (display.online is false). An online class has no venue.
  • display.status !== 'inactive'. That branch shows only the municipality and never the street (:247), because a dormant venue's door no longer opens; its room is the same wrong answer.
  • event.address.room is a non-empty string.

ended needs no case: EventFacts already drops the whole location fact for it (src/components/molecules/EventFacts/EventFacts.tsx:150).

2. Render it above the address, on the event view only. The location fact is { icon: MapPin, text: whereLine, subtext: distance } (EventFacts.tsx:150). Give its text two stacked lines when roomLine is present and variant === 'default' — the room first, the address below — so the room is a separate line inside one location block rather than folded into the street. Fact.text is already ReactNode (:70), so no prop is added and no second icon is introduced.

⚠ stacked keys off Boolean(subtext) (:170), and that is what hangs the icon beside the first line instead of centring it. It has to account for the room line too, or the pin centres across both lines.

Leave the other surfaces alone, and say so in the PR: compact (the list card) and card (the share and registration summaries) are triage and recap, not directions. The map-pin popover reads calendarLineParts only (src/components/organisms/Mapbox/Map.tsx:143). The calendar .ics LOCATION is the whereLine that RegistrationView passes through (src/views/RegistrationView/RegistrationView.tsx:92), so it stays as it is.

3. The copy is live. The snapshot step is what is left. pnpm sync:translations --write reads production, always (scripts/sync-translations.mjs:22), and never hand-edit src/config/translations.en.json. A clients read on 2026-10-28 returns event.display.room = Room: %{room}, 38 keys under event.display, so sydevs/SahajCloud#1025 is done and nothing blocks the t() call.

What regenerating the snapshot actually carries is three keys, not one (measured 2026-10-28, production against main's snapshot: 199 leaves to 196, nothing changed, nothing removed):

key its one call site
event.display.room this ticket
common.map.location_failed #321, in flight
registration.form.subscribe #147, unbuilt

src/config/translations.test.ts asserts both directions — every key a call site asks for resolves in the snapshot (:199), and every key the snapshot holds is quoted somewhere in src/ (:229). So --write alone turns pnpm test:run red. Measured: with the regenerated snapshot in place, that spec fails with dead: ['common.map.location_failed', 'event.display.room', 'registration.form.subscribe']. The first clears itself here (part 1 adds the call site). The other two do not, and part 5 is what answers them.

4. Fix pnpm sync:translations first — it cannot reach production as written. The fetch at scripts/sync-translations.mjs:105 sends ?locale=en&depth=0 and no select, and SahajCloud refuses an API-client read that omits one with a 400 naming the parameter (src/plugins/usage/hooks.ts:286 there). Re-confirmed 2026-10-28: that URL answers 400, so the snapshot step cannot run at all on main today. docs/rules/data-layer.md already states the rule this read breaks.

Build the select from WIDGET_TABS (:60) — the list the script already owns, and that src/config/translations.test.ts:170 pins against WIDGET_TRANSLATION_TABS — as one select[<tab>]=true per tab. Keep WIDGET_TABS a plain array literal; that spec reads it with a regex. Verified against production 2026-10-28: the query answers 200 with exactly those ten tabs plus id, which DROP (:29) already strips, and event.title still arrives for the explicit delete at :116. At depth: 0 no populate is owed.

⚠ This identical fix is Approach part 3 of #321, which is in flight. Read scripts/sync-translations.mjs on main before writing it: if the select is already there, drop this part and say so in the PR summary. Do not re-open it to add the same lines twice.

5. Let the snapshot hold a key whose call site has not landed. This is the gap the three-key drift exposes, and it is not this ticket's accident: a t() call cannot land before the copy is live, because direction one fails on a key the snapshot lacks — which is why sydevs/SahajCloud#1025 and sydevs/SahajCloud#1031 shipped copy ahead of their call sites on purpose. "Published, not yet wired" is therefore a state this process requires, the snapshot is global, and direction two has no way to say it. It works only while exactly one such key exists and the next PR wires it; three tickets publishing at once broke that.

So name them in the spec, beside the assertion they are exempt from:

  • A PENDING_KEYS map, key to the ticket that wires it. Derive it by running the lane after --write and taking the dead list: today that is registration.form.subscribe → feat(widget): submit or correct a class, and opt into a mailing list #147, plus common.map.location_failed → fix(map): say why Find my location did nothing when it is blocked #321 if that ticket has not merged by then.
  • Direction two excludes those keys, and only those. An unreferenced key nobody listed still fails, with the same message.
  • One new assertion in the other direction, so an entry cannot go stale: every pending key must be in the snapshot and unreferenced. A consumer landing its t() call then fails the lane until its entry is deleted, which is how the list empties itself.

Nothing is hand-removed from the snapshot. It stays a faithful copy of what production serves, which is the one rule scripts/sync-translations.mjs:1 opens with.

Tests. src/hooks/use-event-display.test.ts covers the derivation and its three null cases. Placement — present on the event view, absent on the list card — needs a new EventFacts.test.tsx; there is none today. Follow src/components/molecules/EventListItem/EventListItem.test.tsx, which renders node-only through renderToStaticMarkup with the i18n and locale hooks mocked, rather than opting into jsdom.

Acceptance criteria

  • A physical class with a room shows it on the event view, on its own line above the street address, not folded into it.
  • That line carries context from event.display.room, so it cannot read as a second street line.
  • A class with no room, an online class, and an inactive listing each show no extra line.
  • The list card, the calendar entry and the map-pin popover render exactly as they do today.
  • The downloaded .ics LOCATION is unchanged.
  • src/config/translations.en.json is regenerated by pnpm sync:translations --write, never hand-edited, and no key is removed from it by hand.
  • pnpm sync:translations reaches production and reports drift or a match, instead of failing with a 400.
  • The script's select is derived from WIDGET_TABS, so adding a tab cannot leave the two lists disagreeing.
  • Every key in the regenerated snapshot that no call site asks for is named in src/config/translations.test.ts with the ticket that will wire it.
  • An unreferenced key that is not named there still fails the lane, and a named key that becomes referenced fails it too.

Verification checklist

  • pnpm test:run passes, with an assertion that goes red when roomLine is dropped from the location fact and stays green for the online and inactive cases.
  • ATLAS_API_KEY=<production client key> node scripts/sync-translations.mjs exits 0 and names drift or a match. On main today it exits 1 with answered 400.
  • … node scripts/sync-translations.mjs --write, then pnpm test:run src/config/translations.test.ts. Watch it fail on the three dead keys before part 5 lands, so the exemption is proven rather than assumed, then green after.
  • .claude/skills/pr-prep/check.sh is green.
  • On the preview, open a class whose venue has a Room set in SahajCloud: the room reads above the address on the event view, and nowhere on that class's list card. Open one with no room: no empty line.

Notes

Replaces #2. The approach in #172 — joining the room into whereLine as street, room, city, which reached the list card, the registration view and the .ics at once — was closed by the reviewer as "not the right solution". Do not revive it.

Parts 4 and 5 ride here rather than in their own tickets: they are the steps this ticket's own snapshot criterion runs, so the three are judged together. #321 regenerates the same snapshot and needs both as well — whichever PR lands first carries them, and the second drops its part after reading main.

The regenerated snapshot will carry common.map.location_failed with two trailing newlines, which production serves and the seed does not. sydevs/SahajCloud#1042 fixes the production value. It is cosmetic and does not block this.

The old atlas cannot be read from any repository in this workspace: sydevs/SahajAtlasWordpress is an embed wrapper and renders no class detail (the string "room" appears once there, in an unrelated comment). So the earlier criterion "reads the same way the old atlas showed it" is replaced by the explicit placement above.

Widening to the card variant, so the share and registration summaries carry the room too, is a one-line change on top of this. It is deliberately out of scope.

Activity

  1. added theissue type on Oct 21, 2026
  2. moved this from Revising to Proposed in SYDevelopers Technical Roadmapon Oct 21, 2026
  3. Ardnived commented on Oct 23, 2026

    @Ardnived
    ContributorAuthor

    @sydevs-bot revise this ticket and detail a technical implementation approach. We need to verify that this field is still available in the Payload CMS and expected to be rendered, and then determine how it should be rendered. Perhaps as a separate like above the address, but only on the event view (not the list view). Likely it also needs to be prefixed with "Room: " or giving some other context so the user knows what it is.

  4. moved this from Proposed to Revising in SYDevelopers Technical Roadmapon Oct 23, 2026
  5. added
    bot:working
    on Oct 23, 2026
  6. sydevs-bot commented on Oct 23, 2026

    @sydevs-bot
    Contributor

    🤖 no session running

    recent dispatches
    • 05:26Z revise · attempt 1 · session · done
    • 05:26Z revise · attempt 1 · session
    • 02:11Z revise · attempt 1 · session · done
    • 02:11Z revise · attempt 1 · session
    • 19:51Z revise · attempt 1 · session · done

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

  7. sydevs-bot commented on Oct 23, 2026

    @sydevs-bot
    Contributor

    Rewritten from the code. Three answers.

    The field is live, and SahajCloud expects it shown. room is declared at src/fields/addressFields.ts:121 there — optional text, capped at 100, deliberately distinct from venueName. Its own atlas SEO endpoint already publishes it.

    Where it goes. A second line above the street address, inside the same location block and pin icon, on the event view only. The list card, calendar entry, map popover and .ics stay as they are. useEventDisplay gains roomLine, null for online, inactive and roomless classes.

    The prefix is what blocks it. Translations are CMS-owned, and src/config/translations.test.ts fails a t() for a key production does not serve. Filed sydevs/SahajCloud#1018 for event.display.room — proposed Room: %{room} — and added a Blocked by: line here.

    Dropped the "same as the old atlas" criterion: sydevs/SahajAtlasWordpress is an embed wrapper and renders no class detail, so nothing here can check it.

    @sydevs-bot implement starts this once sydevs/SahajCloud#1018 ships.

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


    Generated by Claude Code

  8. 10 remaining items

  9. cleared
    Hold Until
    on Oct 27, 2026
  10. sydevs-bot commented on Oct 27, 2026

    @sydevs-bot
    Contributor

    Still blocked — on the ticket now, not a date.

    What I checked. A clients read of production's sy-atlas-translations?locale=en today returns the same 37 event.display keys and no room. sydevs/SahajCloud#1025 is what delivers it, and it is open with its own question 1 unanswered: seed run, or manager entry.

    Why no new date. Nothing here turns on a date — the key arrives when someone publishes the copy. Two guessed dates have expired, so the park becomes Blocked by: sydevs/SahajCloud#1025, which clears itself when that ticket closes. Hold Until is cleared.

    One fact for that decision. common.map.location_failed shipped on 2026-10-26 as sydevs/SahajCloud#1033, with an English seed value, and is absent from production's common.map too. A second key now waits on the same unrun step.

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


    Generated by Claude Code

  11. removed
    bot:working
    on Oct 27, 2026
  12. Ardnived commented on Oct 28, 2026

    @Ardnived
    ContributorAuthor

    @sydevs-bot revise event.display.room is now in production's sy-atlas-translations global (added and published 2026-10-28), and its blocker sydevs/SahajCloud#1025 is closed. Refresh the body to match.

  13. moved this from Blocked to Awaiting in SYDevelopers Technical Roadmapon Oct 28, 2026
  14. sydevs-bot commented on Oct 28, 2026

    @sydevs-bot
    Contributor

    #1025 closed, so nothing blocks this now. Say @sydevs-bot implement to start it, or @sydevs-bot revise to rework it first.

    🤖 sydevs dispatcher

  15. added
    bot:working
    on Oct 28, 2026
  16. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Oct 28, 2026
  17. sydevs-bot commented on Oct 28, 2026

    @sydevs-bot
    Contributor

    Refreshed from the code. event.display.room is live.

    Verified. A clients read of production today returns Room: %{room}, and 38 keys under event.display. sydevs/SahajCloud#1025 is closed, so nothing blocks the t() call.

    What the refresh turned up. Regenerating the snapshot carries three keys, not one: this ticket's, plus common.map.location_failed (#321) and registration.form.subscribe (#147). Measured: --write alone turns pnpm test:run red, naming all three. The copy has to be published before a t() call can land, so the snapshot cannot be hand-trimmed — Approach part 5 names pending keys in the spec, each with the ticket that wires it.

    One overlap. Part 4's select fix is the same change as #321's part 3. Whichever PR lands first carries it; the other reads main and drops its part.

    Filed sydevs/SahajCloud#1042: production serves location_failed with two trailing newlines the seed does not have.

    @sydevs-bot implement starts this.

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


    Generated by Claude Code

  18. removed
    bot:working
    on Oct 28, 2026
  19. moved this from Working to Awaiting in SYDevelopers Technical Roadmapon Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    High

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions