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
{{ message }}
Repository navigation
Prompts: add a date-range selector (7d / 30d / 90d) instead of the hardwired 30-day window #686
Every metric on the Prompts page is locked to a 30-day window: the All Prompts table columns (visibility score, mentions, citations, runs) come from getPromptVisibilitySummaries(brandId, { days: 30 }), the tooltips hardcode "over the last 30 days", and the Query Fan-out tab passes days: 30. Insights and Citations both already offer date presets — Prompts is the only major analytics page without one. The practical gap: after optimizing content, "what changed this week" is invisible inside a 30-day average.
The backend is already parametric: getPromptVisibilitySummaries takes { days }, and the fan-out action accepts days capped at MAX_FANOUT_DAYS = 90.
Proposal
Add a preset row — 7d / 30d / 90d, default 30d — near the tab bar, applying to all three tabs (All Prompts, Query Fan-out, Insights) so the whole page describes one window and its numbers can't contradict each other.
Design decisions (settled):
No 24h preset: one day = 1–2 runs per prompt; scores would be noise and the table half zeros. No "All": the summaries computation scans every result row, an unbounded window has unbounded cost — and 90d aligns with the fan-out cap.
URL-synced: the page already writes its other filters via history.replaceState (page.tsx#L922) — the range joins those params so views are shareable.
Tooltips become dynamic: "over the last 30 days" → the selected range.
Explicitly unaffected: the prompt-suggestions card (its GSC 28-day window is part of its own logic) and the prompt detail page (its charts are a possible follow-up, out of scope here).
If the three-tab wiring turns out heavy, shipping the All Prompts table first and following with fan-out/insights is an acceptable split — but the shared state should be built page-level from the start.
Acceptance criteria
Switching presets refetches the table (and wired tabs) for that window; default stays 30d and matches today's numbers exactly.
The selected range survives reload via the URL.
Column tooltips state the active window.
Suggestions card behavior is byte-for-byte unchanged across presets.
Activity
feat(prompts): add a 7d / 30d / 90d range selector (#697)
feat(web): one date range control across Visibility, Citations and Pr…