Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): pass usage route context to global shortcut handlers #21457

Closedonly21mil(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/21457/headopened View on GitHub

Showing 2 changed files with 6 additions and 1 deletion.

x
0 of 2 viewed, 2 left
3 additions and 1 deletionapps/web/src/components/AppSidebarLayout.tsxModified
View file
@@ -200,6 +200,7 @@
​
function NavigationHistoryShortcuts() {
+ const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" });
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
const routeThreadRef = useThreadRouteRef();
​
@@ -228,6 +229,7 @@
: false,
editableFocus: isEditableFocused(event.target),
modelPickerOpen: isModelPickerOpen(),
+ usagePageOpen,
});
if (command !== "navigation.back" && command !== "navigation.forward") return;
@@ -240,7 +242,7 @@
​
window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
- }, [keybindings, routeThreadRef]);
+ }, [keybindings, routeThreadRef, usagePageOpen]);
​
return null;
3 additions and 0 deletionsapps/web/src/components/CommandPalette.tsxModified
View file