-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(mobile): stop silently swallowing taps on out-of-workspace file links #7859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ import { | |
| } from "react-native-nitro-markdown"; | ||
| import { | ||
| ActivityIndicator, | ||
| Alert, | ||
| Image, | ||
| Platform, | ||
| type LayoutChangeEvent, | ||
|
|
@@ -1403,7 +1404,15 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { | |
| path: relativePath.split("/").filter((segment) => segment.length > 0), | ||
| ...(presentation.line ? { line: String(presentation.line) } : {}), | ||
| }); | ||
| return; | ||
| } | ||
| // The link renders as a file (icon + label) but points outside the | ||
| // workspace, so there is nothing on-device to navigate to. Say so | ||
| // instead of swallowing the tap. | ||
| Alert.alert( | ||
| "Can't open this file", | ||
| "It lives outside the project folder, so it isn't available here.", | ||
| ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alert shown after successful navigationHigh Severity
Reviewed by Cursor Bugbot for commit 6c835d2. Configure here.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and fixed in 0d22d6f - the handler returns right after navigation, so only unresolved out-of-workspace paths trigger the alert.
Comment on lines
+1412
to
+1415
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For every valid in-workspace file link, the handler navigates to Useful? React with 👍 / 👎.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, real bug. Fixed in 0d22d6f - early return after navigate, alert fires only when the path can't be resolved inside the workspace. |
||
| return; | ||
| } | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.