Skip to content

feat(contest): add permalink field to Event model for event_routes support#14469

Merged
dylanjeffers merged 3 commits into
mainfrom
feat/contest-permalink-frontend
Jun 10, 2026
Merged

feat(contest): add permalink field to Event model for event_routes support#14469
dylanjeffers merged 3 commits into
mainfrom
feat/contest-permalink-frontend

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

This PR adds frontend support for the contest permalink feature. The backend ETL (go-openaudio PR #354) already stores title-based slugs in event_routes. This PR wires up the frontend to use them once the API begins returning them, while maintaining full backward compatibility.

Summary

  • SDK Event model: adds permalink?: string field with full EventFromJSONTyped/EventToJSON wiring
  • Common Event model: adds permalink?: string override (forward-compatible optional)
  • contestPage() helper: passes through a permalink that already contains a contest path segment unchanged (event-routes slug); keeps existing track-permalink injection for backward compat
  • Desktop + mobile web ContestPage: canonicalUrl now prefers contest.permalink over the track-derived URL; falls back to track.permalink when absent
  • Share flow (5 files): threads eventPermalink through ShareModalRequest, ShareContestContent, shareContest action, watchShareContest saga, useShareContent hook, and mobile ShareDrawer utils
  • Mobile getContestRoute(): accepts optional contestPermalink; uses it directly when present
  • Tests: adds passthrough tests for the updated contestPage() behavior

All existing behavior is unchanged when event.permalink is absent. No breaking changes.

Test plan

  • Existing route.test.ts tests still pass
  • New contestPage passthrough tests pass
  • Contest page canonicalUrl is unchanged for existing contests (no permalink field in API yet)
  • Share contest copy-link/X-share still produces correct URL

Co-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com

…pport

Add permalink?: string to the SDK-generated Event type and common Event
model so contest pages can use title-based slugs from event_routes once
the API starts returning them.

- SDK Event: add permalink field + EventFromJSONTyped/EventToJSON wiring
- common Event model: add permalink?: string (forward-compatible optional)
- contestPage() helper: pass through permalinks that already contain a
  contest segment (event-routes slugs) unchanged; keep the existing
  track-permalink injection for backward compat
- Desktop + mobile ContestPage: prefer contest.permalink over track.permalink
  when setting canonicalUrl (falls back gracefully when absent)
- Share flow: thread eventPermalink through ShareModalRequest,
  ShareContestContent, shareContest action, watchShareContest saga,
  useShareContent hook, and mobile ShareDrawer utils so sharing a contest
  uses the event-routes slug when available
- mobile getContestRoute: accept optional contestPermalink, use it directly
  when present
- route.test.ts: add passthrough tests for the new contestPage behavior

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0db5f73

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14469.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

@dylanjeffers dylanjeffers merged commit f97b82c into main Jun 10, 2026
19 checks passed
@dylanjeffers dylanjeffers deleted the feat/contest-permalink-frontend branch June 10, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant