Skip to content

Redesign the share modal with a link preview and caption suggestions - #1500

Merged
daveearley merged 2 commits into
v2.3.0from
feature/share-modal
Nov 21, 2026
Merged

daveearley merged 2 commits into
v2.3.0from
feature/share-modal

Conversation

@daveearley

Copy link
Copy Markdown
Contributor

What this does

Replaces the three-tab share modal with a single screen:

  • Live link preview in three styles (Feed, Message, Post), built from the same cover image, title and description the event page sends in its Open Graph tags. The caption updates in the preview as it is typed.
  • Caption, share buttons, link and QR code side by side with the preview. Facebook, LinkedIn and Pinterest ignore prefilled text, so the caption is copied to the clipboard when sharing there.
  • No cover image: the preview shows the text-only card the networks would render, with a prompt and a button to the homepage designer (hidden for members without edit access).
  • Caption suggestions: a "Suggest captions" button returns four captions (Friendly, Professional, Energetic, Short) written by Claude Haiku from the event title, description, next date, venue and organizer name. Clicking one fills the caption.

The affiliate, organizer and occurrence share modals get the new layout without suggestions.

Who gets suggestions

Checked on the server for every call (EventShareSuggestionAvailabilityService):

  1. ANTHROPIC_API_KEY is set. Without it the feature is hidden, so self-hosted installs are unaffected.
  2. The account email is confirmed.
  3. The event is not held for spam review.
  4. In SaaS mode, the account is verified or the event's organizer has finished Stripe setup. Otherwise the modal shows a "connect Stripe" hint.

Limits

  • 20 generations per account per 24 hours (EventShareSuggestionQuotaService), shown in the modal as "n left today".
  • throttle:6,1,event-share-suggestions on the generate endpoint.
  • Generating needs edit access; read-only members can see existing suggestions.

API

Two new endpoints in the auth:api,sanctum group, both additive:

  • GET /events/{event_id}/share-suggestions
  • POST /events/{event_id}/share-suggestions (403 when unavailable, 429 when the daily allowance is used, 503 when the provider fails)

backend/resources/api-reference/openapi.json is regenerated.

Notes for review

  • No new table. The latest suggestions per event (30 days) and the daily count (24 hours) are kept in the cache. A cache flush resets both.
  • Model: claude-haiku-4-5, the same as the event spam check.
  • Event content is untrusted input to the model: it is stripped to plain text, angle brackets are neutralised, and the output is cleaned, capped at 280 characters and cut at a sentence end.
  • EventLiveCelebrationModal now takes the event instead of eventTitle and eventId.
  • The "Share Event" button is still hidden at phone width by the existing event layout; this PR does not change that.
  • Russian has about 2,880 untranslated frontend strings from before this change; only the 26 new strings were added there.

Testing

  • Unit: availability rules, quota, caption service (prompt contents, output cleaning, failures), generate handler.
  • Feature: EventShareSuggestionsActionTest (generate and read back, not configured, untrusted Cloud account, allowance used, provider failure, read-only member, another account's event).
  • E2E: e2e/tests/management/share-event.spec.ts (no-cover prompt, picking a suggestion, untrusted-account hint), with the suggestions endpoint stubbed.
  • Ran the Unit and Feature suites, pint --test, tsc --noEmit and the E2E spec against the dev stack. Checked the modal in Chrome on events with and without a cover, with real Haiku output, and at 390px width.

…modal

# Conflicts:
#	frontend/src/locales/cs.js
#	frontend/src/locales/cs.po
#	frontend/src/locales/de.js
#	frontend/src/locales/de.po
#	frontend/src/locales/el.js
#	frontend/src/locales/el.po
#	frontend/src/locales/en.js
#	frontend/src/locales/en.po
#	frontend/src/locales/es.js
#	frontend/src/locales/es.po
#	frontend/src/locales/fi.js
#	frontend/src/locales/fi.po
#	frontend/src/locales/fr.js
#	frontend/src/locales/fr.po
#	frontend/src/locales/hu.js
#	frontend/src/locales/hu.po
#	frontend/src/locales/it.js
#	frontend/src/locales/it.po
#	frontend/src/locales/ja.js
#	frontend/src/locales/ja.po
#	frontend/src/locales/ko.js
#	frontend/src/locales/ko.po
#	frontend/src/locales/nl.js
#	frontend/src/locales/nl.po
#	frontend/src/locales/pl.js
#	frontend/src/locales/pl.po
#	frontend/src/locales/pt-br.js
#	frontend/src/locales/pt-br.po
#	frontend/src/locales/pt.js
#	frontend/src/locales/pt.po
#	frontend/src/locales/ru.js
#	frontend/src/locales/ru.po
#	frontend/src/locales/se.js
#	frontend/src/locales/se.po
#	frontend/src/locales/sk.js
#	frontend/src/locales/sk.po
#	frontend/src/locales/tr.js
#	frontend/src/locales/tr.po
#	frontend/src/locales/vi.js
#	frontend/src/locales/vi.po
#	frontend/src/locales/zh-cn.js
#	frontend/src/locales/zh-cn.po
#	frontend/src/locales/zh-hk.js
#	frontend/src/locales/zh-hk.po
@github-actions

Copy link
Copy Markdown
Contributor

✅ E2E smoke tests: Everything passed.

Mode Result ✅ Passed ❌ Failed ⚠️ Flaky ⏭️ Skipped ⏱️ Duration
Self-hosted ✅ Passed 119 0 0 0 4m 4s

Open the run

@daveearley
daveearley merged commit a44388f into v2.3.0 Nov 21, 2026
9 checks passed
@daveearley
daveearley deleted the feature/share-modal branch November 21, 2026 08:18
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant