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.

feat(mentions): show task progress icons in the @mention menu and pill once (#8892)

Jacob Beckerman6861ea27145a
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index 283a727e10..6b2d83d8d4 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -543,7 +543,7 @@ phone, and tablet:
See the [download walkthrough](../../docs/agent-guide/files.md#downloading-files).
## Interface icons
-- Task rows and document mention pills use `TaskStatusIcon` with the current status property; use the task subtype completion flag only when a recognized status is unavailable. Keep generic navigation and creation icons independent of task state.
+- Task rows, document mention pills, and @mention menu rows use `TaskStatusIcon` with the current status property; use the task subtype completion flag only when a recognized status is unavailable. Mention pills show status only in that leading icon, not again among the trailing task badges. Keep generic navigation and creation icons independent of task state.
- Read [the icon system rules](src/components/icon/system/README.md) before adding or changing interface icons or icon motion. Reuse the original Macro SVG family via individual `@icon/system/...` imports; do not introduce another icon set.
- If a glyph is missing, author original SVG geometry on the 24-unit grid with round caps/joins, restrained detail, `currentColor`, and the documented theme-aware weight. Never trace or import proprietary symbol paths. Match active/bold variants and review 14/16/20/24 px in light and dark mode.
- Interactive glyphs use the shared `installIconMotion` behavior; do not add per-button bounce/spin effects. Keep state indicators static, preserve accessible control names, and honor reduced motion. See the icon README for wrapper and opt-out attributes.
diff --git a/apps/web/src/lib/core/component/InlineTaskProperties.tsx b/apps/web/src/lib/core/component/InlineTaskProperties.tsx
index 6a1537bf07..a0cbcb92e9 100644
--- a/apps/web/src/lib/core/component/InlineTaskProperties.tsx
+++ b/apps/web/src/lib/core/component/InlineTaskProperties.tsx
@@ -6,7 +6,10 @@ import type { Property } from '@property/types';
import type { PreviewDocumentProperties } from '@queries/preview/types';
import { type Accessor, createMemo, Show } from 'solid-js';
-/** Inline task badges use their preview's edges; only REST previews fetch separately. */
+/**
+ * Inline task badges use their preview's edges; only REST previews fetch separately.
+ * Status is omitted: the mention's leading `TaskStatusIcon` already shows it.
+ */
export function InlineTaskProperties(props: {
taskId: string;
previewProperties?: PreviewDocumentProperties;
@@ -39,12 +42,6 @@ function RestInlineTaskProperties(props: { taskId: string }) {
}
function InlineTaskPropertyValues(props: { properties: Accessor<Property[]> }) {
- const statusOptionId = createMemo(() => {
- const p = props
- .properties()
- .find((p) => p.propertyDefinitionId === SYSTEM_PROPERTY_IDS.STATUS);
- return p?.valueType === 'SELECT_STRING' ? p.value?.[0] : undefined;
- });
const priorityOptionId = createMemo(() => {
const p = props
.properties()
@@ -58,16 +55,11 @@ function InlineTaskPropertyValues(props: { properties: Accessor<Property[]> }) {
return p?.valueType === 'ENTITY' ? p.value?.[0]?.entity_id : undefined;
});
return (
- <Show when={statusOptionId() || priorityOptionId() || firstAssigneeId()}>
+ <Show when={priorityOptionId() || firstAssigneeId()}>
<span
data-inline-task-properties
class="inline-flex items-center gap-[0.25em] mx-[0.25em] align-middle relative top-[-0.05em]"
>
- <Show when={statusOptionId()}>
- {(id) => (
- <PropertyValueIcon optionId={id()} class="size-[0.75em] shrink-0" />
- )}
- </Show>
<Show when={priorityOptionId()}>
{(id) => (
<PropertyValueIcon optionId={id()} class="size-[0.75em] shrink-0" />
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.browser.e2e.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.browser.e2e.ts
index d25549461c..fd24c592bd 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.browser.e2e.ts
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.browser.e2e.ts
@@ -7,7 +7,7 @@ for (const viewport of [
{ name: 'desktop', width: 1280, height: 800 },
{ name: 'mobile', width: 390, height: 844 },
]) {
- test(`task rows and mentions update together on ${viewport.name}`, async ({
+ test(`task rows, mentions, and mention menu items update together on ${viewport.name}`, async ({
page,
}) => {
await page.setViewportSize(viewport);
@@ -28,16 +28,16 @@ for (const viewport of [
page
.getByRole('region', { name: 'Completion flag only', exact: true })
.getByRole('img', { name: 'Task: Completed', exact: true })
- ).toHaveCount(2);
+ ).toHaveCount(3);
await expect(
page
.getByRole('region', { name: 'Unknown status', exact: true })
.getByRole('img', { name: 'Task: Not started', exact: true })
- ).toHaveCount(2);
+ ).toHaveCount(3);
const example = page.getByRole('region', { name: status, exact: true });
await expect(
example.getByRole('img', { name: `Task: ${status}`, exact: true })
- ).toHaveCount(2);
+ ).toHaveCount(3);
}
const example = page.getByRole('region', {
name: 'In progress',
@@ -48,10 +48,10 @@ for (const viewport of [
.click();
await expect(
example.getByRole('img', { name: 'Task: Completed', exact: true })
- ).toHaveCount(2);
+ ).toHaveCount(3);
await example.getByRole('button', { name: 'Reopen', exact: true }).click();
await expect(
example.getByRole('img', { name: 'Task: Not started', exact: true })
- ).toHaveCount(2);
+ ).toHaveCount(3);
});
}
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.tsx
index 68e8a2d1de..def9d7b8a6 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.tsx
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/task-status.tsx
@@ -20,6 +20,7 @@ import { createSignal, For } from 'solid-js';
import { render } from 'solid-js/web';
import { channelTheme } from '../../../theme';
import { StaticMarkdownContext } from '../../core/StaticMarkdown';
+import { MentionsMenuItem } from '../../menu/MentionsMenu/components/MentionsMenuItem';
import { DocumentMention, DocumentMentionStatic } from '../DocumentMention';
const states = [
@@ -119,6 +120,24 @@ function StatusExample(props: {
theme={channelTheme}
/>
</div>
+ <div data-testid="task-menu-item" class="w-64 menu-surface py-1.5">
+ <MentionsMenuItem
+ item={{
+ kind: 'entity',
+ bucket: 'task',
+ id,
+ searchText: task().name,
+ sortTimestamp: 0,
+ timestamps: {},
+ data: task(),
+ }}
+ index={0}
+ selected={false}
+ itemAction={() => {}}
+ setIndex={() => {}}
+ setOpen={() => {}}
+ />
+ </div>
<Button onClick={() => update(PROPERTY_OPTION_IDS.STATUS.COMPLETED)}>
Complete
</Button>
@@ -131,7 +150,7 @@ function StatusExample(props: {
function Fixture() {
return (
- <main class="min-h-screen space-y-4 bg-page p-8 text-ink">
+ <main class="h-screen space-y-4 overflow-y-auto bg-page p-8 text-ink">
<h1 class="text-lg font-semibold">Task status — rows and mentions</h1>
<div data-testid="static-task-mention">
<DocumentMentionStatic
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.test.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.test.tsx
new file mode 100644
index 0000000000..7348036e07
--- /dev/null
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.test.tsx
@@ -0,0 +1,84 @@
+import type { TaskEntityWithProperties } from '@entity/types/entity';
+import {
+ PROPERTY_OPTION_IDS,
+ SYSTEM_PROPERTY_IDS,
+} from '@property/identifiers';
+import { render } from '@solidjs/testing-library';
+import { describe, expect, it } from 'vitest';
+import type { MentionItem } from '../../../../utils/mentionsUtils';
+import { MentionsMenuItem } from './MentionsMenuItem';
+
+const time = '2026-10-01T00:00:00Z';
+
+function taskItem(task: Partial<TaskEntityWithProperties>): MentionItem {
+ return {
+ kind: 'entity',
+ bucket: 'task',
+ id: 'task-1',
+ searchText: 'Ship it',
+ sortTimestamp: 0,
+ timestamps: {},
+ data: {
+ id: 'task-1',
+ name: 'Ship it',
+ ownerId: 'user-1',
+ type: 'document',
+ fileType: 'md',
+ subType: { type: 'task' },
+ ...task,
+ } as TaskEntityWithProperties,
+ };
+}
+
+function renderItem(item: MentionItem) {
+ return render(() => (
+ <MentionsMenuItem
+ item={item}
+ index={0}
+ selected={false}
+ itemAction={() => {}}
+ setIndex={() => {}}
+ setOpen={() => {}}
+ />
+ ));
+}
+
+describe('MentionsMenuItem task rows', () => {
+ it('shows the task progress icon for its status', () => {
+ const view = renderItem(
+ taskItem({
+ properties: [
+ {
+ id: 'status',
+ definition: {
+ id: SYSTEM_PROPERTY_IDS.STATUS,
+ display_name: 'Status',
+ data_type: 'SELECT_STRING',
+ is_metadata: false,
+ is_multi_select: false,
+ is_system: true,
+ owner: { scope: 'system' },
+ specific_entity_type: 'TASK',
+ created_at: time,
+ updated_at: time,
+ },
+ value: {
+ type: 'SelectOption',
+ value: [PROPERTY_OPTION_IDS.STATUS.IN_PROGRESS],
+ },
+ },
+ ],
+ })
+ );
+ expect(view.getByRole('img', { name: 'Task: In progress' })).toBeTruthy();
+ view.unmount();
+ });
+
+ it('falls back to the completion flag without a status', () => {
+ const view = renderItem(
+ taskItem({ subType: { type: 'task', is_completed: true } })
+ );
+ expect(view.getByRole('img', { name: 'Task: Completed' })).toBeTruthy();
+ view.unmount();
+ });
+});
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.tsx
index 685de8d04d..4b053f56b5 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.tsx
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.tsx
@@ -1,6 +1,8 @@
import { EntityIcon } from '@core/component/EntityIcon';
+import { TaskStatusIcon } from '@core/component/TaskStatusIcon';
import { UserIcon } from '@core/component/UserIcon';
-import type { ChannelEntity } from '@entity';
+import { type ChannelEntity, isTaskEntity } from '@entity/types/entity';
+import { getTaskStatusOptionId } from '@entity/utils/task-properties';
import CalendarBlankIcon from '@icon/system/regular/calendar-blank.svg';
import ClockIcon from '@icon/system/regular/clock.svg';
import EmailIcon from '@icon/system/regular/envelope.svg';
@@ -101,6 +103,15 @@ export function MentionsMenuItem(props: {
/>
);
}
+ if (isTaskEntity(props.item.data)) {
+ return (
+ <TaskStatusIcon
+ statusId={getTaskStatusOptionId(props.item.data)}
+ completed={props.item.data.subType.is_completed}
+ size="xs"
+ />
+ );
+ }
return (
<EntityIcon
targetType={getBlockNameFromEntity(props.item)}
diff --git a/apps/web/src/lib/core/component/TaskPreviewProperties.test.tsx b/apps/web/src/lib/core/component/TaskPreviewProperties.test.tsx
index 559c4a4777..0f57f3ab39 100644
--- a/apps/web/src/lib/core/component/TaskPreviewProperties.test.tsx
+++ b/apps/web/src/lib/core/component/TaskPreviewProperties.test.tsx
@@ -234,6 +234,12 @@ describe('task preview data ownership', () => {
});
it('never mounts child queries for pending or loaded GraphQL edges', () => {
+ const priority = {
+ ...status,
+ propertyDefinitionId: SYSTEM_PROPERTY_IDS.PRIORITY,
+ displayName: 'Priority',
+ value: ['priority-1'],
+ } as Property;
const [metadata, setMetadata] = createSignal<PreviewDocumentProperties>({
properties: undefined,
canEdit: false,
@@ -250,19 +256,28 @@ describe('task preview data ownership', () => {
expect(accessQuery).not.toHaveBeenCalled();
setMetadata((old) => ({ ...old, properties: [], canEdit: false }));
expect(view.container.textContent).toBe('');
- setMetadata((old) => ({ ...old, properties: [status], canEdit: true }));
- expect(view.container.textContent).toContain('status-1');
+ setMetadata((old) => ({
+ ...old,
+ properties: [status, priority],
+ canEdit: true,
+ }));
+ expect(view.container.textContent).toContain('priority-1');
+ // The mention's leading icon already shows status.
+ expect(view.container.textContent).not.toContain('status-1');
expect(view.container.querySelector('section')?.dataset.canEdit).toBe(
'true'
);
// A live property write and permission change flow through without a refetch.
setMetadata((old) => ({
...old,
- properties: [{ ...status, value: ['status-2'] } as Property],
+ properties: [
+ status,
+ { ...priority, value: ['priority-2'] } as Property,
+ ],
canEdit: false,
}));
- expect(view.container.textContent).toContain('status-2');
- expect(view.container.textContent).not.toContain('status-1');
+ expect(view.container.textContent).toContain('priority-2');
+ expect(view.container.textContent).not.toContain('priority-1');
expect(view.container.querySelector('section')?.dataset.canEdit).toBe(
'false'
);
diff --git a/docs/agent-guide/documents.md b/docs/agent-guide/documents.md
index 5bd2c7d95c..b6d2d20dc7 100644
--- a/docs/agent-guide/documents.md
+++ b/docs/agent-guide/documents.md
@@ -3034,8 +3034,9 @@ each operation; wait for saving to finish and reload to check persistence.
### Task mention status
-Task @mention pills display the same circular completion/status icon as task
-rows. The icon updates in place as preview data changes; unknown status uses
+Task @mention pills and @mention menu rows display the same circular
+completion/status icon as task rows; pills do not repeat it after the title.
+The icon updates in place as preview data changes; unknown status uses
an empty circle, and subtype-only previews use their completion flag. See
[tasks](tasks.md#task-status-icons) for states and the browser regression.
diff --git a/docs/agent-guide/images/task-status-icons.png b/docs/agent-guide/images/task-status-icons.png
index 2113add8e9..9cbb22bfeb 100644
Binary files a/docs/agent-guide/images/task-status-icons.png and b/docs/agent-guide/images/task-status-icons.png differ
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index 0f88d6a166..b2f4d325b1 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -953,16 +953,18 @@ above.
Task rows show a circular status icon: empty for Not started, partially filled
for In progress or In review, checked for Completed, and crossed for Canceled.
-Task @mention pills use the same live status and update when a task changes.
+Task @mention pills and @mention menu rows use the same live status and update
+when a task changes. Pills show status only in their leading icon; the trailing
+badges carry priority and the first assignee.
Lightweight previews fall back to the task completion flag until status
properties arrive; missing or unknown status without completion stays empty.
The navigation and creation icons remain generic task icons.
-The backend-free browser fixture exercises the real row icon and document
-mention, including completing and reopening without a reload:
+The backend-free browser fixture exercises the real row icon, document
+mention, and mention menu row, including completing and reopening without a reload:
`bunx playwright test --config src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/playwright.config.ts task-status.browser.e2e.ts`.
-![Task status icons in rows and mentions](images/task-status-icons.png)
+![Task status icons in rows, mentions, and mention menu rows](images/task-status-icons.png)
The Task, Subtask, Project, and Tag entries use a wide menu with original icons and muted descriptions. Subtask opens a parent-task picker, then the normal task composer. Saving includes the selected Parent task property; if that link cannot be confirmed, keep the created task and show a warning instead of asking the user to create it again. Canceling either step creates nothing.