Skip to content

feat(share): one share block and one class summary for Share and the sign-up confirmation - #518

Merged
Ardnived merged 9 commits into
mainfrom
feat/share-content
Nov 26, 2026
Merged

Ardnived merged 9 commits into
mainfrom
feat/share-content

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Share opens the device's own share sheet. Where there is none, or the host refuses it, the same button opens the region's networks in a popover. Copy link now says "Link copied".
  • One EventSummary (the list card's body) opens the Share panel, Register and the confirmation. The QR row moves to the bottom of the class page, as the owner asked during review.
  • Joined: CopyField moves into EventActions, so a class page no longer loads react-share (about 16 KB gz) just to copy a phone number.

Change outline

Components

ShareContent (molecule)            Share… ─┬─ navigator.share ── shared / dismissed (button stays)
                                           └─ unavailable ──────► usePopover (Floating UI) ▸ ShareTargets (region order, brand colours, closes on pick)
                                   Copy link ── useCopy(2500) ── "Link copied" + live region
                                                └─ refused ─────► useCopy selects the caption + touch/pointer hint
EventSummary (new molecule)        title + Online tag · EventFacts(card, hideSubtext?) · EventChips(card)
  ├─ EventListItem                 inside its link (replaces the inline title/facts/chips)
  ├─ ShareView                     boxed, under "Share this class"
  └─ RegistrationView              boxed + hideSubtext (form and confirmation)
EventFacts                         − `summary` surface (box, title, children) · + hideSubtext
EventDetails                       + QrPoster last, when useShareUrl gives a link
EventActions                       phone copy field inlined into ContactPopover (was CopyField, exported from ShareContent)
useCopy / usePopover               copy(value, fallback) selects on refusal · toggleOnClick: false lets Share open the sheet first

Copy

 share                         src/config/translations.en.json (copied from production; full sync blocked until #466)
+  copy_failed_pointer / copy_failed_touch / link_copied / title_class    # sydevs/SahajCloud#1287
   copy_link                    # wired again; sydevs/SahajCloud#1288 re-declares it
   title                        # unread → RETIRING_KEYS, sydevs/SahajCloud#1290

Host contract

docs/embedding.md's Permissions Policy rows now say what happens when a policy refuses each feature. Refused web-share opens the popover. Refused clipboard-write selects the link and shows a hint. CHANGELOG.md has an entry. No parameter, origin or CSP change.

Preview

Preview pending. The Cloudflare branch aliases for the app and Ladle are added once the deploys report.

Stories to open on the Ladle preview: ?story=molecules--share-content, ?story=molecules--event-summary, ?story=views--share (press Share… for the popover), ?story=views--registration&arg-example=Confirmation, and ?story=molecules--list--event-list-item.

Test results

  • Lean gate: ✓ (lint, typecheck, test:run); --full also ✓ (build, pnpm size within budget)
  • Targeted specs:
    • New: ShareContent.dom.test.tsx (sheet shared / dismissed / refused, popover closes after a pick and from its button, 2.5 s "Link copied", refused clipboard), EventSummary.test.tsx, EventDetails.qr.test.tsx
    • Updated: ShareContent.test.tsx, EventFacts.test.tsx, overlay.popper.test.ts, translations.test.ts
    • Each new assertion failed against its defect before it passed.
  • pnpm test:browser: 26/26
  • pnpm test:a11y: the new stories are clean. The two findings left (form-field, mapbox) reproduce on a clean main build locally.

Manual verification

  1. Safari on a Mac, or a phone on the preview: press Share, the device's sheet opens. Cancel it and the button stays.
  2. Firefox desktop (no sheet): press Share and the popover of networks opens. Pick one and the popover closes.
  3. Press Copy link: it reads "Link copied" for about 2.5 s. On a real iPhone, check that this fixes the missing "Copied" from the simulator, which was never reproduced.
  4. Dark theme: the X disc in the popover has a faint ring.

Notes for reviewer

  • /code-review medium ran. Fixed: an open popover could not be closed from its own Share button.
  • Dismissed review findings:
    • "Share announces has-popup on a device with a native sheet." The sheet is itself a popup, and the popover's focus manager returns focus to Share.
    • "The popover's name reuses the visible share.native." It is the trigger's visible text, not a screen-reader-only string.
  • /simplify ran. Skipped as out of scope:
    • a closable variant on the Chip atom, which would change every chip on touch screens
    • an Alert for the copy hint, a visible redesign
    • lazy-loading QrPoster (about 2 KB gz)
  • /security-review ran (EventDetails path): no findings.
  • Local adversarial review: adopted one select-on-refusal path in useCopy, the phone copy field inlined into its one caller, and the caption recipe and duration constant inlined. Rebutted: the list card's Online tag is the ticket's own spec ("EventSummary … is the list card's summary: title with its Online tag"); the facts line still says Online if a long title clips the chip. ShareTargets stays (the specs and stories pin it).
  • Merged main: chore(ui): remove the Combobox atom, cmdk and Radix Popover #519 removed Radix Popover, so the fallback is rebuilt on usePopover (owner's choice), which gains toggleOnClick.
  • CopyField keeps its old accessible name, "Copy link: ". Naming it for the phone number needs a new machine-translated a11y key, left for a follow-up.
Detail
  • Owner decisions during the build:
    • Native share stays first.
    • The QR row lives at the very end of the class page, after the images. It keeps the bottom padding there, and the images end flush only when no QR row follows.
    • EventFacts and EventSummary stay separate: merging them would bring back the variant-with-flags shape this ticket removes.
  • Snapshot: the four keys are copied verbatim from production. A full pnpm sync:translations --write also pulls in unrelated drift (compact.open) until feat(widget): open every embed inline; expand the map over the page #466 lands.
  • Console warning: the setState-in-render warning (DrawerStack / ReadClient) that shows in dev also shows on a clean main.

🤖 Generated with Claude Code

Ardnived and others added 6 commits November 26, 2026 15:41
…sign-up confirmation

- ShareContent is the one share block: Share opens the device's own share
  sheet; where there is none, or a host page refuses it, the same button
  opens the region's networks in a popover, in their brand colours, and the
  popover closes after a pick. Backing out of the sheet keeps the button.
  Copy link is a named button that says "Link copied" for 2.5 s, announced,
  and on a refused clipboard selects the link and says how to copy it by hand.
- EventSummary (new molecule) is the list card's body: title with its Online
  tag, card facts, chips. The list card renders it in its link; Share,
  Register and the confirmation box it at their top (hideSubtext on the last
  two). EventFacts loses its boxed `summary` surface and gains hideSubtext.
- The Share panel opens on the summary under "Share this class"
  (share.title_class); share.title goes on the retiring list.
- The poster QR code row moves from Share to the bottom of the class page.
- The snapshot gains the four new share keys, copied by hand from
  production while a full sync is blocked on #466; share.copy_link is wired
  again (SahajCloud#1288 re-declares it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Permissions Policy rows now say what each refusal does: Share opens a
popover of networks, and Copy link selects the link to copy by hand.
DESIGN_SYSTEM rows for EventSummary, ShareContent and the moved QrPoster,
and a CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After #508 a parent resolves an event's display once and hands the strings
to its facts and chips. EventSummary follows suit, so the list card, Share
and Register each still resolve once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- CopyField moves into EventActions, its one caller, so a class page no
  longer loads react-share and the share block to copy a phone number; the
  multi-export exception for ShareContent goes with it.
- The share targets' common button props are built once in PlatformButton.
- EventSummary reads the resolved `display.online`; ShareButton reuses
  ShareContentProps; Copy link resolves its status string once.
- An open fallback popover now closes from the Share button (review finding),
  with a spec.
- Stale comments and a spec that could not fail are gone; the changelog
  notes the list card's Online tag.

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
  • 12:52Z review-pr · attempt 3 · session · done
  • 12:52Z review-pr · attempt 3 · session
  • 03:21Z review-pr · attempt 2 · session · timed out
  • 03:21Z review-pr · attempt 2 · session
  • 22:48Z 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 16:11
#519 removed Radix Popover, so the Share fallback is rebuilt on the app's
own usePopover (Floating UI), as the contact popover is; usePopover gains
toggleOnClick so Share opens the native sheet first. ShareContent leaves the
Radix popper inventory, and its single-use COPIED_MS and caption recipe are
inlined (review).

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

Copy link
Copy Markdown
Contributor Author

Local adversarial review, addressed in ddb6d7a, 856629a and the merge d886740:

  • Adopted: refused-clipboard selection now lives once, in useCopy (copy(value, fallback)), used by Copy link and the address. The single-use phone CopyField is inlined into the contact popover. COPIED_MS and the caption recipe are inlined.
  • Rebutted: the list card's Online tag is the ticket's spec for EventSummary ("title with its Online tag"). If a long title clips it, the facts line still says Online.
  • Kept: ShareTargets, which the stories and the region-order specs pin.
  • Merge: chore(ui): remove the Combobox atom, cmdk and Radix Popover #519 removed Radix Popover, so the Share fallback is rebuilt on the app's own usePopover (Floating UI). It gains toggleOnClick so Share opens the native sheet first.

@Ardnived
Ardnived merged commit ff4c159 into main Nov 26, 2026
14 checks passed
@Ardnived
Ardnived deleted the feat/share-content branch November 26, 2026 23:15
@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 27, 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 27, 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 27, 2026
@Ardnived Ardnived removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
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