Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

feat(action-center): show status, assignee and due date at the top of the action drawer (#1101)

Cihan0f1a85bb6f81
diff --git a/web/src/components/action-center/action-drawer.test.tsx b/web/src/components/action-center/action-drawer.test.tsx
new file mode 100644
index 000000000..cd5a2a400
--- /dev/null
+++ b/web/src/components/action-center/action-drawer.test.tsx
@@ -0,0 +1,109 @@
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { NextIntlClientProvider } from 'next-intl';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import type { ActionItem } from '@/lib/actions/action-center';
+import messages from '../../../messages/en.json';
+
+/**
+ * Status, assignee and due date sit right under the drawer's header, ahead of
+ * the tabs, rather than in a footer below the content: they are what someone
+ * opening an action checks and changes first.
+ */
+
+vi.mock('@/i18n/navigation', () => ({ useRouter: () => ({ push: vi.fn() }) }));
+vi.mock('@/lib/actions/action-center', () => ({
+ addTask: vi.fn(),
+ assignAction: vi.fn(),
+ deleteTask: vi.fn(),
+ getActionDetail: vi.fn(async () => ({
+ tasks: [],
+ signals: [],
+ events: [],
+ kpis: [],
+ positionOutcome: null,
+ })),
+ setActionDueDate: vi.fn(),
+ updateActionStatus: vi.fn(),
+ updateTaskStatus: vi.fn(),
+ updateTaskTitle: vi.fn(),
+}));
+
+const { ActionDrawer } = await import('./action-drawer');
+
+(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT =
+ true;
+
+const action: ActionItem = {
+ id: 'a1',
+ actionNo: 7,
+ category: 'recover',
+ kind: 'recover_lost_citations',
+ impact: 'high',
+ status: 'in_progress',
+ payload: {},
+ kpiKeys: [],
+ assignee: null,
+ dueDate: '2026-11-01',
+ createdAt: '2026-10-15T00:00:00.000Z',
+ updatedAt: '2026-10-15T00:00:00.000Z',
+ taskTotal: 0,
+ taskCompleted: 0,
+ signalCount: 1,
+};
+
+let container: HTMLDivElement;
+let root: Root;
+
+beforeEach(() => {
+ container = document.createElement('div');
+ document.body.appendChild(container);
+ root = createRoot(container);
+});
+
+afterEach(() => {
+ act(() => root.unmount());
+ container.remove();
+});
+
+async function renderDrawer() {
+ await act(async () => {
+ root.render(
+ <NextIntlClientProvider locale="en" messages={messages} timeZone="UTC">
+ <ActionDrawer
+ brandId="b1"
+ action={action}
+ members={[]}
+ onOpenChange={() => {}}
+ onChanged={() => {}}
+ />
+ </NextIntlClientProvider>,
+ );
+ });
+}
+
+/** True when `a` comes before `b` in the document. */
+const before = (a: Element, b: Element) =>
+ Boolean(a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING);
+
+describe('ActionDrawer', () => {
+ it('puts status, assignee and due date under the header, ahead of the tabs', async () => {
+ await renderDrawer();
+ const drawer = document.body.querySelector('[role="dialog"]')!;
+ const labels = [...drawer.querySelectorAll('label')].map((l) => l.textContent);
+ expect(labels).toEqual(['Status', 'Assignee', 'Due date']);
+
+ const tabs = drawer.querySelector('nav')!;
+ for (const label of drawer.querySelectorAll('label')) {
+ expect(before(label, tabs)).toBe(true);
+ }
+ // Each field once (no second copy below the content), named by its label.
+ for (const label of drawer.querySelectorAll('label')) {
+ const control = drawer.querySelectorAll(`#${label.htmlFor}`);
+ expect(control).toHaveLength(1);
+ }
+ expect(drawer.querySelector<HTMLInputElement>('#action-drawer-due-date')!.value).toBe(
+ '2026-11-01',
+ );
+ });
+});
diff --git a/web/src/components/action-center/action-drawer.tsx b/web/src/components/action-center/action-drawer.tsx
index bab0ffe04..8902db8e7 100644
--- a/web/src/components/action-center/action-drawer.tsx
+++ b/web/src/components/action-center/action-drawer.tsx
@@ -193,6 +193,86 @@ export function ActionDrawer({
</div>
</SheetHeader>
+ {/* Who has it, where it stands and by when: ahead of the tabs, so they
+ read and change without scrolling past the content. */}
+ <div className="grid gap-3 border-b px-6 py-3 sm:grid-cols-3">
+ <div>
+ <Label htmlFor="action-drawer-status" className="text-xs text-muted-foreground">
+ {t('drawer.statusLabel')}
+ </Label>
+ <Select
+ value={action.status}
+ onValueChange={(value) =>
+ void mutate(() => updateActionStatus(brandId, action.id, value as ActionStatus))
+ }
+ disabled={isBusy}
+ items={ACTION_STATUSES.map((status) => ({
+ value: status,
+ label: t(`status.${status}`),
+ }))}
+ >
+ <SelectTrigger id="action-drawer-status" className="mt-1 h-8 w-full text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {ACTION_STATUSES.map((status) => (
+ <SelectItem key={status} value={status}>
+ {t(`status.${status}`)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <div>
+ <Label htmlFor="action-drawer-assignee" className="text-xs text-muted-foreground">
+ {t('drawer.assignee')}
+ </Label>
+ <Select
+ value={action.assignee?.id ?? 'unassigned'}
+ onValueChange={(value) =>
+ void mutate(() =>
+ assignAction(brandId, action.id, value === 'unassigned' ? null : value),
+ )
+ }
+ disabled={isBusy}
+ items={[
+ { value: 'unassigned', label: t('filters.unassigned') },
+ ...members.map((member) => ({
+ value: member.userId,
+ label: memberLabel(member),
+ })),
+ ]}
+ >
+ <SelectTrigger id="action-drawer-assignee" className="mt-1 h-8 w-full text-xs">
+ <SelectValue placeholder={t('drawer.assignTo')} />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="unassigned">{t('filters.unassigned')}</SelectItem>
+ {members.map((member) => (
+ <SelectItem key={member.userId} value={member.userId}>
+ {memberLabel(member)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <div>
+ <Label htmlFor="action-drawer-due-date" className="text-xs text-muted-foreground">
+ {t('drawer.dueDate')}
+ </Label>
+ <Input
+ id="action-drawer-due-date"
+ type="date"
+ className="mt-1 h-8 text-xs"
+ value={action.dueDate ?? ''}
+ disabled={isBusy}
+ onChange={(e) =>
+ void mutate(() => setActionDueDate(brandId, action.id, e.target.value || null))
+ }
+ />
+ </div>
+ </div>
+
<nav className="flex gap-4 border-b px-6" aria-label={t('table.action')}>
{TABS.map((key) => (
<button
@@ -407,79 +487,6 @@ export function ActionDrawer({
</section>
)}
</div>
-
- <div className="space-y-3 border-t px-6 py-4">
- <div className="grid grid-cols-2 gap-3">
- <div>
- <Label className="text-xs text-muted-foreground">{t('drawer.statusLabel')}</Label>
- <Select
- value={action.status}
- onValueChange={(value) =>
- void mutate(() => updateActionStatus(brandId, action.id, value as ActionStatus))
- }
- disabled={isBusy}
- items={ACTION_STATUSES.map((status) => ({
- value: status,
- label: t(`status.${status}`),
- }))}
- >
- <SelectTrigger className="mt-1 h-8 w-full text-xs">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {ACTION_STATUSES.map((status) => (
- <SelectItem key={status} value={status}>
- {t(`status.${status}`)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
- <div>
- <Label className="text-xs text-muted-foreground">{t('drawer.dueDate')}</Label>
- <Input
- type="date"
- className="mt-1 h-8 text-xs"
- value={action.dueDate ?? ''}
- disabled={isBusy}
- onChange={(e) =>
- void mutate(() => setActionDueDate(brandId, action.id, e.target.value || null))
- }
- />
- </div>
- </div>
- <div>
- <Label className="text-xs text-muted-foreground">{t('drawer.assignee')}</Label>
- <Select
- value={action.assignee?.id ?? 'unassigned'}
- onValueChange={(value) =>
- void mutate(() =>
- assignAction(brandId, action.id, value === 'unassigned' ? null : value),
- )
- }
- disabled={isBusy}
- items={[
- { value: 'unassigned', label: t('filters.unassigned') },
- ...members.map((member) => ({
- value: member.userId,
- label: memberLabel(member),
- })),
- ]}
- >
- <SelectTrigger className="mt-1 h-8 w-full text-xs">
- <SelectValue placeholder={t('drawer.assignTo')} />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="unassigned">{t('filters.unassigned')}</SelectItem>
- {members.map((member) => (
- <SelectItem key={member.userId} value={member.userId}>
- {memberLabel(member)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
- </div>
</SheetContent>
</Sheet>
);