diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx index 89d52c87b2827..c97f9cfba6249 100644 --- a/apps/web/src/components/AppSidebarLayout.tsx +++ b/apps/web/src/components/AppSidebarLayout.tsx @@ -200,6 +200,7 @@ function SidebarControl() { } function NavigationHistoryShortcuts() { + const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" }); const keybindings = useAtomValue(primaryServerKeybindingsAtom); const routeThreadRef = useThreadRouteRef(); @@ -228,6 +229,7 @@ function NavigationHistoryShortcuts() { : false, editableFocus: isEditableFocused(event.target), modelPickerOpen: isModelPickerOpen(), + usagePageOpen, }, }); if (command !== "navigation.back" && command !== "navigation.forward") return; @@ -240,7 +242,7 @@ function NavigationHistoryShortcuts() { window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); - }, [keybindings, routeThreadRef]); + }, [keybindings, routeThreadRef, usagePageOpen]); return null; } diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx index dd6db0fc6ac52..dbb60aa90d058 100644 --- a/apps/web/src/components/CommandPalette.tsx +++ b/apps/web/src/components/CommandPalette.tsx @@ -486,6 +486,7 @@ function useSortedProjectGroups(environmentLabelById: ReadonlyMap location.pathname === "/usage" }); const [state, dispatch] = useReducer(reduceCommandPaletteUiState, { open: false, mode: "command", @@ -536,6 +537,7 @@ export function CommandPalette({ children }: { children: ReactNode }) { previewFocus: isPreviewFocused(), previewOpen, modelPickerOpen: composerHandleRef.current?.isModelPickerOpen() ?? false, + usagePageOpen, }, }); if (command === "appearance.cycle") { @@ -601,6 +603,7 @@ export function CommandPalette({ children }: { children: ReactNode }) { theme, themeHalves, toggleMode, + usagePageOpen, ]); useEffect(