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): stop listing recent create options twice (#8510)

Jacob Beckerman769e22d04456
diff --git a/apps/web/src/features/command/core/create-menu-details.ts b/apps/web/src/features/command/core/create-menu-details.ts
index 5c3ea94161..6b619d1f75 100644
--- a/apps/web/src/features/command/core/create-menu-details.ts
+++ b/apps/web/src/features/command/core/create-menu-details.ts
@@ -250,13 +250,18 @@ export function groupCreateMenuItems(
return sections.filter((section) => section.items.length > 0);
}
-/** Recent choices appear first and remain available in their categories. */
+/**
+ * Recent choices appear first and leave their categories: the list shows no
+ * section headers, so a second copy would read as a duplicate.
+ */
export function groupRecentCreateMenuItems(
items: CreatableBlock[],
recentItems: CreatableBlock[]
): CreateMenuSection[] {
const recent = recentItems.filter((item) => items.includes(item));
- const categories = groupCreateMenuItems(items);
+ const categories = groupCreateMenuItems(
+ items.filter((item) => !recent.includes(item))
+ );
return recent.length
? [
{
diff --git a/apps/web/src/features/command/core/launcher-history.test.ts b/apps/web/src/features/command/core/launcher-history.test.ts
index 9cf3b9f71f..71bd9ba1f9 100644
--- a/apps/web/src/features/command/core/launcher-history.test.ts
+++ b/apps/web/src/features/command/core/launcher-history.test.ts
@@ -41,12 +41,9 @@ describe('launcher recent usage', () => {
).toEqual([
['Recents', ['Email', 'Task', 'Folder']],
['Docs', ['Document', 'Snippet']],
- ['Organization', ['Folder']],
- ['Comms', ['Email']],
- ['Tasks', ['Task']],
]);
expect(sections.flatMap((section) => section.items)).toHaveLength(
- items.length + recent.length
+ items.length
);
});
@@ -74,7 +71,6 @@ describe('launcher recent usage', () => {
).toEqual([
['Recents', ['Task']],
['Docs', ['Document']],
- ['Tasks', ['Task']],
]);
expect(groupRecentCreateMenuItems([], [email, task])).toEqual([]);
});
diff --git a/apps/web/src/lib/graphql-cache/worker/effect-worker-transport.test.ts b/apps/web/src/lib/graphql-cache/worker/effect-worker-transport.test.ts
index b3a3cb2596..0a6ea470ad 100644
--- a/apps/web/src/lib/graphql-cache/worker/effect-worker-transport.test.ts
+++ b/apps/web/src/lib/graphql-cache/worker/effect-worker-transport.test.ts
@@ -50,8 +50,9 @@ class FakeMessagePort extends EventTarget {
}
}
-const flush = () => new Promise<void>((resolve) => setTimeout(resolve, 0));
-
+// Effect resumes fibers with setImmediate under Node, which can fire after a
+// setTimeout(0) (including the one that resolves `ready`), so assertions on
+// delivered frames wait for them instead of assuming one timer tick suffices.
describe('Effect worker transport', () => {
it('buffers sends until ready and preserves their order', async () => {
const endpoint = new FakeMessagePort();
@@ -68,14 +69,15 @@ describe('Effect worker transport', () => {
endpoint.ready();
await transport.ready;
- expect(endpoint.sent.map(({ message }) => message)).toEqual([
- [EFFECT_WORKER_REQUEST_TAG, 'first'],
- [EFFECT_WORKER_REQUEST_TAG, 'second'],
- ]);
+ await vi.waitFor(() =>
+ expect(endpoint.sent.map(({ message }) => message)).toEqual([
+ [EFFECT_WORKER_REQUEST_TAG, 'first'],
+ [EFFECT_WORKER_REQUEST_TAG, 'second'],
+ ])
+ );
endpoint.emit({ kind: 'response' });
- await flush();
- expect(received).toEqual([{ kind: 'response' }]);
+ await vi.waitFor(() => expect(received).toEqual([{ kind: 'response' }]));
await Effect.runPromise(transport.close());
});
@@ -159,6 +161,7 @@ describe('Effect worker transport', () => {
await Effect.runPromise(
transport.send({ port: channel.port1 }, [channel.port1])
);
+ await vi.waitFor(() => expect(endpoint.sent).toHaveLength(1));
const framed = endpoint.sent[0]?.message as
| [number, { port: MessagePort }]
| undefined;
@@ -203,13 +206,13 @@ describe('Effect worker transport', () => {
await parent.ready;
Effect.runSync(parent.send({ kind: 'request' }));
- await flush();
- expect(runnerMessage).toEqual({ kind: 'request' });
+ await vi.waitFor(() => expect(runnerMessage).toEqual({ kind: 'request' }));
expect(runnerPortId).toBe(0);
Effect.runSync(runner.send(0, { kind: 'response' }));
- await flush();
- expect(parentMessages).toEqual([{ kind: 'response' }]);
+ await vi.waitFor(() =>
+ expect(parentMessages).toEqual([{ kind: 'response' }])
+ );
await Effect.runPromise(
Effect.all([parent.close(), runner.close()], { discard: true })
diff --git a/docs/agent-guide/navigation.md b/docs/agent-guide/navigation.md
index c832c12266..3e14d4fb96 100644
--- a/docs/agent-guide/navigation.md
+++ b/docs/agent-guide/navigation.md
@@ -537,13 +537,13 @@ entry open the detailed launcher at standard dialog width. Selecting **Create**
closes the command menu and hands focus to the launcher; individual creation
commands remain searchable in the command menu. The left side is one continuous
list without section labels or gaps. Up to three recently used choices appear
-first, followed by all choices in this order: **Docs** (Document, Snippet), **Organization**
+first, followed by the remaining choices in this order: **Docs** (Document, Snippet), **Organization**
(Folder), **Design** (Canvas, Design, Photoshop file, Illustrator file), **Data**
(Database, Spreadsheet, Form), **Comms** (Email, Message, Channel, Call), **Tasks**
(Task, Project, Reminder), **AI** (Agent, Routine, Skill), and **Other** (Code and
any uncategorized entries). Only available entries appear.
-Recent items also remain in their normal positions. With no history, the list
-starts with Document. Hover or keyboard navigation updates the right detail panel;
+Recent items appear only at the top, not again in their categories. With no
+history, the list starts with Document. Hover or keyboard navigation updates the right detail panel;
click a row or press Enter to start that creation flow. List icons are monochrome:
muted normally and full ink on the selected row. The detail panel centers
its block-colored icon tile with a solid theme-aware fill and shared glass rim,
@@ -567,8 +567,9 @@ holding Shift uses the same new-split behavior where supported.
The **Search mode** toggle (or **/**) switches between direct entity shortcuts
shown beside each choice and the standard create search input. Search mode is
-the default; the preference persists across opens. Search filters both Recents and categories. Up/Down moves
-through the displayed order and scrolls the selected row into view; Left/Right
+the default; the preference persists across opens. Search filters both Recents
+and categories; a recent choice appears only under Recents, not again in its
+category. Up/Down moves through the displayed order and scrolls the selected row into view; Left/Right
edits the search input. Enter creates the selected item, Shift+Enter opens it in a
new split where supported, and Escape closes the launcher. Typing in search mode
never runs an entity shortcut. Switching modes preserves selection and dimensions.