Skip to content

WEBDEV-8185 Refactor to extract default sort management#564

Open
latonv wants to merge 6 commits into
mainfrom
webdev8185-default-sort-handling
Open

WEBDEV-8185 Refactor to extract default sort management#564
latonv wants to merge 6 commits into
mainfrom
webdev8185-default-sort-handling

Conversation

@latonv

@latonv latonv commented Apr 16, 2026

Copy link
Copy Markdown
Member

Currently, collection-browser manages default sort properties internally, based on factors like the type/context of the search performed and any sort-by metadata present in the search response. While this allows the parent page to be hands-off about the default sort, it leads to increasing complexity in the logic that collection-browser must handle itself to determine the appropriate behavior, and requires it to know more than is reasonable about how/where it is being used.

This PR inverts the responsibilities so that the parent page may independently set collection-browser's default sort depending on its own context and needs (e.g., what kind of page, what tab is selected), and removes much of collection-browser's own handling of that logic. Instead, collection-browser emits the appropriate events w/ more details for the parent page to react to with any sorting changes necessary (e.g., when new collection metadata is received).

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

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

Built to branch gh-pages at 2026-04-16 19:03 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.24096% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.78%. Comparing base (a0e3ce6) to head (c840bbf).

Files with missing lines Patch % Lines
src/models.ts 49.05% 27 Missing ⚠️
src/collection-browser.ts 76.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
- Coverage   92.43%   91.78%   -0.66%     
==========================================
  Files         113      113              
  Lines       18946    18919      -27     
  Branches     1379     1357      -22     
==========================================
- Hits        17513    17365     -148     
- Misses       1403     1524     +121     
  Partials       30       30              

☔ 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