Skip to content

feat(landing): make landing page form selection sticky#759

Merged
thostetler merged 2 commits intoadsabs:masterfrom
thostetler:SCIX-686-Make-landing-page-forms-sticky
Jan 13, 2026
Merged

feat(landing): make landing page form selection sticky#759
thostetler merged 2 commits intoadsabs:masterfrom
thostetler:SCIX-686-Make-landing-page-forms-sticky

Conversation

@thostetler
Copy link
Member

@thostetler thostetler commented Jan 10, 2026

Summary

  • Add user preference to remember the last-used search form (modern, classic, or paper) across sessions
  • For authenticated users, preference is configurable in Settings
  • For unauthenticated users, localStorage tracks the last-used form
  • Only applies to Astrophysics discipline which has multiple form options

Changes

  • Add LandingFormPreference enum with Auto/Modern/Classic/Paper options
  • Create useLandingFormPreference hook to manage form preference
  • Add Default Landing Page setting in application settings
  • Track current form on each landing page mount
  • Initialize localStorage synchronously to avoid double-render

Test plan

  • Visit each landing page (modern, classic, paper) and verify form is tracked
  • Check localStorage contains correct lastLandingForm value
  • Log in and set preference in Settings > Search Settings
  • Verify Start new search link respects the preference
  • Verify non-Astrophysics modes always go to /

Add user preference to remember the last-used search form (modern, classic,
or paper) across sessions. For authenticated users, this preference can be
configured in Settings. For unauthenticated users, localStorage is used.

- Add LandingFormPreference enum with Auto/Modern/Classic/Paper options
- Create useLandingFormPreference hook to manage form preference
- Add Default Landing Page setting in application settings (Astrophysics only)
- Track current form on each landing page mount
- Initialize localStorage synchronously to avoid double-render
@thostetler thostetler force-pushed the SCIX-686-Make-landing-page-forms-sticky branch from 444fbf6 to 943e2af Compare January 10, 2026 22:11
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 93.84615% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.8%. Comparing base (9678f94) to head (4d387cf).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/useLandingFormPreference.ts 93.6% 7 Missing ⚠️
src/components/SearchBar/SearchBar.tsx 66.7% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #759     +/-   ##
========================================
+ Coverage    71.8%   71.8%   +0.1%     
========================================
  Files         217     221      +4     
  Lines       24485   24839    +354     
  Branches     1402    1421     +19     
========================================
+ Hits        17575   17830    +255     
- Misses       6878    6977     +99     
  Partials       32      32             
Files with missing lines Coverage Δ
src/api/user/types.ts 100.0% <100.0%> (ø)
src/components/NavBar/NavBar.tsx 98.4% <100.0%> (+1.8%) ⬆️
src/pages/paper-form.tsx 70.1% <100.0%> (+0.5%) ⬆️
src/types.ts 100.0% <100.0%> (ø)
src/components/SearchBar/SearchBar.tsx 79.0% <66.7%> (+0.8%) ⬆️
src/lib/useLandingFormPreference.ts 93.6% <93.6%> (ø)

... and 10 files 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.

@thostetler thostetler requested a review from shinyichen January 10, 2026 22:14
@thostetler thostetler marked this pull request as ready for review January 10, 2026 22:14
Copy link
Member

@shinyichen shinyichen left a comment

Choose a reason for hiding this comment

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

A question about the code in the comment. Also, would it makes sense to update the upper left SicX link as well?

Otherwise looks good to me.

@thostetler
Copy link
Member Author

would it makes sense to update the upper left SicX link as well?

yes, good idea -- I'll update and merge

@thostetler thostetler merged commit e631bff into adsabs:master Jan 13, 2026
4 checks passed
@thostetler thostetler deleted the SCIX-686-Make-landing-page-forms-sticky branch January 13, 2026 04:56
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