Conversation
WalkthroughUpdate changes how default-browser titles are translated and how the selected browser key is compared/used in the UI, and aligns browser identifier casing and the in-app vs external launch branch in the link-opening helper, affecting which URL schemes and launch paths are chosen. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Note Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
Here are the copyable unit test edits: Copyable Edits |
|
Android Build Available Rocket.Chat Experimental 4.69.0.108192 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNQnZNMDTWcExHhSchnMlxBl-vv4Co-A_RvysQjHBXCb5SbpNQVgoKcDLLF1x63rypMIm6DPiF68j7LBiqGA |
|
iOS Build Available Rocket.Chat Experimental 4.69.0.108193 |
|
iOS Build Available Rocket.Chat Experimental 4.69.0.108198 |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
app/lib/methods/helpers/openLink.ts (2)
52-66: In‑app branch must align with persisted value.
browser === 'In_app'won’t match if the preference is still stored as'inApp', which would skip the in‑app flow and open externally. Please align the stored value or accept both.✅ Minimal compatibility tweak
- if (browser === 'In_app') { + if (browser === 'In_app' || browser === 'inApp') { await WebBrowser.openBrowserAsync(url, {
20-36: Browser selection will not work—stored values don't match comparison checks.The stored values (
'googlechrome','firefox','brave'after stripping the colon) are all lowercase, butappSchemeURLcompares against capitalized strings ('Chrome','Firefox','Brave'). None of the conditions will match, and the function will always return the URL unchanged. Additionally, line 55 checks for'In_app'but the stored value is'inApp'.Fix by either normalizing the comparison or adjusting stored values. For example:
- if (browser === 'Chrome') { + if (browser === 'googlechrome' || browser === 'chrome') { if (!isSecure) { schemeUrl = url.replace(protocol, scheme.chrome); } else { schemeUrl = url.replace(protocol, scheme.chromeSecure); } - } else if (browser === 'Firefox') { + } else if (browser === 'firefox') { schemeUrl = `${scheme.firefox}//open-url?url=${url}`; - } else if (browser === 'Brave') { + } else if (browser === 'brave') { schemeUrl = `${scheme.brave}//open-url?url=${url}`; }Also fix the
'In_app'check on line 55 to match the stored'inApp'value.
OtavioStasiak
left a comment
There was a problem hiding this comment.
Looks good to me!
Nice job!
Proposed changes
App does not follow the default browser behavior. Even when the setting is configured to open links inside the app, links are always opened in an external browser. Additionally, instead of showing the actual text, the app displays the i18n key.
Note for reviewer
I have tested this behavior on Android and can confirm it is working correctly now. Selecting “In App” opens the link in an in-app tab instead of the external browser.
I haven’t tested this on iOS yet.
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-1732
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.