You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AI Traffic page is hard-locked to the last 7 days: KPIs, the trend chart (whose title literally says "AI Referral Trend — Last 7 Days"), the platform breakdown and Top Landing Pages all show a fixed window. There is no way to look at a month or a quarter of traffic.
The backend is already ready: getTrafficSummary(brandId, days = 7) and getTrafficTrend(brandId, days = 7) in web/src/lib/actions/traffic.ts accept a days parameter — the page just never passes it.
Add a small segmented control in the page header with 7d / 30d / 90d options (default 7d) — same presets the report generate dialog uses. The existing view-toggle button group in the Query Fan-out tab (_fanout-tab.tsx) is a good styling reference.
Store the selection in state and pass it to getTrafficSummary, getTrafficTrend, and getTrafficLogs' future callers via the existing load(); reload on change.
Make the trend-chart title dynamic ("Last 7 Days" → "Last 30 Days" / "Last 90 Days"), and keep the KPI's "vs previous period" sublabel correct — the actions already compare against the preceding window of the same length.
The "last 7 days" fallback sublabel on the visits KPI should follow the selected range too.
Acceptance criteria
Switching between 7d / 30d / 90d reloads KPIs, both charts and both tables with the selected window.
The trend chart title and KPI sublabels reflect the selected range.
Default remains 7 days; switching brands keeps working as before.
Getting started
See CONTRIBUTING.md for setup. From web/, yarn lint, yarn typecheck and yarn format:check must pass. Comment here to claim the issue before opening a PR.
Activity