Repository navigation
Closed
Labels
enhancementNew feature or request
Description
What
Add an active / inactive (paused) state to a brand, and make the daily tracking job skip inactive brands so their prompts are no longer fetched day after day once paused.
Today a brand can only be created or deleted — there is no way to temporarily pause one. As a result, the daily cron tracks every brand unconditionally: runDailyTracking in server/src/server.js selects all brands with from('brands').select('id, organization_id') and enqueues a tracking job for each, with no active/inactive filter. The brands table has no is_active/status column at all.
Why
- Cost control: every tracked brand spends Cloro + LLM credits daily. A user who wants to temporarily stop monitoring a brand (project paused, client churned, seasonal) currently has to delete it — which destroys all historical data — or keep paying for runs they don't want.
- User expectation: "if I pause a brand, the system should stop pulling its prompts every day" — pausing should suspend tracking while preserving history (read-only), and resuming should pick tracking back up.
Approach
- Data — new migration
supabase/migrations/00020_brand_is_active.sql: addis_active boolean NOT NULL DEFAULT truetobrands. (Apply to hosted via the MCP migration workflow + commit the numbered file.) - Daily tracking — in
runDailyTracking(server/src/server.js), filter the brands query to.eq('is_active', true)so paused brands are skipped by the cron. (The existing per-brand subscription/feature/prompt-count guards stay as-is.) - Server action — add a
setBrandActive(id, isActive)action inweb/src/lib/actions/brand.ts(mirror the existingsetBrandShoppingModepattern), and surfaceis_activeon theBrandtype +getBrands/getBrandById. - UI — a Pause / Resume toggle in the brand settings page (
web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx) with a clear "Tracking paused — historical data is kept, daily tracking is suspended" state. Show a paused indicator on the brand in the switcher/list.
Open questions / decisions
- On-demand tracking while paused: should the manual "Analyze Prompts" /
POST /api/tracking/checkand/api/tracking/analyze-new(server/src/routes/tracking.js) be blocked for a paused brand, or still allowed (pause only affects the daily cron)? Suggested: block on-demand too, so "paused" means no spend at all. - Visibility: a paused brand stays selectable so its historical Insights/Citations remain viewable (read-only); it just shows a "paused" badge.
- Out of scope for this issue (possible follow-ups): exposing pause state via MCP, and any seat/quota accounting changes.
Acceptance criteria
-
brands.is_activeexists (defaulttrue); existing brands are unaffected. - The daily tracking cron does not enqueue jobs for brands with
is_active = false. - An admin/manager can pause and resume a brand from its settings, with a clear paused state in the UI.
- A paused brand keeps all historical data and stays viewable; resuming re-enables daily tracking on the next run.
- The on-demand behavior for paused brands matches the decision above and is consistent between UI and server.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity