Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Pull request overview
Adds an Electron-only setting that lets users route certain chat link clicks into the integrated browser/preview panel based on user-configured host (+ optional path prefix) patterns, instead of always opening the system browser.
Changes:
- Extends
ClientSettingswithintegratedBrowserUrlPatterns(plus patch support) and adds contract tests for decoding/patch trimming behavior. - Adds a General (Electron-only) settings UI for managing integrated-browser link patterns and includes the setting in settings search + “restore defaults”.
- Implements pattern parsing/normalization/matching utilities with unit tests, and updates
ChatMarkdownto intercept plain left-clicks on matching external links to open in preview.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/contracts/src/settings.ts | Adds integratedBrowserUrlPatterns to ClientSettingsSchema + patch schema. |
| packages/contracts/src/settings.test.ts | Verifies defaults, trimming behavior, and blank rejection for the new settings field. |
| apps/web/src/components/settings/settingsSearch.ts | Adds a searchable entry for “Integrated browser links”. |
| apps/web/src/components/settings/SettingsPanels.tsx | Wires the new Electron-only setting UI into General settings + restore-defaults/dirty detection. |
| apps/web/src/components/settings/IntegratedBrowserLinksSetting.tsx | New add/remove UI for editing patterns (normalizes on add). |
| apps/web/src/components/ChatMarkdown.tsx | Intercepts left-clicks on matching external links to open in integrated preview, while keeping modifier/middle clicks external. |
| apps/web/src/browser/integratedBrowserLinkPatterns.ts | New parse/normalize/match logic for host(+path prefix) patterns. |
| apps/web/src/browser/integratedBrowserLinkPatterns.test.ts | Unit tests covering parsing, normalization, and matching behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 10f6128c281045c2cf186ccb837e35efbcdd759c. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new feature allowing users to configure URL patterns that open in the integrated browser rather than the system browser. New user-facing capabilities with new settings and UI components warrant human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d76a2f05f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rowser Adds an "Integrated browser links" setting (Electron only) where users list host(+path-prefix) patterns like *.github.com or docs.example.com/api. Left-clicking a matching chat link opens it in the integrated browser panel instead of the system browser; modifier- and middle-clicks still open externally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Patterns match against URL.pathname, so a `?` or `#` could never match — reject them at entry. Dropping the blanket `:` check lets legitimate path colons through; schemes and ports are still caught by the host character check. Also correct two stale doc comments flagged in review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An empty apex passed the wildcard guard and would match only hosts with a trailing dot. Require a non-empty apex after `*.`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Left-clicks on matching links prevent default navigation, so a failed integrated-browser open previously left the click dead with only a console error. Mirror the terminal link behavior: fall back to shell.openExternal (or window.open outside Electron). The context-menu "open in preview" action keeps its existing behavior since the user asked for preview explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5d76a2f to
3e0179d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e0179dff6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… paths Percent-encode pattern path prefixes via URL so non-ASCII paths match the encoded URL.pathname they are compared against, and filter the desktop-only integrated-browser-links entry out of settings search when not in Electron. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… escape casing Reject `www.*.example.com` instead of silently widening it to `*.example.com`, and uppercase percent-escape hex on both the pattern prefix and the compared pathname so equivalent escapes match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Patterns like `example..com` or `-example.com` passed the character check but could never match a real hostname, leaving them silently dead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc509e57a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`*.www.example.com` failed to match `www.example.com` itself because the link hostname was www-stripped before comparison; now both the raw and stripped forms are checked. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

I wanted links to my postplans (and other sites I always view in-app) to open in the integrated browser panel instead of bouncing out to my system browser every time I click them in chat.
Now there's an "Integrated browser links" setting (Electron only, under General) where you list host patterns like
*.github.comordocs.example.com/api. Left-clicking a chat link that matches opens it in the integrated browser; modifier- and middle-clicks still open externally, and everything else behaves as before.*.domain.com; a leading*.matches the apex and any subdomain, anything else matches exactly.ClientSettingswith parsing/validation in the web app, so a bad persisted entry can never break settings decoding.🤖 Generated with Claude Code
Note
Low Risk
Scoped to Electron chat link clicks and optional client settings; invalid patterns are ignored at match time and schema stays permissive.
Overview
Adds user-configurable integrated browser link patterns so matching chat URLs open in the in-app browser panel (Electron) instead of the system browser on a normal left-click.
Settings & persistence: New
integratedBrowserUrlPatternsonClientSettings(default[], trimmed non-empty strings only). General settings get an Electron-only Integrated browser links editor to add/remove patterns; search hides that item on web, and restore/reset includes the list.Pattern engine: New
integratedBrowserLinkPatternshelpers parse/normalize host + optional path patterns (*.subdomains, segment-boundary paths, bare domains →*.domain.com), with unit tests.Chat behavior:
ChatMarkdownintercepts external link clicks when preview is available: modifier/middle-clicks unchanged; if the href matches configured patterns, opens integrated preview and falls back to external open on failure. Context-menu preview path shares the same failure reporting helper.Reviewed by Cursor Bugbot for commit 80af8e4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Open chat links matching configured site patterns in the integrated browser
integratedBrowserUrlPatternstoClientSettingsSchemaas a list of URL patterns (host + optional path prefix) that controls which links open in the integrated browser panel instead of the system browser.integratedBrowserLinkPatterns.ts, supporting*.wildcards,wwwstripping, segment-boundary path prefixes, and case-insensitive percent-escape handling.ChatMarkdownanchor renderer to check clicked links against the configured patterns and open matches in the integrated preview, falling back to external open on failure.IntegratedBrowserLinksSetting.tsx(desktop only) to add/remove patterns, with canonicalization and duplicate prevention on add.Macroscope summarized 80af8e4.