Skip to content

Conversation

latonv
Copy link
Contributor

@latonv latonv commented Jul 4, 2025

Currently to determine the default sort option to select for a collection, we check for its sort-by metadata and fall back to global defaults otherwise. However, TV collections have their own default that is not always specified in metadata. And since we can't always identify TV collections until after receiving a PPS response, we need to rely on the PPS layer to both apply and inform the client of the correct default sort.

This PR updates how we determine which sort option to select, relying on the PPS's finalized request parameters rather than the collection metadata for this purpose.

Copy link

github-actions bot commented Jul 4, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://internetarchive.github.io/iaux-collection-browser/pr/pr-461/

Built to branch gh-pages at 2025-07-04 20:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

searchServiceKey: 'favoritedate',
displayName: 'Date favorited',
urlNames: ['favoritedate'],
urlNames: ['favoritedate', 'date_favorited'],
Copy link
Contributor Author

@latonv latonv Jul 4, 2025

Choose a reason for hiding this comment

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

The PPS identifies this sort using date_favorited, a format that differs from the other date sorts because of the different backing store for favorites & date favorited. Adding the new one so that we recognize it correctly, and leaving the old one for backwards-compatibility. We don't actually send this sort string to the PPS as it is always the default in context.

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.70%. Comparing base (747ce7b) to head (b8a1b4e).

Files with missing lines Patch % Lines
src/collection-browser.ts 90.90% 0 Missing and 1 partial ⚠️
src/data-source/collection-browser-data-source.ts 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #461      +/-   ##
==========================================
+ Coverage   92.69%   92.70%   +0.01%     
==========================================
  Files         109      109              
  Lines       17490    17483       -7     
  Branches     1369     1372       +3     
==========================================
- Hits        16212    16208       -4     
+ Misses       1215     1212       -3     
  Partials       63       63              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant