fix(ui): allow escape to close mobile settings (#1144)
Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
committed by
GitHub
co-authored by
Isaac Sanchez
parent
71e902fec6
commit
4ac5d7699a
@@ -403,11 +403,6 @@ export const useKeyboardShortcuts = () => {
|
|||||||
target?.getAttribute('data-terminal-hidden-input') === 'true'
|
target?.getAttribute('data-terminal-hidden-input') === 'true'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isInsideDialog || isSettingsMounted || isInsideTerminal) {
|
|
||||||
resetAbortPriming();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isSettingsDialogOpen,
|
isSettingsDialogOpen,
|
||||||
isCommandPaletteOpen,
|
isCommandPaletteOpen,
|
||||||
@@ -419,6 +414,11 @@ export const useKeyboardShortcuts = () => {
|
|||||||
activeMainTab,
|
activeMainTab,
|
||||||
} = useUIStore.getState();
|
} = useUIStore.getState();
|
||||||
|
|
||||||
|
if (isInsideDialog || isInsideTerminal) {
|
||||||
|
resetAbortPriming();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If settings is open, close it
|
// If settings is open, close it
|
||||||
if (isSettingsDialogOpen) {
|
if (isSettingsDialogOpen) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -427,6 +427,11 @@ export const useKeyboardShortcuts = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isSettingsMounted) {
|
||||||
|
resetAbortPriming();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if any overlay is open or not on chat tab - don't process abort
|
// Check if any overlay is open or not on chat tab - don't process abort
|
||||||
const hasOverlay = isCommandPaletteOpen || isHelpDialogOpen || isSessionSwitcherOpen || isAboutDialogOpen || isMultiRunLauncherOpen || isImagePreviewOpen;
|
const hasOverlay = isCommandPaletteOpen || isHelpDialogOpen || isSessionSwitcherOpen || isAboutDialogOpen || isMultiRunLauncherOpen || isImagePreviewOpen;
|
||||||
const isChatActive = activeMainTab === 'chat';
|
const isChatActive = activeMainTab === 'chat';
|
||||||
|
|||||||
Reference in New Issue
Block a user