Repository navigation
feat(brands): pause a brand — add is_active and skip inactive brands in daily tracking - #308
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a paused/active state to brands (brands.is_active) so tracking can be suspended without deleting historical data, and updates server + web surfaces to respect that state (daily cron skips paused brands; on-demand endpoints reject paused brands; UI exposes pause/resume and shows “Paused” indicators). The PR also includes additional in-product agent “Site Audit” tool exposure/prompting that is not described in the PR summary or issue scope.
Changes:
- Add
brands.is_active(defaulttrue) and surface it through web types/mappers asBrand.isActive. - Skip paused brands in daily tracking and block on-demand tracking routes for paused brands (409).
- Add brand settings UI to pause/resume tracking and show “Paused” badges in brand switcher/cards.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/types/supabase.ts | Adds is_active to Supabase-generated brand row types. |
| web/src/types/index.ts | Adds Brand.isActive to the app-level Brand type. |
| web/src/lib/actions/brand.ts | Maps is_active → isActive; adds setBrandActive server action. |
| web/src/components/layout/brand-switcher.tsx | Displays a “Paused” badge for inactive brands in the switcher. |
| web/src/components/dashboard/brand-card.tsx | Displays a “Paused” badge on brand cards. |
| web/src/app/[locale]/(onboarding)/dashboard/onboarding/page.tsx | Ensures onboarding brand mapping includes isActive. |
| web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx | Adds Pause/Resume Tracking settings card (admin-only). |
| supabase/migrations/00020_brand_is_active.sql | Migration to add brands.is_active boolean not null default true. |
| server/src/server.js | Daily tracking cron filters brands to is_active = true. |
| server/src/routes/tracking.js | Blocks /check and /analyze-new for paused brands (409). |
| web/src/lib/agent/tools.ts | Adds Site Audit agent tools (run/get/list) in the in-product agent toolset. |
| web/src/lib/agent/system-prompt.ts | Documents Site Audit agent tools + adds credit-spending rule for run_site_audit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…in tracking Add an active/inactive (paused) state to brands so a brand can be temporarily suspended without deleting it (and losing history). - migration 00020: brands.is_active boolean NOT NULL DEFAULT true - daily tracking cron filters brands on is_active = true - on-demand tracking (/check, /analyze-new) rejects paused brands (409) - setBrandActive server action + isActive on the Brand type/mappers - Pause/Resume card in brand settings + paused badge in switcher/list
gkhngyk
force-pushed
the
feature/brand-pause-is-active
branch
from
June 27, 2026 12:56
d13be63 to
d942073
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an active / inactive (paused) state to a brand so it can be temporarily suspended without deleting it (which would destroy all history). Pausing suspends tracking and all related spend; resuming picks it back up on the next run.
00020_brand_is_active.sql:brands.is_active boolean NOT NULL DEFAULT true. Existing brands default to active, so behavior is unchanged on rollout.runDailyTracking(server/src/server.js) filters 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 are untouched.POST /api/tracking/checkand/analyze-new(server/src/routes/tracking.js) reject a paused brand with409after the ownership check, so "paused" means no spend at all (per the issue's suggested decision).setBrandActive(brandId, isActive)mirroringsetBrandShoppingMode;isActiveis surfaced on theBrandtype andgetBrands/getBrandByIdmappers.A paused brand keeps all historical data and stays selectable/viewable. The hosted migration has already been applied (column verified:
boolean,NOT NULL, defaulttrue).Out of scope (per issue): exposing pause state via MCP, and seat/quota accounting changes.
Related issue
Closes #286
Type of change
feat— New featureChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)