fix(web): contest cards open in new tab on cmd/middle-click#14333
Merged
Conversation
The ContestCard was a `<div>` with `onClick` + `useLinkClickHandler`, which short-circuits SPA navigation for modifier-clicks but doesn't give the browser an anchor to open in a new tab — so cmd-click and middle-click on a card did nothing instead of opening the contest in a new tab like every other link in the app. Switch to the stretched-link pattern: a real `<Link to=...>` absolutely positioned over the whole card. UserLink (already an `<a>`) and the horizontally-scrolling entries row are elevated via z-index so the artist link stays independently clickable and pill-row scrolling doesn't accidentally trigger navigation. Nesting two anchors stays invalid HTML — the stretched link is a sibling of UserLink, not an ancestor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14333.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContestCardrendered a<div>withonClick+useLinkClickHandler. That intercepts modifier-clicks correctly for SPA routing, but it never gives the browser an actual<a>element — so cmd-click and middle-click on a card did nothing instead of opening the contest page in a new tab like every other link in the app.<Link to=...>absolutely positioned over the whole card, so the browser handles cmd/middle-click natively. The existing innerUserLink(already an<a>) and the horizontally-scrolling entries row are elevated above the stretched link viaz-indexso the artist link stays independently clickable and pill-row scrolling doesn't accidentally trigger navigation.UserLink, not an ancestor.Test plan
/contests, regular click on a card navigates to the contest page (in-app, no full reload).UserLink) still navigates to the artist profile, not the contest page.🤖 Generated with Claude Code