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): list the actions sent from Products with a From Products chip (Product Visibility, part 9) (#1644)

Cihan5560f2334d5a
diff --git a/docs/guides/action-center.mdx b/docs/guides/action-center.mdx
index 2f5487cb7..4fa64cb8e 100644
--- a/docs/guides/action-center.mdx
+++ b/docs/guides/action-center.mdx
@@ -67,6 +67,8 @@ The cards at the top count and filter the list. Click one to narrow the table to
Below them, filter by category, **Priority**, **Status** and **Assignee**, or search. **Sort** by Priority (the default), Newest, Due date or Recently updated. Filters live in the URL, so a filtered view can be shared.
+For an online shop, a **From Products** chip beside the categories lists only the actions sent from **Products** (a product to get on the AI shelf, or a category to win), whatever the category. Click it again to clear it.
+
An action's status is **New**, **In Progress**, **On Hold**, **Completed** or **Dismissed**. The row menu sets In Progress, Completed or Dismiss without opening the action. Dismissing, from the row menu or the action's status, asks why: it doesn't matter to us, it's already done, the data behind it is wrong, or not now (or none). History shows the reason. **Delete** (admins and managers only) removes it for everyone, and it won't come back on its own the next day.
### Inside an action
diff --git a/web/messages/en.json b/web/messages/en.json
index 0c1b8171f..af69fabc4 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -1114,6 +1114,7 @@
"prioritySub": "Across open actions"
},
"allActions": "All",
+ "fromProducts": "From Products",
"filters": {
"priority": "Priority",
"status": "Status",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx
index 8d968be23..463e93ac3 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.test.tsx
@@ -170,6 +170,68 @@ afterEach(() => {
container.remove();
});
+describe('the From Products chip (ECOM-013)', () => {
+ const chip = () =>
+ [...container.querySelectorAll('button')].find((b) =>
+ b.textContent?.startsWith('fromProducts'),
+ );
+ const product: ActionItem = { ...action, id: 'a2', category: 'growth', kind: 'shopping_product' };
+ const category: ActionItem = {
+ ...action,
+ id: 'a3',
+ category: 'compete',
+ kind: 'shopping_category',
+ };
+
+ it('lists only what Product Visibility sent, and lets it go on a second click', async () => {
+ getActions.mockResolvedValue([action, product, category]);
+ getActionsAffected.mockResolvedValue({});
+ await render();
+ expect(chip()!.textContent).toBe('fromProducts2');
+ expect(chip()!.getAttribute('aria-pressed')).toBe('false');
+
+ await act(async () => chip()!.click());
+ expect(chip()!.getAttribute('aria-pressed')).toBe('true');
+ await act(async () => exportButton().click());
+ expect(getActionsAffected).toHaveBeenLastCalledWith('brand-id', ['a2', 'a3']);
+
+ await act(async () => chip()!.click());
+ await act(async () => exportButton().click());
+ expect(getActionsAffected.mock.lastCall![1]).toHaveLength(3);
+ });
+
+ it('opens on it from the URL, and shows no chip without such an action', async () => {
+ window.history.replaceState(null, '', '/?from=products');
+ getActions.mockResolvedValue([action, product]);
+ getActionsAffected.mockResolvedValue({});
+ await render();
+ expect(chip()!.getAttribute('aria-pressed')).toBe('true');
+ await act(async () => exportButton().click());
+ expect(getActionsAffected).toHaveBeenLastCalledWith('brand-id', ['a2']);
+
+ act(() => root.unmount());
+ root = createRoot(container);
+ window.history.replaceState(null, '', '/');
+ getActions.mockResolvedValue([action]);
+ await render();
+ expect(chip()).toBeUndefined();
+ });
+
+ it('shows the chip on from the URL with no such action left, to turn it off', async () => {
+ window.history.replaceState(null, '', '/?from=products');
+ getActions.mockResolvedValue([action]);
+ getActionsAffected.mockResolvedValue({});
+ await render();
+ expect(chip()!.textContent).toBe('fromProducts0');
+ expect(chip()!.getAttribute('aria-pressed')).toBe('true');
+
+ await act(async () => chip()!.click());
+ expect(chip()).toBeUndefined();
+ await act(async () => exportButton().click());
+ expect(getActionsAffected).toHaveBeenLastCalledWith('brand-id', ['a1']);
+ });
+});
+
describe('the actions list Export CSV', () => {
it("adds each action's affected count and names, in a file Excel reads as UTF-8", async () => {
getActionsAffected.mockResolvedValue({
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx
index 8452627cb..72d4793db 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/action-center/actions/page.tsx
@@ -39,6 +39,7 @@ import {
ACTION_CATEGORIES,
ACTION_SORTS,
ACTION_STATUSES,
+ FROM_PRODUCTS_KINDS,
OPEN_ACTION_STATUSES,
type ActionCategory,
type ActionDismissReason,
@@ -120,7 +121,16 @@ const GETTING_STARTED = 'getting_started';
type CategoryChoice = ActionCategory | 'all' | typeof GETTING_STARTED;
/** URL params that ask for the actions themselves, not Getting started. */
-const ACTIONS_PARAMS = ['category', 'action', 'priority', 'status', 'assignee', 'q', 'sort'];
+const ACTIONS_PARAMS = [
+ 'category',
+ 'action',
+ 'priority',
+ 'status',
+ 'assignee',
+ 'q',
+ 'sort',
+ 'from',
+];
export default function ActionCenterActionsPage() {
const brand = useBrandStore((s) => s.getActiveBrand());
@@ -178,6 +188,8 @@ function ActionsContent({ brand }: { brand: Brand }) {
const [loadFailed, setLoadFailed] = useState(false);
const [category, setCategory] = useState<CategoryChoice>('all');
+ // "From Products" (ECOM-013): only what Product Visibility sent, beside the category.
+ const [fromProducts, setFromProducts] = useState(false);
const [priority, setPriority] = useState<PriorityLevel | 'all'>('all');
const [status, setStatus] = useState<ActionStatus | 'all'>('all');
const [assignee, setAssignee] = useState<string>('all');
@@ -221,6 +233,7 @@ function ActionsContent({ brand }: { brand: Brand }) {
setAssignee(readUrlParam('assignee') || 'all');
setSort(readUrlChoice<ActionSort>('sort', ACTION_SORTS, 'priority'));
setSearch(readUrlParam('q'));
+ setFromProducts(readUrlParam('from') === 'products');
setUrlRead(true);
}, []);
@@ -230,13 +243,28 @@ function ActionsContent({ brand }: { brand: Brand }) {
const timer = setTimeout(
() =>
writeUrlParams(
- { category, priority, status, assignee, sort, q: search.trim() },
- { category: 'all', priority: 'all', status: 'all', assignee: 'all', sort: 'priority' },
+ {
+ category,
+ priority,
+ status,
+ assignee,
+ sort,
+ q: search.trim(),
+ from: fromProducts ? 'products' : 'all',
+ },
+ {
+ category: 'all',
+ priority: 'all',
+ status: 'all',
+ assignee: 'all',
+ sort: 'priority',
+ from: 'all',
+ },
),
300,
);
return () => clearTimeout(timer);
- }, [urlRead, category, priority, status, assignee, sort, search]);
+ }, [urlRead, category, priority, status, assignee, sort, search, fromProducts]);
const [selectedId, setSelectedId] = useState<string | null>(null);
@@ -397,6 +425,7 @@ function ActionsContent({ brand }: { brand: Brand }) {
// Getting started's steps aren't actions: with its table not shown, all.
if (category !== 'all' && category !== GETTING_STARTED && action.category !== category)
return false;
+ if (fromProducts && !FROM_PRODUCTS_KINDS.includes(action.kind)) return false;
if (priority !== 'all' && action.priorityLevel !== priority) return false;
if (status !== 'all' && action.status !== status) return false;
if (assignee !== 'all') {
@@ -423,7 +452,20 @@ function ActionsContent({ brand }: { brand: Brand }) {
return comparePriority(a, b);
}
});
- }, [actions, topIds, focus, category, priority, status, assignee, search, sort, tTexts, t]);
+ }, [
+ actions,
+ topIds,
+ focus,
+ category,
+ fromProducts,
+ priority,
+ status,
+ assignee,
+ search,
+ sort,
+ tTexts,
+ t,
+ ]);
const handleExportCsv = useCallback(async () => {
if (visible.length === 0) return;
@@ -476,6 +518,10 @@ function ActionsContent({ brand }: { brand: Brand }) {
}
return counts;
}, [actions]);
+ const fromProductsCount = useMemo(
+ () => (actions ?? []).filter((action) => FROM_PRODUCTS_KINDS.includes(action.kind)).length,
+ [actions],
+ );
const summary = useMemo(() => {
const all = actions ?? [];
@@ -779,6 +825,16 @@ function ActionsContent({ brand }: { brand: Brand }) {
onClick={() => setCategory(key)}
/>
))}
+ {/* A chip of its own beside the categories: on or off, whatever the category.
+ On from the URL, it shows with none too, to be turned off. */}
+ {(fromProducts || fromProductsCount > 0) && (
+ <CategoryPill
+ label={t('fromProducts')}
+ count={fromProductsCount}
+ isActive={fromProducts}
+ onClick={() => setFromProducts((on) => !on)}
+ />
+ )}
</div>
{!showSteps && (
<Select
diff --git a/web/src/lib/action-center/registry.ts b/web/src/lib/action-center/registry.ts
index 808a1dd4f..8fbca3415 100644
--- a/web/src/lib/action-center/registry.ts
+++ b/web/src/lib/action-center/registry.ts
@@ -278,6 +278,12 @@ export const ACTION_KINDS: readonly ActionKind[] = [
'shopping_links',
];
+/**
+ * The kinds sent from Product Visibility (ECOM-013): a product or a
+ * category. The Actions page's "From Products" chip lists them.
+ */
+export const FROM_PRODUCTS_KINDS: readonly string[] = ['shopping_product', 'shopping_category'];
+
/**
* Is this one of the kinds we have copy for?
*