Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/src/components/AppSidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function SidebarControl() {
}

function NavigationHistoryShortcuts() {
const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" });
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
const routeThreadRef = useThreadRouteRef();

Expand Down Expand Up @@ -228,6 +229,7 @@ function NavigationHistoryShortcuts() {
: false,
editableFocus: isEditableFocused(event.target),
modelPickerOpen: isModelPickerOpen(),
usagePageOpen,
},
});
if (command !== "navigation.back" && command !== "navigation.forward") return;
Expand All @@ -240,7 +242,7 @@ function NavigationHistoryShortcuts() {

window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
}, [keybindings, routeThreadRef]);
}, [keybindings, routeThreadRef, usagePageOpen]);

return null;
}
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ function useSortedProjectGroups(environmentLabelById: ReadonlyMap<EnvironmentId,

export function CommandPalette({ children }: { children: ReactNode }) {
const navigate = useNavigate();
const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" });
const [state, dispatch] = useReducer(reduceCommandPaletteUiState, {
open: false,
mode: "command",
Expand Down Expand Up @@ -536,6 +537,7 @@ export function CommandPalette({ children }: { children: ReactNode }) {
previewFocus: isPreviewFocused(),
previewOpen,
modelPickerOpen: composerHandleRef.current?.isModelPickerOpen() ?? false,
usagePageOpen,
},
});
if (command === "appearance.cycle") {
Expand Down Expand Up @@ -601,6 +603,7 @@ export function CommandPalette({ children }: { children: ReactNode }) {
theme,
themeHalves,
toggleMode,
usagePageOpen,
]);

useEffect(
Expand Down
Loading