Skip to content

profile: only show Contests tab when host has a contest and flag is on#14258

Merged
dylanjeffers merged 3 commits intomainfrom
claude/conditional-contests-tab-ARyS8
May 7, 2026
Merged

profile: only show Contests tab when host has a contest and flag is on#14258
dylanjeffers merged 3 commits intomainfrom
claude/conditional-contests-tab-ARyS8

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Hide the profile Contests tab unless the CONTESTS feature flag is enabled and the artist actually hosts at least one remix contest.
  • Add a shared useUserHasRemixContest hook in @audius/common that paginates the global remix-contest list (same MAX_PAGES_TO_LOAD cap as ContestsTab) and matches event.userId against the host.
  • Wire the gate into desktop web, mobile web, and React Native profile screens. If a viewer hits /:handle/contests on a profile that no longer qualifies, the body falls back to the default tab so it stays in sync with the (now hidden) tab list.

Why

Before this change the desktop and mobile-web profiles always rendered the Contests tab for any artist, ignoring the feature flag entirely; the React Native side respected the flag but still showed the tab for artists who don't run any contest. Both led to an empty/unreachable destination.

Test plan

  • Flag off: Contests tab is hidden on every profile (desktop web, mobile web, RN).
  • Flag on, artist with no contests: tab is hidden.
  • Flag on, artist with at least one contest (active or ended): tab is visible and the grid renders.
  • Visit /:handle/contests directly on a profile that doesn't qualify — body falls back to the default tab.
  • Non-artist profile is unaffected (no Contests tab option).

https://claude.ai/code/session_015jtkBQyrvnULHbEDxgM9gc


Generated by Claude Code

The Contests tab was rendered for every artist profile, regardless of
whether the CONTESTS feature flag was on or whether the artist actually
hosted any remix contest. The desktop and mobile-web tab lists missed
the flag check entirely; the React Native side gated on the flag but
not on host activity.

Add useUserHasRemixContest, a shared hook that paginates the global
remix-contest list (with the same MAX_PAGES_TO_LOAD cap as ContestsTab)
and matches event.userId against the host. Wire it into the desktop,
mobile-web, and React Native profile screens so the tab only appears
when the flag is enabled AND the artist hosts at least one contest.
Also fall back to the default tab if a viewer hits /:handle/contests
on a profile that no longer qualifies.

https://claude.ai/code/session_015jtkBQyrvnULHbEDxgM9gc
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: c5d8756

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@audius/common Patch
@audius/mobile Patch
@audius/web Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🌐 Web preview ready

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

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

@dylanjeffers dylanjeffers merged commit 791b612 into main May 7, 2026
14 checks passed
@dylanjeffers dylanjeffers deleted the claude/conditional-contests-tab-ARyS8 branch May 7, 2026 01:33
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.

2 participants