@devries-cameron20 / t3code Mirror · read-only / commits / 7c43155883
Fork 0

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, 13:00 UTC

fix(web): keybindings page says to connect an environment when none is connected (#19400)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 14, 2026 at 04:45 UTC 7c43155883dcfe67340611ec68719aaeb3a5f8ff
2 files changed +35 -2
apps/web/src/components/settings/KeybindingsSettings.environment.test.tsx
+32 -1
@@ -7,6 +7,7 @@ import { reactHookHarness as hooks } from "../../test/reactHookHarness";
7 const state = vi.hoisted(() => ({
8 canOperate: false,
9 canWriteSettings: true,
10 + connected: true,
11 openEditor: vi.fn(),
12 upsert: vi.fn(),
13 remove: vi.fn(),
@@ -57,7 +58,9 @@ vi.mock("./SettingsScopeContext", () => ({
58 availableEditors: [],
59 },
60 };
60 - return { environment, connectedEnvironments: [environment] };
61 + return state.connected
62 + ? { environment, connectedEnvironments: [environment] }
63 + : { environment: null, connectedEnvironments: [] };
64 },
65 }));
66
@@ -104,6 +107,7 @@ describe("KeybindingsSettings editor permission", () => {
107 hooks.reset();
108 state.canOperate = false;
109 state.canWriteSettings = true;
110 + state.connected = true;
111 state.openEditor.mockReset().mockResolvedValue({ _tag: "Success", value: undefined });
112 state.upsert.mockReset().mockResolvedValue({ _tag: "Success", value: undefined });
113 state.remove.mockReset().mockResolvedValue({ _tag: "Success", value: undefined });
@@ -141,3 +145,30 @@ describe("KeybindingsSettings editor permission", () => {
145 expect(openButton(renderPanel()).props.disabled).toBe(true);
146 });
147 });
148 +
149 +function noticeText(panel: unknown) {
150 + const notice = visitElements(panel, (element) => element.type === "p");
151 + return notice?.props.children;
152 +}
153 +
154 +describe("KeybindingsSettings write notice", () => {
155 + beforeEach(() => {
156 + hooks.reset();
157 + state.canWriteSettings = true;
158 + state.connected = true;
159 + });
160 +
161 + // The hosted app has no environment until one is paired, so the editor is
162 + // locked for a missing connection, not a missing permission.
163 + it("asks for a connected environment when none is connected", () => {
164 + state.connected = false;
165 + expect(noticeText(renderPanel())).toBe("Connect an environment to change keybindings.");
166 + });
167 +
168 + it("names the permission when the connection cannot write settings", () => {
169 + state.canWriteSettings = false;
170 + expect(noticeText(renderPanel())).toBe(
171 + "This connection can view keybindings but cannot change them.",
172 + );
173 + });
174 +});
apps/web/src/components/settings/KeybindingsSettings.tsx
+3 -1
@@ -1502,7 +1502,9 @@ export function KeybindingsSettingsPanel() {
1502
1503 {!canWriteSettings ? (
1504 <p className="text-xs text-muted-foreground">
1505 - This connection can view keybindings but cannot change them.
1505 + {connectedEnvironments.length === 0
1506 + ? "Connect an environment to change keybindings."
1507 + : "This connection can view keybindings but cannot change them."}
1508 </p>
1509 ) : null}
1510 <div inert={!canWriteSettings} className="flex flex-col gap-8">