Repository navigation
feat: open external links in a new tab on web - #170
Open
devs-rootstrap wants to merge 1 commit into
Open
devs-rootstrap wants to merge 1 commit into
devs-rootstrap wants to merge 1 commit into
Conversation
devs-rootstrap
requested review from
amaury901130,
asdolo and
fernandatoledo
and
a balanced review from Copilot
November 11, 2026 12:15
💯 Test Coverage
😎 Tests Results
👀 Tests Details • (57%)
|
There was a problem hiding this comment.
🟡 Changes recommended
The navigation test can pass without handling the press because it matches a render-time mock call; clear the mock before pressing to verify onPress forwarding.
1 open issue
What changed in this PR
Overall Review: ai:minor
Updates Settings external links to open in new browser tabs on web while preserving in-app WebView navigation on iOS and Android.
Changes:
- Adds a platform-aware
LinkItemand anchor support to settings rows. - Migrates Terms of Service and Website links to the shared component.
- Adds tests for web link attributes and native navigation.
| File | Description |
|---|---|
src/components/settings/link-item.tsx |
Selects web anchors or native /www navigation. |
src/components/settings/item.tsx |
Adds optional role and external anchor props. |
src/app/(app)/settings.tsx |
Uses LinkItem for both external links. |
__tests__/components/settings/link-item.test.tsx |
Tests web attributes and iOS/Android navigation. |
Review effort: Balanced
| setPlatformOS(os); | ||
| render(<LinkItem text="settings.terms" url={URL} />); | ||
|
|
||
| fireEvent.press(screen.getByText('Terms of Service')); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Jira board reference:
What does this do?
On web, the Settings links (Terms of Service and Website) now open the URL in a new browser tab instead of navigating to the in-app WebView screen (
/www). iOS and Android keep the current behavior.LinkItemsettings component (src/components/settings/link-item.tsx):<a href target="_blank" rel="noopener noreferrer">) through react-native-web'shref/hrefAttrs, so the browser handles it natively (new tab, middle-click, "copy link address", link semantics).Linkto/wwwwith theurlandtitleparams.Itemaccepts two optional props:roleand a web-onlyexternalHref, which turns the row into an anchor. Existing usages are unchanged.LinkItemfor both links. Themax-lines-per-functiondisable comment was removed because it is no longer needed.Why did you do this?
react-native-webviewis not meant for the browser, so opening Terms/Website inside the app on web adds nothing and breaks the expected browser behavior. A real anchor withtarget="_blank"is the most robust option on web: popup blockers don't apply to it, and it keeps native link behavior without extra JS.Who/what does this impact?
src/app/www.tsxis untouched. This should merge cleanly next to refactor(router): move screen options from layouts into screen files #157, which only adds aTabs.Screenblock insettings.tsxand rewriteswww.tsx; a small conflict in the imports ofsettings.tsxis possible.Layer 2: Risk Classification
Author applies a risk label when opening the PR. When in doubt, escalate.
risk:lowrisk:mediumrisk:highSetup
risk:low,risk:medium,risk:highlabels in the repoHow did you test this?
Verification
pnpm lint: passedpnpm type-check: passedpnpm lint:translations: passedpnpm test: 29 suites, 142 tests passed__tests__/components/settings/link-item.test.tsxcovers the web anchor (role,href,target/rel) and the/wwwnavigation on iOS and Android.How to test locally
git fetch origin && git checkout feat/web-links-new-tab && pnpm installpnpm web, sign in and open Settings.pnpm ios/pnpm android, the same items should still open the in-app WebView.Notes:
Assumptions:
/wwwWebView screen are in scope. Today those are the two Settings links (Terms of Service and Website)./wwwon web is left as is.Screenshots / Previews
N/A