From adc991cc2a6333fb35a06d8187c51674bf00edc1 Mon Sep 17 00:00:00 2001 From: Bob Lee Date: Fri, 6 Nov 2026 19:07:54 +0800 Subject: [PATCH 1/3] feat(settings): choose the default browser for conversation links --- src/web-ui/README.md | 13 ++++ src/web-ui/README.zh-CN.md | 10 +++ src/web-ui/src/app/scenes/settings/AGENTS.md | 10 +++ .../tools/BrowserLinkSettingsSection.tsx | 30 +++++++++ .../pages/tools/DeviceControlSettingsPage.tsx | 2 + .../app/scenes/settings/settingsRegistry.ts | 5 ++ .../services/browserLinkPreference.test.ts | 36 ++++++++++ .../config/services/browserLinkPreference.ts | 33 +++++++++ .../markdown/MarkdownRenderer.test.tsx | 67 +++++++++++++++++++ .../markdown/MarkdownRenderer.tsx | 7 +- .../src/locales/en-US/settings/runtime.json | 7 ++ .../src/locales/zh-CN/settings/runtime.json | 7 ++ .../src/locales/zh-TW/settings/runtime.json | 7 ++ 13 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 src/web-ui/src/app/scenes/settings/pages/tools/BrowserLinkSettingsSection.tsx create mode 100644 src/web-ui/src/infrastructure/config/services/browserLinkPreference.test.ts create mode 100644 src/web-ui/src/infrastructure/config/services/browserLinkPreference.ts diff --git a/src/web-ui/README.md b/src/web-ui/README.md index a44744cf6c..0692e01892 100644 --- a/src/web-ui/README.md +++ b/src/web-ui/README.md @@ -24,6 +24,19 @@ Numbered tab selection, reopening a closed tab and layout shortcuts also stay with their owning canvas. Recording a new binding in Settings captures the key without executing the existing command. +## Opening web links + +In **Settings → Tools → Browser & desktop control → Web links**, choose whether +conversation links open in the **Built-in browser** or the **System default +browser**. The choice applies immediately and is saved on this device, including +while viewing remote workspaces or switching peers. Existing installs keep the +built-in default until you change it. + +Right-click a link to choose either browser for that click. Modifier-clicks +continue to open the external browser; supported PR/MR links keep their review +panel behavior. This preference does not change the browser used by agent +browser control, or the separate mobile/IM and headless dispatch surfaces. + ## Creating a project The sidebar's add button opens two clickable cards without footer actions. diff --git a/src/web-ui/README.zh-CN.md b/src/web-ui/README.zh-CN.md index dc2a3c6c29..e163f20d33 100644 --- a/src/web-ui/README.zh-CN.md +++ b/src/web-ui/README.zh-CN.md @@ -21,6 +21,16 @@ 数字切换标签、重新打开标签和布局快捷键也只作用于当前画布。 在设置页录入新快捷键时,按键用于录入,不会执行原有命令。 +## 打开网页链接 + +在 **设置 → 工具 → 浏览器与桌面控制 → 网页链接** 中,选择对话中的链接默认使用 +**内置浏览器** 还是 **系统默认浏览器**。修改立即生效并保存在当前设备;查看远程 +工作区或切换 Peer 设备时沿用此偏好。未设置时继续使用内置浏览器。 + +右键点击链接仍可为单次打开选择浏览器。按住修饰键点击仍使用外部浏览器;支持的 +PR/MR 链接保留评审面板入口。此设置不改变智能体浏览器控制所用的浏览器,也不 +影响独立的移动端、IM 或无界面派发任务。 + ## 创建项目 左侧导航的新增按钮展示两张可点击卡片,首层不设底部操作按钮。 diff --git a/src/web-ui/src/app/scenes/settings/AGENTS.md b/src/web-ui/src/app/scenes/settings/AGENTS.md index 3d989950bd..d48ef4f01f 100644 --- a/src/web-ui/src/app/scenes/settings/AGENTS.md +++ b/src/web-ui/src/app/scenes/settings/AGENTS.md @@ -44,6 +44,16 @@ pnpm --dir src/web-ui run test:run src/infrastructure/config/components/common/S Follow the parent guide for `check:web`, i18n, and Appearance registration checks. +For the controller-local web link preference, persistence and explicit browser actions: + +```bash +pnpm --dir src/web-ui run test:run src/infrastructure/config/services/browserLinkPreference.test.ts src/infrastructure/markdown/MarkdownRenderer.test.tsx src/infrastructure/api/service-api/SystemAPI.test.ts src/app/scenes/settings/settingsRegistry.test.ts src/infrastructure/config/components/common/SettingsControlSizing.test.ts +``` + +The link preference remains editable independently of host control status. These +storage/DOM fixtures cover remote workspace metadata and simulated Peer switches; +they do not establish native browser opening, live remote scenarios, or visual fidelity. + For keyboard shortcut recording, command suppression, IME and capture lifetime: ```bash diff --git a/src/web-ui/src/app/scenes/settings/pages/tools/BrowserLinkSettingsSection.tsx b/src/web-ui/src/app/scenes/settings/pages/tools/BrowserLinkSettingsSection.tsx new file mode 100644 index 0000000000..a6d2cb5e4b --- /dev/null +++ b/src/web-ui/src/app/scenes/settings/pages/tools/BrowserLinkSettingsSection.tsx @@ -0,0 +1,30 @@ +import { useStore } from 'zustand'; +import { Select } from '@openbitfun/ui'; +import { useI18n } from '@/infrastructure/i18n'; +import { ConfigPageRow, ConfigPageSection } from '@/infrastructure/config/components/common'; +import { browserLinkPreferenceStore } from '@/infrastructure/config/services/browserLinkPreference'; + +export default function BrowserLinkSettingsSection() { + const { t } = useI18n('settings/runtime'); + const target = useStore(browserLinkPreferenceStore, state => state.target); + const setTarget = useStore(browserLinkPreferenceStore, state => state.setTarget); + + return ( + + +