Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

present-mode: On toggle success, focus back to active split

Caleb Taylor3e70f21eb93b
diff --git a/js/app/packages/app/component/dock/Dock.tsx b/js/app/packages/app/component/dock/Dock.tsx
index 860eb4e95b..24688ed5ab 100644
--- a/js/app/packages/app/component/dock/Dock.tsx
+++ b/js/app/packages/app/component/dock/Dock.tsx
@@ -40,6 +40,7 @@ export function Dock() {
const { settingsOpen } = useSettingsState();
const toggleRightPanel = useToggleRightPanel();
const isRightPanelCollapsed = () => !isRightPanelOpen();
+ const activeSplitId = createMemo(() => globalSplitManager()?.activeSplitId());
const notificationSource = useGlobalNotificationSource();
@@ -88,6 +89,7 @@ export function Dock() {
// IE/Edge
await (element as any).msRequestFullscreen();
}
+ focusActiveSplit();
} catch (error) {
console.error('Error entering present mode:', error);
}
@@ -107,11 +109,21 @@ export function Dock() {
// IE/Edge
await (document as any).msExitFullscreen();
}
+ focusActiveSplit();
} catch (error) {
console.error('Error exiting present mode:', error);
}
};
+ const focusActiveSplit = () => {
+ const id = activeSplitId();
+ if (!id) return null;
+ const splitEl = document.querySelector(
+ `[data-split-id="${id}"]`
+ ) as HTMLElement;
+ splitEl?.focus();
+ };
+
const togglePresentMode = () => {
if (isPresentMode()) {
exitPresentMode();