feat(question-feed): credit each illustration cluster via ArtistSupportLink - #688
Merged
Merged
Conversation
…rtLink Each Level 2 illustration cluster (candidates sharing a Scryfall illustrationId) now shows an artist credit sourced from the group's own candidate.artist, reusing the existing ArtistSupportLink applet (MTGAC page link + commerce links) rather than plain text - the same applet already used for the confirmed-artist post-answer moment and the /display rail. Gating and wording deliberately diverge from those two existing callers: this credit describes a candidate printing's artist from canonical Scryfall reference data, not a vote the user has cast, so it reads "Illustration by <Name>" rather than "Art by <Name> - support them" to avoid implying an assertion about the user's own scanned card. A cluster whose members carry no artist name renders no credit at all. Compactness (one applet per cluster, potentially several per grid) is achieved via a caller-side max-width wrapper rather than forking or restyling the shared component, per its own "stretch to fill" design rule. The per-tile artist caption becomes redundant once a cluster has its own credit, so it's dropped inside grouped clusters via a new optional renderCandidateTile parameter (additive, doesn't touch the shared data-card-* attributes or testids) while staying on ungrouped tiles, which have no cluster-level credit. Ungrouped candidates keep their existing plain-text artist caption unchanged: a flat grid can hold many candidates by many different artists, so a per-tile applet there would be disproportionately heavy next to a still-unconfirmed flat list. useGetArtistExternalLinksQuery already dedupes by its string arg (RTK Query's default cache-key behaviour), so multiple clusters sharing one artist collapse to a single request with no code change needed. Refs #385 for context (data-endpoint integration); does not close it.
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
Adds an artist credit to each Level 2 illustration cluster in the "What's
That Card?" question feed, reusing the existing
ArtistSupportLinkMTGACapplet rather than plain text - the same applet already used for the
artistquestion type's post-answer moment and the/displayrail'sArtist section.
Each
IllustrationGroup(candidates sharing a ScryfallillustrationId)now renders, once, above its
CandidateGrid:Illustration by <Name>(plain text)ArtistSupportLinkapplet for that name (MTGAC page link + anycommerce links), wrapped in a caller-side
max-widthcontainer so onefull-bleed CTA per cluster doesn't read as page-width inside a grid that
can hold several clusters.
The artist name is drawn from the first non-blank
candidate.artistacross the group's members; a cluster whose members carry no artist name
renders no credit block at all (no empty applet, no link to a blank
page).
Wording deliberately diverges from the two existing callers'
"Art by <Name> - support them"copy: this credit describes a candidateprinting's artist, sourced from canonical Scryfall reference data,
before the voter has picked anything - not a claim about the voter's own
scanned card.
"Illustration by <Name>"reads as a fact about theartwork shown, not an assertion about the user's card.
The per-tile
candidate.artistcaption becomes redundant once itscluster has its own credit, so it's dropped inside grouped clusters via a
new optional third parameter on the shared
renderCandidateTilehelper(
showArtistCaption, additive, defaults totrue). Ungrouped candidatesare unaffected - they keep the existing plain-text caption unchanged and
do not get the applet treatment, since a flat grid can hold many
candidates by many different artists and a per-tile applet there would be
disproportionately heavy.
No wire-contract change:
PrintingCandidate.artistalready existed.useGetArtistExternalLinksQueryis RTK Query and dedupes by its stringargument automatically, so multiple clusters sharing one artist collapse
to a single request with no code change needed.
Refs #385 for context (the MTGAC data-endpoint integration this reuses);
does not close it.
Test plan
npx tsc --noEmitcleannpx eslintonQuestionFeed.tsx(0 errors, 5 pre-existingno-img-elementwarnings on untouched lines, unrelated to thischange)
QuestionFeed.test.tsx(18 passed) andArtistSupportLink.test.tsx(13 passed), run individually andcombined (31 passed) - no order-dependence found (issue Test suite is order-dependent: leaked fetch-failure window trips the envelope across files (8 failures on master) #679)
QuestionFeed.spec.ts+QuestionFeedResponsive.spec.tsrun against a live dev server with mocked network (42 passed),
including the 44px tap-target guards (WCAG 2.5.5) and the
illustration-grouping suite
pre-commit run --files <touched files>(prettier + eslint) cleanlsp_diagnostics- not available in this worktree(
typescript-language-servernot installed);tsc --noEmit+eslint + the test runs substitute, per this task's own guidance
npm testcarries 22 pre-existing failures in
src/features/searchSettings/comparison.test.ts(
Set.prototype.symmetricDifferenceunavailable on Node v20.20.2)was not re-investigated - confirmed unrelated to this change, not
touched by it
Task-end checks (CLAUDE.md)
docs/features/artist-support-links.md's"Surfaces" section updated in place (three → four), no dated section
appended.
credits each illustration cluster's artist). Wiki: the "What's That
Card?" user-guide page could note that illustration clusters now show
an MTGAC artist credit - flagging for the merge-time checklist rather
than editing directly from this worktree.
QuestionFeed.tsxdirectly and reusesArtistSupportLinkunmodified,no new independent primitive produced.