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.

fix(soup-view): defer auto-focus to break focus/setActiveScope loop (#3585)

gbirman309a5498453f
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index f4ba417d90..8a65f266f0 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -660,11 +660,13 @@ export const SoupViewList = (props: SoupViewListProps) => {
const previewPanel = useMaybePreviewPanel();
- // Auto focus the soup on mount except when it's in a preview panel
+ // Defer .focus() so the hotkey focusin handler's setActiveScope write doesn't re-invalidate this effect from inside its own tracking scope.
createEffect(() => {
if (previewPanel) return;
- soupViewRef()?.focus();
+ const ref = soupViewRef();
+ if (!ref) return;
+ queueMicrotask(() => ref.focus());
});
const [attachHotkeys, soupViewScope] = useHotkeyDOMScope('soup-view');