The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 03:00 UTC
fix(web): Integrations settings show one Browser section, not two (#18264)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Rakshith Bhat committed
Oct 19, 2026 at 10:33 UTC
7e1a5a38b5d2f74f869dbc90e6d2e15946b84c80
4 files changed
+59
-59
apps/web/src/components/settings/IntegrationsSettings.browser.test.tsx
+13
-4
@@ -8,6 +8,9 @@ import {
8
import { act, StrictMode } from "react";
9
import { createRoot, type Root } from "react-dom/client";
10
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
11
+import { page } from "vite-plus/test/browser";
12
+
13
+import "../../index.css";
14
15
const { listBrowserImportSources } = vi.hoisted(() => ({
16
listBrowserImportSources: vi.fn().mockResolvedValue([]),
@@ -36,10 +39,6 @@ vi.mock(import("../../hooks/useSettings"), async (original) => ({
39
usePrimarySettings: (() => DEFAULT_UNIFIED_SETTINGS) as never,
40
useUpdatePrimarySettings: (() => vi.fn()) as never,
41
}));
39
-vi.mock(import("./ProjectDefaultsSettings"), async (original) => ({
40
- ...(await original()),
41
- ProjectDefaultsSettings: (() => null) as never,
42
-}));
42
vi.mock(import("./SettingsScopeContext"), async (original) => ({
43
...(await original()),
44
useSettingsScope: (() => ({
@@ -90,6 +89,16 @@ async function openSettings() {
89
}
90
91
describe("Integrations browser discovery", () => {
92
+ it("keeps agent browser access in the single Browser section", async () => {
93
+ await openSettings();
94
+
95
+ expect(page.getByRole("heading", { name: "Browser", exact: true }).elements()).toHaveLength(1);
96
+ const access = page.getByRole("switch", { name: "Agent browser access", exact: true });
97
+ await expect.element(access).toBeVisible();
98
+ expect(access.element().closest("section")).toBe(container.querySelector("section#browser"));
99
+ expect(access.element().closest("#agent-browser-access")).not.toBeNull();
100
+ });
101
+
102
it("does not scan browser files when entering or revisiting settings", async () => {
103
await openSettings();
104
expect(listBrowserImportSources).not.toHaveBeenCalled();
apps/web/src/components/settings/IntegrationsSettings.tsx
+42
-2
@@ -19,6 +19,7 @@ import {
19
DEFAULT_BROWSER_VIEWPORT,
20
DEFAULT_PREVIEW_APPEARANCE,
21
DEFAULT_PREVIEW_ZOOM_FACTOR,
22
+ DEFAULT_SERVER_SETTINGS,
23
FILL_PREVIEW_VIEWPORT,
24
PREVIEW_VIEWPORT_MAX_AREA,
25
PREVIEW_VIEWPORT_MAX_DIMENSION,
@@ -111,7 +112,6 @@ import {
112
SettingsSection,
113
} from "./settingsLayout";
114
import { searchableSetting } from "./settingsSearch";
114
-import { ProjectDefaultsSettings } from "./ProjectDefaultsSettings";
115
import { useSettingsScope } from "./SettingsScopeContext";
116
import { BrowserImportWizard, type WizardTarget } from "./BrowserImportWizard";
117
import type { ImportOutcome } from "./browserImportWizard.logic";
@@ -971,6 +971,46 @@ export function DeviceIntegrationControls({
971
);
972
}
973
974
+function AgentBrowserAccessSetting() {
975
+ const { scope } = useSettingsScope();
976
+ const settings = useScopedSettings();
977
+ const updateSettings = useUpdateScopedSettings();
978
+ const isProjectScope = scope.kind === "project" || scope.kind === "checkout";
979
+
980
+ return (
981
+ <SettingsRow
982
+ serverScoped
983
+ settingKeys={["enableAgentBrowserAccess"]}
984
+ {...searchableSetting("agent-browser-access")}
985
+ description={
986
+ isProjectScope
987
+ ? "Allow agents in this project to use the shared browser. Applies when the agent session next starts."
988
+ : "Allow agents to use the shared browser. Projects can override it."
989
+ }
990
+ resetAction={
991
+ settings.enableAgentBrowserAccess !== DEFAULT_SERVER_SETTINGS.enableAgentBrowserAccess ? (
992
+ <SettingResetButton
993
+ label="default browser access"
994
+ onClick={() =>
995
+ updateSettings({
996
+ enableAgentBrowserAccess: DEFAULT_SERVER_SETTINGS.enableAgentBrowserAccess,
997
+ })
998
+ }
999
+ />
1000
+ ) : null
1001
+ }
1002
+ control={
1003
+ <ScopedSwitch
1004
+ settingKeys={["enableAgentBrowserAccess"]}
1005
+ aria-label="Agent browser access"
1006
+ checked={settings.enableAgentBrowserAccess}
1007
+ onCheckedChange={(enabled) => updateSettings({ enableAgentBrowserAccess: enabled })}
1008
+ />
1009
+ }
1010
+ />
1011
+ );
1012
+}
1013
+
1014
function BrowserAutoShowFloatingPreviewSetting({ disabled }: { readonly disabled: boolean }) {
1015
const autoShow = useClientSettings((settings) => settings.browserAutoShowFloatingPreview);
1016
const updateSettings = useUpdatePrimarySettings();
@@ -1485,8 +1525,8 @@ export function IntegrationsSettingsPanel() {
1525
1526
return (
1527
<SettingsPageContainer>
1488
- <ProjectDefaultsSettings category="integrations" />
1528
<SettingsSection id="browser" title="Browser">
1529
+ <AgentBrowserAccessSetting />
1530
{previewDefaultsDisabled ? (
1531
<SettingsUnavailableGroup message="Only available in the desktop app.">
1532
{previewDefaults}
apps/web/src/components/settings/ProjectDefaultsSettings.tsx
+3
-52
@@ -81,7 +81,6 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
81
const PermissionIcon = runtimeModeConfig[settings.defaultRuntimeMode].icon;
82
const mixedWorkspace = useScopedSettingsMixed(["defaultThreadEnvMode"]);
83
const mixedSubmodules = useScopedSettingsMixed(["worktreeSubmodules"]);
84
- const mixedBrowser = useScopedSettingsMixed(["enableAgentBrowserAccess"]);
84
const mixedAutoPull = useScopedSettingsMixed(["defaultAutoPull"]);
85
const mixedAgentCredits = useScopedSettingsMixed(["removeAgentCreditsOnMerge"]);
86
const mixedMergeMethod = useScopedSettingsMixed(["pullRequestMergeMethod"]);
@@ -251,20 +250,8 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
250
251
return (
252
<SettingsSection
254
- id={
255
- category === "general" || category === "project"
256
- ? "project-defaults"
257
- : category === "integrations"
258
- ? "browser-access"
259
- : "source-control-defaults"
260
- }
261
- title={
262
- category === "general" || category === "project"
263
- ? "New threads"
264
- : category === "integrations"
265
- ? "Browser"
266
- : "Repositories"
267
- }
253
+ id={category === "source-control" ? "source-control-defaults" : "project-defaults"}
254
+ title={category === "source-control" ? "Repositories" : "New threads"}
255
>
256
{category === "project" ? (
257
<>
@@ -383,7 +370,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
370
}
371
/>
372
</>
386
- ) : category === "source-control" ? (
373
+ ) : (
374
<>
375
<SettingsRow
376
serverScoped
@@ -489,42 +476,6 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
476
}
477
/>
478
</>
492
- ) : (
493
- <>
494
- <SettingsRow
495
- serverScoped
496
- settingKeys={["enableAgentBrowserAccess"]}
497
- mixed={mixedBrowser}
498
- id={searchableSetting("agent-browser-access").id}
499
- title="Agent browser access"
500
- description={
501
- isProjectScope
502
- ? "Allow agents in this project to use the shared browser. Applies when the agent session next starts."
503
- : "Allow agents to use the shared browser. Projects can override it."
504
- }
505
- resetAction={
506
- settings.enableAgentBrowserAccess !==
507
- DEFAULT_SERVER_SETTINGS.enableAgentBrowserAccess ? (
508
- <SettingResetButton
509
- label="default browser access"
510
- onClick={() =>
511
- updateSettings({
512
- enableAgentBrowserAccess: DEFAULT_SERVER_SETTINGS.enableAgentBrowserAccess,
513
- })
514
- }
515
- />
516
- ) : null
517
- }
518
- control={
519
- <Switch
520
- aria-label="Agent browser access"
521
- mixed={mixedBrowser}
522
- checked={mixedBrowser ? false : settings.enableAgentBrowserAccess}
523
- onCheckedChange={(enabled) => updateSettings({ enableAgentBrowserAccess: enabled })}
524
- />
525
- }
526
- />
527
- </>
479
)}
480
</SettingsSection>
481
);
apps/web/src/components/settings/ProjectSettingsPanel.tsx
+1
-1
@@ -59,7 +59,7 @@ function memberKey(member: { environmentId: string; id: string }): string {
59
return `${member.environmentId}:${member.id}`;
60
}
61
62
-export type ProjectSettingsCategory = "general" | "integrations" | "source-control" | "project";
62
+export type ProjectSettingsCategory = "general" | "source-control" | "project";
63
64
export function ProjectSettingsPanel({
65
projectKey,