Skip to content

feat(collections): sorting, empty state, and cached annotation scores on browse page#797

Open
vcnainala wants to merge 3 commits into
developmentfrom
feat/collection-browse-sorting
Open

feat(collections): sorting, empty state, and cached annotation scores on browse page#797
vcnainala wants to merge 3 commits into
developmentfrom
feat/collection-browse-sorting

Conversation

@vcnainala

@vcnainala vcnainala commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds scopePublished on Collection and a published() factory state for consistent public visibility rules.
  • Introduces CollectionAnnotationScores to cache per-collection average annotation_level for sort performance; cache is cleared when coconut:cache runs.
  • Improves /collections browse UX:
    • Sort by release date, updated date, molecule count, annotation score, citations, organisms, geo locations, and title
    • Asc/desc toggle via arrow button (sortBy + dir URL params; default: release date, newest first)
    • Empty state when search has no matches (with clear search) or when no published collections exist

Test plan

  • php artisan test --filter=CollectionListTest (7 tests)
  • Visit /collections and verify default sort (release date, descending)
  • Toggle sort direction and change sort field; confirm URL updates
  • Search for a non-matching term and confirm empty state + clear search
  • Sort by annotation score after php artisan coconut:cache in staging/production

Resolves

Closes #578

vcnainala added 3 commits June 1, 2026 20:03
Introduce scopePublished on Collection and a published() factory state
so public browse logic and tests can reuse a single visibility rule.
Add CollectionAnnotationScores helper with flexible cache and invalidate
it when coconut:cache refreshes collection widget counts.
…browse

Extend the public collections page with multi-field sort (asc/desc toggle),
default release-date ordering, search empty state with clear action, and
feature tests for published filtering and sort behaviour.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.78082% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.21%. Comparing base (a4c26c6) to head (99f6074).
⚠️ Report is 4 commits behind head on development.

Files with missing lines Patch % Lines
app/Livewire/CollectionList.php 90.90% 4 Missing ⚠️
app/Support/CollectionAnnotationScores.php 92.59% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             development    #797      +/-   ##
================================================
+ Coverage           6.14%   7.21%   +1.06%     
- Complexity          1736    1752      +16     
================================================
  Files                227     228       +1     
  Lines               8945    9012      +67     
================================================
+ Hits                 550     650     +100     
+ Misses              8395    8362      -33     

☔ 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.

2 participants