Skip to content

SCIX-794, SCIX-774: Add discipline routes, fix legacy referrer, rename General Science#773

Merged
thostetler merged 9 commits intoadsabs:masterfrom
thostetler:SCIX-794-discipline-routes
Jan 21, 2026
Merged

SCIX-794, SCIX-774: Add discipline routes, fix legacy referrer, rename General Science#773
thostetler merged 9 commits intoadsabs:masterfrom
thostetler:SCIX-794-discipline-routes

Conversation

@thostetler
Copy link
Member

@thostetler thostetler commented Jan 20, 2026

Replaces the deprecated /onboard route with discipline-specific routes (/astrophysics, /heliophysics, /planetary, /earth, /biophysical) that immediately set the selected discipline and redirect to home.

Also fixes the bug where users arriving from the legacy ADS app (ui.adsabs.harvard.edu) don't immediately see the Astrophysics discipline selected - it previously only switched on the next search.

Additionally renames "General Science" to "No preferred discipline" (SCIX-774).

  • Add mapPathToDisciplineParam utility for extracting discipline from URL paths
  • Add middleware redirect for discipline routes to /?forceMode=X
  • Honor forceMode query param in SSR with highest precedence
  • Redirect legacy ADS referrer to /?forceMode=astrophysics in middleware
  • Remove deprecated /onboard route and its noindex header config
  • Clean forceMode param from URL after mode is applied
  • Add tests for utility and SSR forceMode handling
  • Rename "General Science" label to "No preferred discipline"

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 80.35714% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.9%. Comparing base (5d0ff6f) to head (15d8f4f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/middleware.ts 62.1% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #773     +/-   ##
========================================
+ Coverage    60.9%   60.9%   +0.1%     
========================================
  Files         301     301             
  Lines       35040   35081     +41     
  Branches     1500    1507      +7     
========================================
+ Hits        21320   21349     +29     
- Misses      13686   13698     +12     
  Partials       34      34             
Files with missing lines Coverage Δ
src/components/NavBar/models.ts 100.0% <100.0%> (ø)
src/ssr-utils.ts 70.0% <100.0%> (+2.5%) ⬆️
src/utils/appMode.ts 86.3% <100.0%> (+1.8%) ⬆️
src/middleware.ts 91.8% <62.1%> (-2.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.

@thostetler thostetler marked this pull request as ready for review January 20, 2026 20:13
@thostetler thostetler requested a review from shinyichen January 20, 2026 20:14
@thostetler thostetler changed the title SCIX-794 Add discipline-specific routes and fix legacy referrer handling SCIX-794, SCIX-774: Add discipline routes, fix legacy referrer, rename General Science Jan 20, 2026
The /onboard route was a legacy redirect that captured the referrer,
logged to Sentry, and redirected to home. It served no real purpose -
essentially a no-op redirect. Now that discipline-specific routes
(/astrophysics, /heliophysics, etc.) and legacy referrer handling in
middleware are in place, this route is obsolete.

Also removes the noindex header configuration for /onboard.
…ling

- Add mapPathToDisciplineParam tests covering valid paths, invalid paths,
  and case-insensitivity
- Add forceMode handling tests verifying precedence over d param and
  legacy referrer detection
@thostetler thostetler force-pushed the SCIX-794-discipline-routes branch from e796903 to 15d8f4f Compare January 20, 2026 23:58
@thostetler thostetler merged commit 348bdd1 into adsabs:master Jan 21, 2026
5 checks passed
@thostetler thostetler deleted the SCIX-794-discipline-routes branch January 21, 2026 23:18
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