Skip to content

feat: allow using updated filters + sorts in sale screen#13267

Open
brainbicycle wants to merge 11 commits intomainfrom
araujobarret/dia-1222/masonry-new-sale-lot
Open

feat: allow using updated filters + sorts in sale screen#13267
brainbicycle wants to merge 11 commits intomainfrom
araujobarret/dia-1222/masonry-new-sale-lot

Conversation

@brainbicycle
Copy link
Contributor

@brainbicycle brainbicycle commented Feb 19, 2026

This PR resolves DIAM-18

Description

Refreshes a feature we attempted to release a long time ago, that is using newer filterArtworks connection on the Sale screen which has more filters and better sorting behavior (pushes closed lots to bottom).

See here and ticket for more context: https://artsy.slack.com/archives/C02BAQ5K7/p1768903042850919

cc @artsy/diamond-devs

Platform Before (FF disabled) After (FF enabled)
Android
android-ff-disabled-low.mov
android-ff-enabled.mov
iOS
ios-ff-disabled-low.mov
ios-ff-enabled-low.mov

PR Checklist

  • I have tested my changes on the following platforms:
    • Android.
    • iOS.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos at least on Android, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

Follow-ups

  • Clean up dead feature flags

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • use new filter artworks connection on sale screen (behind ff) - brian, carlos

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.

araujobarret and others added 10 commits June 16, 2025 22:37
…or nested scroll support

MasonryInfiniteScrollArtworkGrid was causing infinite scroll issues when used
inside the parent FlatList (nested scroll context). Reverted to using the
deprecated InfiniteScrollArtworksGridContainer which properly handles nested
scrolling via ParentAwareScrollView and isCloseToBottom helper.

Changes:
- Replace MasonryInfiniteScrollArtworkGrid with InfiniteScrollArtworksGridContainer
- Remove custom renderItem, handleOnEndReached, ListFooterComponent callbacks
- Add InfiniteScrollArtworksGrid_connection fragment spread to GraphQL queries
- Adapt loadMore function signature to handle callback parameter
- Apply to both SaleLotsListLegacy and SaleLotsListNew implementations

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…o results

The New implementation was checking filtered counts instead of unfiltered counts
to determine if the sale has any artworks. This caused the entire lots section to
disappear when filters resulted in zero matches, instead of showing the
FilteredArtworkGridZeroState with "Clear Filters" button.

Changes:
- Use unfilteredSaleArtworksConnection.counts.total for initial null check
- Remove underscore prefix from unfilteredSaleArtworksConnection parameter
- Remove debug console.logs
- Now matches Legacy implementation behavior

This ensures:
- Sales with 0 artworks (unfiltered) → return null (hide section)
- Sales with artworks but 0 filtered results → show zero state with clear filters

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add LegacySaleArtworks filter mode to conditionally hide filters that are not supported by the saleArtworksConnection query when the AREnableArtworksConnectionForAuction2 feature flag is disabled.

When flag is OFF (legacy):
- Only show: Sort, View As, Estimate Range
- Plus aggregations: Artists, Medium
- Hide: Colors, Framed, Price Range (unsupported)

When flag is ON (new):
- Show all filters (no change to existing behavior)

This prevents users from selecting filters that would be silently ignored by the legacy query.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove the temporary demonstration test file that was used to verify the hooks migration. The test cases are already covered by the comprehensive SaleLotsListHooks.tests.tsx file.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add testID="sale-artworks-grid" to the InfiniteScrollArtworksGridContainer wrapper in both legacy and new implementations. Update tests to check for this testID instead of masonry-specific assertions.

This provides a cleaner, more explicit way to verify the grid component renders correctly.

All tests passing (6 passed).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@brainbicycle brainbicycle self-assigned this Feb 19, 2026
filterOptionToDisplayConfigMap.estimateRange,
filterOptionToDisplayConfigMap.sort,
filterOptionToDisplayConfigMap.viewAs,
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been a silent bug for more than 2 years since we first introduced this feature flag 😬. Showing filters in the modal that are unsupported so just don't do anything.

/>
) : (
<Flex px={2} testID="sale-artworks-grid">
<InfiniteScrollArtworksGridContainer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted to use the deprecated InfiniteScrollArtworksGridContainer because pagination is broken in the MasonryInfiniteScrollArtworkGrid when not full screen + embedded in a parent scroll view, it would be nice to have a shared component that support this

@brainbicycle brainbicycle marked this pull request as draft February 19, 2026 21:02
Update test expectations to use "grid" instead of false for viewAs filter paramValue. This aligns with the ViewAsValues.Grid enum value which correctly equals "grid".

The previous value of false was incorrect - ViewAsValues is defined as:
- Grid = "grid"
- List = "list"

All tests passing (39 passed).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@artsy artsy deleted a comment from ArtsyOpenSource Feb 19, 2026
@brainbicycle brainbicycle requested review from a team and araujobarret February 19, 2026 21:30
@brainbicycle brainbicycle marked this pull request as ready for review February 19, 2026 21:38
@ArtsyOpenSource
Copy link
Contributor

This PR contains the following changes:

  • Cross-platform user-facing changes (use new filter artworks connection on sale screen (behind ff) - brian, carlos - brainbicycle)

Generated by 🚫 dangerJS against a959eb5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments