fix(ui): stabilize mobile keyboard viewport handling (#1026)

* fix(ui): stabilize mobile keyboard viewport handling

* fix(ui): tighten mobile keyboard viewport handling

* Avoid redundant keyboard open store writes

---------

Co-authored-by: vhqtvn <8930337+vhqtvn@users.noreply.github.com>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
vhqtvn
2026-04-25 20:58:40 +03:00
committed by GitHub
co-authored by vhqtvn Bohdan Triapitsyn
parent 33b1b67514
commit 87db2ea210
8 changed files with 313 additions and 10 deletions
+7
View File
@@ -482,6 +482,7 @@ interface UIStore {
pendingFileNavigation: PendingFileNavigation | null;
pendingFileFocusPath: string | null;
isMobile: boolean;
isKeyboardOpen: boolean;
isQuickOpenOpen: boolean;
isCommandPaletteOpen: boolean;
isHelpDialogOpen: boolean;
@@ -636,6 +637,7 @@ interface UIStore {
setPadding: (size: number) => void;
setCornerRadius: (radius: number) => void;
setInputBarOffset: (offset: number) => void;
setKeyboardOpen: (open: boolean) => void;
applyTypography: () => void;
applyPadding: () => void;
updateProportionalSidebarWidths: () => void;
@@ -722,6 +724,7 @@ export const useUIStore = create<UIStore>()(
pendingFileNavigation: null,
pendingFileFocusPath: null,
isMobile: false,
isKeyboardOpen: false,
isQuickOpenOpen: false,
isCommandPaletteOpen: false,
isHelpDialogOpen: false,
@@ -1467,6 +1470,10 @@ export const useUIStore = create<UIStore>()(
set({ inputBarOffset: offset });
},
setKeyboardOpen: (open) => {
set((state) => state.isKeyboardOpen === open ? state : { isKeyboardOpen: open });
},
toggleFavoriteModel: (providerID, modelID) => {
set((state) => {
const exists = state.favoriteModels.some(