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): no more solo-mode for command k from block (#2011)

Seamus296ee9828e94
diff --git a/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts b/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
index ec173780e4..c89b8aa7d6 100644
--- a/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
+++ b/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
@@ -13,7 +13,6 @@ import type {
} from '@core/component/Properties/types';
import { blockHotkeyScopeSignal } from '@core/signal/blockElement';
import { useGlobalNotificationSource } from '@app/component/GlobalAppState';
-import { CommandState } from '@app/component/command';
import { isTaskEntity, type EntityData } from '@entity';
import { createEffect, onCleanup } from 'solid-js';
import {
@@ -27,7 +26,8 @@ import {
} from './index';
/**
- * Common manipulations scoped to the current block's hotkey scope.
+ * Common manipulations scoped to the current block.
+ * This should be called and mounted
* Note: several of these do not register with an actual hot key so that they
* can be found by the command menu.
*/
@@ -42,14 +42,8 @@ export const useBlockEntityCommands = () => {
notificationSource: () => notificationSource,
});
- const deleteAction = makeDeleteAction({
- userId: () => userId(),
- });
-
- const renameAction = makeRenameAction({
- userId: () => userId(),
- });
-
+ const deleteAction = makeDeleteAction({ userId: () => userId() });
+ const renameAction = makeRenameAction({ userId: () => userId() });
const copyAction = makeCopyAction();
const moveToProjectAction = makeMoveToProjectAction();
const copyLinkAction = makeCopyLinkAction();
@@ -303,34 +297,7 @@ export const useBlockEntityCommands = () => {
tags: [HotkeyTags.SelectionModification],
}).withGroup(group);
- // CMD+K — open entity action mode for this block
- const cmdKReg = registerHotkey({
- scopeId,
- hotkey: 'cmd+k',
- description: () =>
- CommandState.isOpen() ? 'Close command menu' : 'Open command menu',
- condition: () => {
- const entity = getEntity();
- return !CommandState.isOpen() && entity !== undefined;
- },
- keyDownHandler: (e) => {
- e?.preventDefault();
- const entity = getEntity();
- if (entity) {
- CommandState.openForEntityAction([entity]);
- } else {
- CommandState.toggle();
- }
- return true;
- },
- displayPriority: 10,
- handlerPriority: 1,
- hide: CommandState.isOpen,
- runWithInputFocused: true,
- });
-
onCleanup(() => {
- cmdKReg.dispose();
group.dispose();
});
});