Skip to content

feat(brands): pause a brand — add is_active and skip inactive brands in daily tracking #286

Closed

Description

@gkhngyk

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

  1. Data — new migration supabase/migrations/00020_brand_is_active.sql: add is_active boolean NOT NULL DEFAULT true to brands. (Apply to hosted via the MCP migration workflow + commit the numbered file.)
  2. 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.)
  3. Server action — add a setBrandActive(id, isActive) action in web/src/lib/actions/brand.ts (mirror the existing setBrandShoppingMode pattern), and surface is_active on the Brand type + getBrands/getBrandById.
  4. 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/check and /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_active exists (default true); 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.

Activity

  1. added
    enhancement
    on Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions