fix(ONYX-2196): show checkbox instead of toggle for newly created artwork lists - #13848
fix(ONYX-2196): show checkbox instead of toggle for newly created artwork lists#13848evaschilken wants to merge 2 commits into
Conversation
…work lists The Relay updater never seeded `isSavedArtwork` on a freshly-created list's record, so ArtworkListItem mistook it for an Offer Settings row (which also never fetches `isSavedArtwork`) and rendered a Switch instead of a checkbox. Seed it to `false` since a brand-new list can't already contain the artwork. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
SummarySeeds The fix is correct. Issues Found🟢 SuggestionThe heuristic in const offerSettingsList =
artworkList.shareableWithPartners !== undefined &&
artworkList.isSavedArtwork === undefined &&
!!isArtworkListOfferabilityEnabledInferring "which screen am I on" from field absence means any future write path that skips Test assertion leans on an unstated invariant — expect(screen.getByTestId("artworkListItemSelectedIcon")).toBeOnTheScreen()This passes because "Saved Artworks" is mocked with Areas Reviewed
Questions for AuthorThe checklist leaves Android untested with no Android screenshots. This is a UI change, the surrounding component tree branches on LLM disclosure is present ("Assisted by: Claude Sonnet 5"). |
This PR resolves ONYX-2196
Description
When saving an artwork and creating a new list on the fly from the "Save to lists" sheet, the new list's row rendered a
Switch(toggle) instead of the checkbox every other list shows.Root cause:
ArtworkListItemdecides checkbox vs. toggle based on field presence —shareableWithPartners !== undefined && isSavedArtwork === undefined— to distinguish the artwork-picker context from the Offer Settings screen context (which never fetchesisSavedArtwork). ThecreateCollectionmutation's Relay updater spliced the newly created list straight into the picker's connection without ever settingisSavedArtworkon that record, so it accidentally matched the Offer Settings branch and rendered a toggle.Fix: the updater now seeds
isSavedArtwork: falseon the new record (keyed to the current artwork's ID) before inserting it into the connection — always correct, since a brand-new list can't already contain the artwork.Assisted by: Claude Sonnet 5
Before

After

PR Checklist
AREnableArtworkListOfferabilityflag already gates this code path.)To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.