Skip to content

feat(class): end the class page address with its postcode, and copy it on tap - #498

Merged
Ardnived merged 14 commits into
mainfrom
feat/class-page-postcode
Nov 26, 2026
Merged

Ardnived merged 14 commits into
mainfrom
feat/class-page-postcode

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The class page address ends with its postcode ("120 Heath St, London NW3 1DR"). A UK host's visitors went to the wrong part of town.
  • A tap on that address copies street, town and postcode, and shows "Copied" for 2s. Directions,
    beside it, opens Google Maps from the stored point, so the clipboard is the only route to any
    other maps app — Apple Maps is the iOS default.
  • CopyField and the address share one useCopy hook. "Copied" moves to common.chrome.copied (SahajCloud#1281).

Change outline

Behaviour — the where line

The hook decides once whether a street shows. The postcode is added as entered, with no duplicate check: a house number can read the same as a postcode, so coordinators fix a real repeat by eye.

 useEventDisplay(event)                                     src/hooks/use-event-display.ts
   townOnly = hasApproximatePlace(event)
   whereLine = online ? "Online • Hosted from …" : townOnly ? town : streetAndCity(street, city)
+  showsStreet = !online && !townOnly
+  whereLineWithPostCode = showsStreet ? "whereLine postCode" (blank code → whereLine) : null
-  roomLine = !online && !townOnly && room ? "Room: …" : null
+  roomLine = showsStreet && room ? "Room: …" : null

Components — EventFacts

Only the default (class page) variant uses the full line, as a copy button. Compact and card keep whereLine.

 EventFacts                                                 src/components/molecules/EventFacts/EventFacts.tsx
   location fact
     room line (panel only)
-    whereLine
+    panel && whereLineWithPostCode ? <CopyAddress value={whereLineWithPostCode}/> : whereLine
+CopyAddress                                                # module-private
+  useCopy(2000)
+  <button data-vaul-no-drag aria-label="Copy address: …">
+    address + copy icon            # kept laid out (invisible) while copied, so nothing moves
+    copied → "✓ Copied" overlaid
+  </button>
+  <span aria-live="polite">Copied</span>
+  copy refused or no clipboard → selectAllChildren(the button), to copy by hand

 CopyField                                                  src/components/molecules/ShareContent/ShareContent.tsx
-  navigator.clipboard.writeText + useState + setTimeout
+  useCopy(1500)                    # src/hooks/use-copy.ts: never throws, timer cleared on unmount
+  data-vaul-no-drag

Contract — strings and Permissions-Policy

 src/config/a11y/<18 locales>.json
+  event.copy_address  "Copy address"          # spoken only, machine-translated
 src/config/translations.en.json             # mirrors SahajCloud#1281
+  common.chrome.copied  "Copied"
-  share.copied          "Copied"
 docs/embedding.md § Permissions Policy, clipboard-write
-  The copy-link button on the share sheet
+  … the contact popover's copy button, and tapping a class's address; denied → the address is selected instead

Preview

Branch preview — it follows this PR across pushes.

Test results

  • Lean gate (.claude/skills/pr-prep/check.sh, lint + typecheck + test:run): ✓
  • New specs: hook (5: appended, as typed even when the street seems to hold it, blank, online null, inactive null), EventFacts markup (6), jsdom copy flow (3: copy + restart on second tap, refused, missing).
  • Chromium against the local dev server: copy puts "16 Ramsden Rd, London SW12 8QY" on the clipboard, and the line keeps its height. With the clipboard refused, the address is selected. The Share summary keeps "16 Ramsden Rd, London", and Copy link still copies.

Manual verification

  1. On a phone (Safari), tap the address on a class page, then paste it into Maps.
  2. On a host that denies clipboard-write, tap the address: it should be selected. Only Chromium was available here, so WebKit and Firefox are untested.

Notes for reviewer

Detail

Review findings dismissed (/code-review medium):

  • Region-name fallback gets a postcode. Unreachable: an empty street is a vague address, so townOnly holds and whereLineWithPostCode is null.
  • Selection lost after the await. The Selection API needs no user activation. Checked in Chromium inside the shadow root.
  • CopyField gives no feedback on refusal. Unchanged from before; its select-all already selects the value on click.
  • Word-boundary postcode matching. Moot: the duplicate check was removed.

Taken from /simplify:

  • whereLineWithPostCode is nullable, so EventFacts no longer re-derives the gate.
  • useCopy holds one state.
  • data-vaul-no-drag added on both buttons.
  • The address keeps its height while "Copied" shows.

Skipped from /simplify:

  • One shared duration. It would move CopyField from 1.5s to 2s, and the ticket says Copy link behaves as before.

Security review: no trigger path. The one content match was a test teardown (innerHTML = ''), now replaceChildren().

Payload (measured by the efficiency review): +58 B gz eager. EventFacts, useCopy and the copy icon load lazily.

🤖 Generated with Claude Code

Ardnived and others added 8 commits November 25, 2026 18:44
…t on tap

The class page's address adds the postcode after the town ("120 Heath St, London NW3 1DR"),
unless the street or town already holds it, and never for an online class or a listing that
hides its street. List cards and the share and sign-up summaries keep the short line.

On the class page a tap on the street address copies street, town and postcode. For two
seconds the line reads "Copied", announced to screen readers; where the clipboard is blocked
the address is selected to copy by hand. CopyField and the address share one useCopy hook.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SahajCloud#1281 replaces share.copied with one generic common.chrome.copied, shown after
copying a link, a phone number or an address. Both call sites read it. The English snapshot
gains the key, and loses share.copied, at the next `pnpm sync:translations --write` once
#1281 is deployed; until then the snapshot spec fails on both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The postcode rule is a pure `withPostCode` beside `streetAndCity`, table-tested, and also
  ignores punctuation ("NW3-1DR").
- `whereLineFull` is null where no street shows, decided once in the hook (`showsStreet`, which
  the room line reads too), so EventFacts no longer re-derives it.
- `useCopy` holds one state; the address stays laid out under "Copied", so a wrapped line keeps
  its height and a refused copy can still select it.
- Both copy buttons carry `data-vaul-no-drag`, so a tap on the phone sheet is not read as a drag.

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

SahajCloud#1281 adds common.chrome.copied ("Copied", its schema default) and retires
share.copied. A full `pnpm sync:translations --write` fails on main until #466 (compact.open),
so the key is copied in by hand, as #490 did. Merge this after #1281 is deployed.

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

recent dispatches
  • 02:45Z address-review · attempt 1 · session · done
  • 02:45Z address-review · attempt 1 · session
  • 02:34Z review-pr · attempt 1 · session · done
  • 02:34Z review-pr · attempt 1 · session

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

@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

Ticketless, so judged against its own body. The postcode half is right-sized: one pure helper beside streetAndCity, one nullable field, and a panel-only gate that keeps list cards and the share summary short. The cross-repo contract holds — SahajCloud#1281 puts the string at common.chrome.copied, the snapshot mirrors it, and the hand-edit is justified while #466 blocks a full sync.

The tap-to-copy half is the question. It renders only on pages where the Directions action already works, so it buys a manual paste where a link exists — and it is what pulls in the hook, the component, 18 a11y files and a third clipboard-write entry in the host contract. Nothing in it is wrong. The case for its existence is not in the body.

Findings

  • should-fix — the copy button only renders where Directions already works (EventFacts.tsx:165)
  • should-fix — Streamline: the ref and inner span only aim the selection (EventFacts.tsx:226)
  • consider — whereLineFull names neither the value nor the gate it carries (use-event-display.ts:52)

What was checked

Read whole on the branch: EventFacts.tsx, ShareContent.tsx, use-event-display.ts, EventActions.tsx, lib/events.ts and lib/shape/event.ts.

  • The dismissed region-name fallback is unreachable: NO_PLACE_STREETS holds '', so a blank street is vague and townOnly holds; with no address, postCode is undefined and the line returns unchanged.
  • Consumer side: postCode was already in FEED_SELECT (config/api/fetch.ts), so the data arrives. All 18 a11y locales and context.json carry copy_address, and no share.copied call site is left.
  • Producer side: SahajCloud#1281 is open; its key path and merge order match this body.
  • Streamliner: 3 pieces walked, all 3 kept; of its 3 findings, 1 posted.

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


Generated by Claude Code

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
sydevs-bot and others added 4 commits November 26, 2026 02:47
`whereLineFull` said neither of the two things it carries. Every other
field on `EventDisplayStrings` names its content rather than an
affordance, so the value-describing name is the one that fits — and the
hook stays free of any opinion about the copy button.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYmq4P6EV3DoqumAsr
The ref and the inner span existed only to aim the fallback selection.
The button's children already are the address: the icon is `aria-hidden`
with no text, and the status overlay renders only once a copy succeeded,
which is the one case that never selects.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYmq4P6EV3DoqumAsr
Directions opens Google Maps from the stored point, so it reaches no
other maps app and carries no address text. A later reader asking why a
second affordance exists beside it now finds the answer at both ends:
the component, and the changelog a host reads.

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

Copy link
Copy Markdown
Contributor

Three critic threads, all settled. Pushed for relay: claude/relay-498-bdf196d.

origin/main merged in clean, and ships with this push. Lean gate green. Security review skipped: no trigger path, no new sink. The body is refreshed for the rename, the new CopyAddress shape, and a preview that now has an alias.

🤖 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 moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@cloudflare-workers-and-pages

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 bdf196d Nov 26 2026, 03:00 AM

@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

The newest commit, bdf196d, is sydevs-bot's own, so it is not approved on your behalf. Read it, then say @sydevs-bot approve, or enable auto-merge.

🤖 sydevs dispatcher

Ardnived and others added 2 commits November 25, 2026 20:25
A house number can read the same as a postcode, so a "street already holds it" check could
hide a real postcode. The data is taken as correct; a coordinator who sees a repeated postcode
on the class page fixes the street.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting 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
@Ardnived
Ardnived added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 81a6a31 Nov 26, 2026
20 checks passed
@Ardnived
Ardnived deleted the feat/class-page-postcode branch November 26, 2026 16:45
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 26, 2026
Ardnived added a commit that referenced this pull request Nov 26, 2026
Four more PRs: #496 (a class drags down to its key facts), #498 (the class
address ends with its postcode and copies on tap), and the contract
re-syncs #497 and #499.

- `CHANGELOG.md`: #496's and #498's entries above #490's, which keeps this
  branch's wording.
- `translations.en.json`: taken from production again with
  `pnpm sync:translations --write`. Since the last sync SahajCloud#1278
  dropped `common.errors.captcha_blocked`, and #498's `common.chrome.copied`
  replaced `share.copied`. `RETIRING_KEYS` loses its last entry, the key
  production no longer serves. `pnpm types:cms` wrote no change.

#496's ladder changes write only where the sheet can collapse, so the
inline column is untouched by them.

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.

2 participants