From f4de338bc32b8aa315ae779e17dc4d6432192e39 Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Wed, 11 Dec 2024 13:13:40 -0800 Subject: [PATCH] add a refocus at the end of wave reinit (#1499) --- frontend/app/store/keymodel.ts | 5 +++++ frontend/wave.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/frontend/app/store/keymodel.ts b/frontend/app/store/keymodel.ts index 56448b3fb..2cb4e87e0 100644 --- a/frontend/app/store/keymodel.ts +++ b/frontend/app/store/keymodel.ts @@ -142,6 +142,10 @@ function switchTab(offset: number) { } function handleCmdI() { + globalRefocus(); +} + +function globalRefocus() { const layoutModel = getLayoutModelForStaticTab(); const focusedNode = globalStore.get(layoutModel.focusedNode); if (focusedNode == null) { @@ -345,6 +349,7 @@ export { appHandleKeyDown, getAllGlobalKeyBindings, getSimpleControlShiftAtom, + globalRefocus, registerControlShiftStateUpdateHandler, registerElectronReinjectKeyHandler, registerGlobalKeys, diff --git a/frontend/wave.ts b/frontend/wave.ts index e69a1663f..ed2baddae 100644 --- a/frontend/wave.ts +++ b/frontend/wave.ts @@ -3,6 +3,7 @@ import { App } from "@/app/app"; import { + globalRefocus, registerControlShiftStateUpdateHandler, registerElectronReinjectKeyHandler, registerGlobalKeys, @@ -106,6 +107,9 @@ async function reinitWave() { getApi().setWindowInitStatus("wave-ready"); globalStore.set(atoms.reinitVersion, globalStore.get(atoms.reinitVersion) + 1); globalStore.set(atoms.updaterStatusAtom, getApi().getUpdaterStatus()); + setTimeout(() => { + globalRefocus(); + }, 50); } function reloadAllWorkspaceTabs(ws: Workspace) {