Skip to content

SCIX-950 fix(links): honor the external link tab preference - #996

Open
thostetler wants to merge 2 commits into
adsabs:masterfrom
thostetler:fix/scix-950-external-links-honor-tab-preference
Open

thostetler wants to merge 2 commits into
adsabs:masterfrom
thostetler:fix/scix-950-external-links-honor-tab-preference

Conversation

@thostetler

Copy link
Copy Markdown
Member

The external link tab preference in Application settings was saved but never read; external links always opened in a new tab regardless of the setting.

  • A new ExternalLinkTarget component, mounted once at the app root, strips target="_blank" from links on the page whenever the preference is set to open in the current tab, watching for links added later (dropdowns, modals, late-loading results) in addition to the initial page.
  • This also affects internal same-site links marked to open in a new tab, matching the old Bumblebee behavior.
  • File download links keep opening in a new tab regardless of the setting, since replacing the tab would navigate away to a blob URL instead of downloading.

@thostetler
thostetler requested a review from shinyichen December 2, 2026 13:27
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Bundle size

Shared by all pages: 644.1 kB (+0.5 kB) ⚪

No route changed by more than 1 kB. ✅

First load = polyfills + shared _app chunks + route chunks, gzipped.

@thostetler
thostetler marked this pull request as ready for review December 2, 2026 13:30
@thostetler
thostetler force-pushed the fix/scix-950-external-links-honor-tab-preference branch from 73e697b to 73ca783 Compare December 2, 2026 19:00
@codecov

codecov Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.6%. Comparing base (8ea152a) to head (e7b9ffa).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #996     +/-   ##
========================================
+ Coverage    58.3%   58.6%   +0.4%     
========================================
  Files         407     408      +1     
  Lines       12768   12757     -11     
  Branches     2863    2860      -3     
========================================
+ Hits         7434    7466     +32     
+ Misses       4648    4603     -45     
- Partials      686     688      +2     
Files with missing lines Coverage Δ
...mponents/ExternalLinkTarget/ExternalLinkTarget.tsx 100.0% <100.0%> (ø)
...mponents/ResultList/Item/ItemResourceDropdowns.tsx 71.1% <100.0%> (+16.4%) ⬆️
src/lib/useExternalLinkTarget.ts 100.0% <100.0%> (ø)

... and 4 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.

This branch has not been deployed

No deployments
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