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(command-menu): hide open-in-new-split hint when split can't be appended (#3001)

gbirmancba31e8c48a0
diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsx
index 563c7a0652..c8b52b9a51 100644
--- a/js/app/packages/app/component/command/CommandMenu.tsx
+++ b/js/app/packages/app/component/command/CommandMenu.tsx
@@ -116,6 +116,9 @@ export function CommandMenuInner(props: {
const { openWithSplit } = useSplitLayout();
+ const canOpenInNewSplit = () =>
+ globalSplitManager()?.canAppendSplit() ?? false;
+
const [attachHotkeys, hotkeyScope] = useHotkeyDOMScope('command-menu');
const query = debouncedDependent(CommandState.query, 60);
@@ -486,6 +489,7 @@ export function CommandMenuInner(props: {
selectedItem={selectedItem()}
isInCommandScope={isInCommandScope()}
isEntityActionMode={isEntityActionMode()}
+ canOpenInNewSplit={canOpenInNewSplit()}
/>
</div>
);
@@ -615,6 +619,7 @@ function CommandMenuFooter(props: {
selectedItem: CommandMenuItem | undefined;
isInCommandScope: boolean;
isEntityActionMode?: boolean;
+ canOpenInNewSplit: boolean;
}) {
const isCommand = () =>
props.selectedItem && isCommandItem(props.selectedItem);
@@ -645,11 +650,15 @@ function CommandMenuFooter(props: {
</Match>
<Match when={isSearch()}>
<HotkeyHint shortcut="enter" label="Search" />
- <HotkeyHint shortcut="shift+enter" label="Search in new split" />
+ <Show when={props.canOpenInNewSplit}>
+ <HotkeyHint shortcut="shift+enter" label="Search in new split" />
+ </Show>
</Match>
<Match when={isEntity()}>
<HotkeyHint shortcut="enter" label="Open" />
- <HotkeyHint shortcut="shift+enter" label="Open in new split" />
+ <Show when={props.canOpenInNewSplit}>
+ <HotkeyHint shortcut="shift+enter" label="Open in new split" />
+ </Show>
</Match>
</Switch>