Skip to content

Prompts: add a date-range selector (7d / 30d / 90d) instead of the hardwired 30-day window #686

Closed

Description

@gkhngyk

Problem

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.

Evidence

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

  1. self-assigned this
    on Aug 8, 2026
  2. added
    enhancement
    on Aug 8, 2026
  3. added a commit that references this issue on Aug 10, 2026
    7b6be5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions