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(split-layout): route same-split popover navigations to the active split (#5185)

gbirman6319014ed567
diff --git a/apps/web/src/components/app/split-layout/layout.ts b/apps/web/src/components/app/split-layout/layout.ts
index cfedda2d2e..1b7307fddf 100644
--- a/apps/web/src/components/app/split-layout/layout.ts
+++ b/apps/web/src/components/app/split-layout/layout.ts
@@ -23,14 +23,19 @@ export function useSplitLayout() {
return;
}
+ // Navigation issued from inside a split panel (links, mentions, references)
+ // carries that panel as its source; callers outside any panel (sidebar,
+ // command menu) stay handle-less, which is what marks "external navigation"
+ // for Preview Pair routing. A popover's SplitPanelContext handle is a stub
+ // whose replace() is a no-op, so treat popover sources as handle-less too
+ // and let same-split navigation fall back to the active split.
+ const requestedHandle = options?.handle ?? splitPanelContext?.handle;
+ const handle = requestedHandle?.isPopover() ? undefined : requestedHandle;
+
return splitManager.openWithSplit(content, {
...options,
preferNewSplit,
- // Navigation issued from inside a split panel (links, mentions,
- // references) carries that panel as its source; callers outside any
- // panel (sidebar, command menu) stay handle-less, which is what marks
- // "external navigation" for Preview Pair routing.
- handle: options?.handle ?? splitPanelContext?.handle,
+ handle,
});
}