Skip to content

style(class): grey icon-and-label action buttons, a 48px Register, Apple Maps on iOS - #502

Merged
Ardnived merged 10 commits into
mainfrom
ux/class-page-actions
Nov 26, 2026
Merged

Ardnived merged 10 commits into
mainfrom
ux/class-page-actions

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The class page's Directions, Contact and Share used to be thin teal outlined circles. Each is now the grey Button atom, with an 18px icon beside its label. Register moves up to the 48px size.
  • On an iPhone or iPad, Directions opens Apple Maps. In Safari, Google Maps first shows a consent page on a fresh browser.
  • Scope change: the wording stays "Contact" and "Register Now". The new call and register_free keys aren't live in SahajCloud, so rewording is left for later.
  • On the phone map sheet only Register pins to the foot; Directions, Contact and Share stay in the panel instead of riding the pinned bar.
  • Also fixed: the class page's tel: link had spaces, which RFC 3966 doesn't allow. It now shares telHref with the error screen.
  • Added beyond the ticket: when a label won't fit beside its icon, the whole row puts icons above labels instead. Spanish, Portuguese, Russian and Ukrainian labels need 320–336px; the desktop panel row is 302px.

Change outline

Components — the action row

ActionRow and ActionCircle are gone. EventActions now renders Buttons directly, so every action link goes through Button's isSafeHref gate.

 EventView                                              src/views/EventView/EventView.tsx
   sticky footer (phone map sheet)
     EventRegisterBar                                   Button size="lg"
-    EventActions (lazy copy)                           row rode the pinned bar
   EventDetails  ctaInline → registerInline             Register only; the row always renders here
     EventRegisterBar  (when registerInline)
-    EventActions → ActionRow → ActionCircle ×n         own <a>, own isSafeHref, tonal circle
+    EventActions                                       src/components/molecules/EventActions/EventActions.tsx
+    useStackWhenCut(the row's label text) → { ref, stacked }
+    <div ref group/actions data-stacked?>
+      Button variant="flat" ×n                         icon + truncating label span
+        Directions  href=directionsUrl(address, isIOS())  target=_blank
+        Website     href=event.website                     target=_blank
+        Contact     coarse pointer → href=telHref(phone)   else → ContactPopover (number + copy)
+        Share       onClick → navigate(share)

Behaviour — when the row stacks

The row measures its own labels instead of using a width breakpoint, because the space needed varies from 266px (English) to 336px (Portuguese).

 useStackWhenCut(labels)
+  layout effect + ResizeObserver on the row, re-checked when fonts arrive
+    inline and a label span scrollWidth > clientWidth → stacked (icon above label, text-xs, 56px),
+      recording the width the inline row needs
+    stacked and the row is wider than that → inline again (no flip-flop: the width was measured inline)

Behaviour — directionsUrl

src/lib/events.ts stays pure. The iOS answer is the Drawer's existing isIOS(), moved to src/lib/platform.ts (reads navigator.platform).

-directionsUrl(address)                                → google.com/maps/search/?api=1&query=…
+directionsUrl(address, apple)
+  coordinates, else encoded street/city/country text, else undefined
+  apple → https://maps.apple.com/?daddr=…   else → google.com/maps/search/?api=1&query=…

Contract — JSX anchor inventory

 src/lib/shape/href.test.ts  GATED_ANCHORS
   components/atoms/Button/Button.tsx
   components/atoms/Link/Link.tsx
-  components/molecules/ActionRow/ActionRow.tsx

Preview

  • App: preview pending (Workers preview alias not posted yet). Open /gb/south-east/london/balham-library/1392 at 375×667, 1280×800 and 320×568.
  • Component library: preview pending. Molecules › Event Actions; Views › Event; Views › Event · sticky Register (new).

Test results

  • Lean gate: ✓ lint, typecheck, unit lane (2597 passed, 1 skipped)
  • Targeted specs: events.directions.test.ts, href.test.ts (incl. new telHref case, watched failing), Icons.usage.test.tsx, translations.test.ts, responsive.test.ts all pass
  • Build: N/A locally (CI)
  • Browser check (headless Chromium, dev server and Ladle):
    • 375 and 320 (phone): three inline buttons, 44px tall, no label cut.
    • 1280 (desktop): Contact opens the number-and-copy popover.
    • iPhone navigator.platform: Directions opens maps.apple.com.
    • Portuguese labels in the 302px panel: the row stacks, no label cut.

Manual verification

  1. On a real iPhone (pnpm dev --host): Directions opens Apple Maps.
  2. Switch the widget to Spanish or Portuguese on desktop: the row shows icons above labels, with none cut off.
  3. Views › Event: the "Full" and external-registration examples still render, and a closed course still reads "Registration closed".

Notes for reviewer

  • Security review ran (the change touches href.ts, href.test.ts and EventDetails/): no findings. Every action anchor passes Button's isSafeHref and gets rel="noopener noreferrer" on target=_blank. The maps scheme and host are literals; address text is URI-encoded.
  • iPhone detection uses navigator.platform, like the Drawer's Safari workarounds. An iPhone user who prefers Google Maps now gets Apple Maps.
  • The layout fit check needs a browser to verify; the unit lane can't measure layout.
  • Dismissed review findings:
    • A Button-level variant for the height override: it has one caller here, and a recipe-level min-h would hit the same tailwind-merge trap. A follow-up could fold this caller and Fallbacks' callSkin together.
    • A data-table for the four actions: the href/onClick union and the per-action availability checks make it no shorter.
    • A new EventActions spec: Button.test.tsx covers the href gate and rel, and the layout decision needs a browser.
  • Merged origin/main (feat(sheet): a class drags down to its key facts, not the shared open stop #496, feat(class): end the class page address with its postcode, and copy it on tap #498) to clear a CHANGELOG.md conflict; both entries kept. feat(class): end the class page address with its postcode, and copy it on tap #498's notes that Directions opens Google Maps only now say iOS gets Apple Maps.
Detail
  • Three labels side by side need (px): cs 232, de 235, nl 238, en 266, fr 287, hu 291, es 320, ru/uk 328, pt 336. Four stacked labels need at most 284.
  • The ticket proposed a 340px container query, based on the reference build's equal-thirds widths. With buttons sized to their own labels, English fits inline down to a 266px row. The fit check replaces both the breakpoint and the "four actions = stacked" rule. It also fixes a class with no address: the resolver listed Directions but no button rendered, which wrongly stacked the other three.
  • The Directions Navigation arrow no longer mirrors in RTL, like the external-link arrow. src/AGENTS.md now says so.
  • Eager CSS is ~60 B smaller gzipped.

🤖 Generated with Claude Code

Ardnived and others added 5 commits November 26, 2026 09:49
Directions, Contact and Share were thin teal outlined circles with icons
that matched nothing else on the page. Each is now the Button atom itself:
neutral, flat, an 18px Navigation, Phone or Share icon beside its label,
44px tall. Each starts at its own label's width, so "Directions" fits the
352px desktop panel. A fourth action (Website), or a row under 296px, puts
the icon above the label, so no label is cut on a 320px phone.

ActionRow and ActionCircle are gone: EventActions renders Buttons in a
container-query row. Every action link now passes through Button's
isSafeHref gate, so the JSX anchor inventory is Link and Button alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Directions opened Google Maps in Safari, where a fresh browser first stops
at a Google consent page. directionsUrl now returns maps.apple.com/?daddr=
on an iPhone or iPad (an iPad reports itself as a Mac, so touch points tell
them apart), and Google Maps everywhere else, for coordinates and address
text alike. The Apple URL joins the production hrefs isSafeHref must pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Register moves to the Button atom's lg size, so it stays the one obvious
main step on a phone and on desktop. The sticky footer gaps the action row
by 16px, as the inline layout already does, so the row reads as its own set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The row put icons above labels below a 296px row or with four actions, a
rule tuned to English. Three labels need 266px in English but 320-336px in
Spanish, Portuguese, Russian and Ukrainian, so those labels were cut in the
desktop panel and on most phones. The row now measures: icon beside label
while every label fits, icon above label across the row once one would be
cut, latched until the labels change. That also fixes a class with no
address, which listed Directions but drew no button, stacking the other three.

From the /simplify and /code-review passes:
- directionsUrl takes `apple` from the Drawer's existing isIOS() rather
  than a second, user-agent-based iOS check, and is pure again.
- The Directions arrow no longer mirrors in RTL, like the external-link arrow.
- Inert classes go; anchor-count comments no longer name a number.

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
✋ handed back: review-pr did not finish after 3 attempts

recent dispatches
  • 18:28Z review-pr · attempt 3 · session · timed out
  • 18:28Z review-pr · attempt 3 · session
  • 17:42Z review-pr · attempt 2 · session · timed out
  • 17:42Z review-pr · attempt 2 · session
  • 16:55Z review-pr · attempt 1 · session · timed out

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

@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
Ardnived and others added 3 commits November 26, 2026 10:08
RFC 3966 allows no spaces in a tel: URI and some dialers fail on them. The
error screen's contact link already stripped them; both now share telHref,
and the visible label keeps the number as written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the phone map sheet the pinned footer carried Register and the action
row together, so Directions, Contact and Share left the panel. Only Register
pins now; the row stays in the panel after the facts. EventDetails' prop
becomes registerInline, the footer drops its lazy EventActions copy, and a
new Views story shows the pinned-Register case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 1f810cc Nov 26 2026, 06:32 PM

@sydevs-dispatcher sydevs-dispatcher 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 bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 26, 2026
Ardnived and others added 2 commits November 26, 2026 11:30
From the local adversarial review:
- The fit check records the width the inline row needs when a label is cut,
  and goes back inline once the row has it, so one narrow measurement no
  longer stacks the row for good. It keys on the label text itself, and
  re-checks when the fonts arrive, since neither moves the row's own size.
- isIOS moves to src/lib/platform.ts, so a molecule no longer imports a
  Drawer internal.
- DESIGN_SYSTEM's EventActions row and the changelog entry describe the
  measured layout; data-layer.md drops the history sentence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived
Ardnived merged commit 5bbad3c into main Nov 26, 2026
14 checks passed
@Ardnived
Ardnived deleted the ux/class-page-actions branch November 26, 2026 18:55
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Done in SYDevelopers Technical Roadmap Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

The session for review-pr did not finish after 3 attempts. I have stopped retrying. A @sydevs-bot verb or mention from you starts me again.

🤖 sydevs dispatcher

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.

1 participant