Make sidebar shortcuts leave focus mode (#2717)

* fix(app): exit focus mode for sidebar shortcuts

Focus mode kept sidebar actions hidden after their handlers ran. Exit only after a sidebar action is handled so the requested action still takes effect.

* fix(app): order focus exit before sidebar action

Leave focus mode before dispatching the sidebar command so its handler runs against the visible panel state.

* fix(app): preserve focus mode outside workspaces

Only exit active workspace focus mode after a sidebar shortcut is handled. Keep persisted focus state unchanged when the shortcut has no foreground workspace target.
This commit is contained in:
Mohamed Boudra
2026-08-01 11:16:48 +02:00
committed by GitHub
parent 70ed70d36e
commit 6177d85e99
4 changed files with 78 additions and 7 deletions
@@ -90,6 +90,7 @@ export interface PanelState {
// Actions
toggleFocusMode: () => void;
exitFocusMode: () => void;
showMobileAgent: () => void;
showMobileAgentList: () => void;
toggleMobileAgentList: () => void;
@@ -157,6 +158,13 @@ export const usePanelStore = create<PanelState>()(
desktop: { ...state.desktop, focusModeEnabled: !state.desktop.focusModeEnabled },
})),
exitFocusMode: () =>
set((state) =>
state.desktop.focusModeEnabled
? { desktop: { ...state.desktop, focusModeEnabled: false } }
: state,
),
showMobileAgent: () => set((state) => setMobilePanelTargetPatch(state, "agent")),
showMobileAgentList: () => set((state) => setMobilePanelTargetPatch(state, "agent-list")),