The best way to control Claude Code, Codex and more from any computer or phone
fix(ux): spamming cmd + , no longer stack opening settings (#2757)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
James committed
Jul 18, 2026 at 07:20 UTC
143b9c9280015f0ff9fa70cd9e4edb18e975c94d
1 file changed
+9
-3
apps/web/src/components/AppSidebarLayout.tsx
+9
-3
@@ -1,6 +1,6 @@
1
import { useAtomValue } from "@effect/atom-react";
2
-import { useEffect, useState, type CSSProperties, type ReactNode } from "react";
3
-import { useNavigate } from "@tanstack/react-router";
2
+import { useEffect, useRef, useState, type CSSProperties, type ReactNode } from "react";
3
+import { useLocation, useNavigate } from "@tanstack/react-router";
4
5
import { isElectron } from "../env";
6
import { resolveShortcutCommand, shortcutLabelForCommand } from "../keybindings";
@@ -55,6 +55,9 @@ function SidebarControl() {
55
56
export function AppSidebarLayout({ children }: { children: ReactNode }) {
57
const navigate = useNavigate();
58
+ const pathname = useLocation({ select: (location) => location.pathname });
59
+ const pathnameRef = useRef(pathname);
60
+ pathnameRef.current = pathname;
61
const isMacosDesktop = isElectron && isMacPlatform(navigator.platform);
62
const [isWindowFullscreen, setIsWindowFullscreen] = useState(() => {
63
const getWindowFullscreenState = window.desktopBridge?.getWindowFullscreenState;
@@ -92,7 +95,10 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
95
96
const unsubscribe = onMenuAction((action) => {
97
if (action === "open-settings") {
95
- void navigate({ to: "/settings" });
98
+ const isSettingsRoute = /^\/settings(\/|$)/.test(pathnameRef.current);
99
+ if (!isSettingsRoute) {
100
+ void navigate({ to: "/settings" });
101
+ }
102
}
103
});
104