Skip to content

feat: implement authors per result user preference#760

Merged
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:SCIX-663-setting-number-of-authors-per
Jan 13, 2026
Merged

feat: implement authors per result user preference#760
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:SCIX-663-setting-number-of-authors-per

Conversation

@thostetler
Copy link
Member

@thostetler thostetler commented Jan 10, 2026

Summary

  • Add useAuthorsPerResult hook that reads the minAuthorsPerResult user preference
  • Non-authenticated users see default of 4 authors
  • Authenticated users see their configured preference (1-10)
  • "all" preference (case-insensitive from vault) displays up to 50 authors (capped for UX)

Changes

  • New: src/lib/useAuthorsPerResult.ts - Hook to get authors per result preference
  • New: src/lib/__tests__/useAuthorsPerResult.test.tsx - 8 unit tests
  • Modified: src/components/ResultList/Item/Item.tsx - Use hook in search results
  • Modified: src/components/Libraries/DocumentList/DocumentItem.tsx - Use hook in library views

Test plan

  • Manual test: non-authenticated user sees 4 authors
  • Manual test: authenticated user with default sees 4 authors
  • Manual test: change setting to 2, verify 2 authors shown
  • Manual test: change setting to 10, verify 10 authors shown
  • Manual test: verify in both search results and library views

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.9%. Comparing base (9678f94) to head (a407347).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #760     +/-   ##
========================================
+ Coverage    71.8%   71.9%   +0.1%     
========================================
  Files         217     218      +1     
  Lines       24485   24514     +29     
  Branches     1402    1406      +4     
========================================
+ Hits        17575   17603     +28     
- Misses       6878    6879      +1     
  Partials       32      32             
Files with missing lines Coverage Δ
src/config.ts 100.0% <100.0%> (ø)
src/lib/useAuthorsPerResult.ts 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add useAuthorsPerResult hook that reads the minAuthorsPerResult user
preference to control how many authors are displayed in search results
and library document lists.

- Non-authenticated users see default of 4 authors
- Authenticated users see their configured preference (1-10)
- "all" preference (case-insensitive) displays up to 50 authors
- Includes unit tests for the new hook
@thostetler thostetler force-pushed the SCIX-663-setting-number-of-authors-per branch from 237fa69 to a407347 Compare January 10, 2026 23:18
@thostetler thostetler requested a review from shinyichen January 10, 2026 23:20
@thostetler thostetler marked this pull request as ready for review January 10, 2026 23:20
@thostetler thostetler merged commit 57ddbde into adsabs:master Jan 13, 2026
5 checks passed
@thostetler thostetler deleted the SCIX-663-setting-number-of-authors-per branch January 13, 2026 04:57
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