Skip to content

feat(prompts): add a 7d / 30d / 90d range selector - #697

Merged
gkhngyk merged 1 commit into
mainfrom
feature/686-prompts-date-range
Aug 10, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/686-prompts-date-range

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Every metric on the Prompts page was pinned to 30 days, so "what changed this week" was invisible inside a monthly average — and Prompts was the only major analytics page without a date control.

The selector sits beside the tabs and drives the All Prompts table and the Query Fan-out tab.

It is hidden on Insights. The issue assumed all three tabs, but that tab renders keyword volume estimates, which have no date dimension — a range control there would change nothing, so showing one would be a lie about what it does.

Beyond the data itself, every window-scoped label now follows the selection instead of claiming 30 days regardless:

  • the four column tooltips and the per-row hover text
  • the fan-out tab's description and its empty state
  • the CSV headers — exporting 7-day data under a runs_30d column would have quietly shipped wrong numbers, so the window-scoped columns carry the selected range (runs_7d, visibility_rate_90d, …). At the default the header row is unchanged.

The selection is mirrored in the URL as ?range=, omitted at the default so existing links keep their shape.

Design decisions

  • No 24h preset: one day yields one or two runs per prompt, so scores would be noise and most of the table would read zero.
  • No "all time": the visibility summaries scan every result row in the window, so an unbounded range has unbounded cost. 90 days also matches the fan-out row cap.
  • The suggestions card is untouched — it runs on its own 28-day Search Console window, which is part of its logic rather than a display range.

Related issue

Closes #686

Type of change

  • feat — New feature

How to test

Verified against a local instance with real data. Note when picking a prompt to check: rows added within the last week show the same counts at every range, correctly — their entire history already falls inside 7 days. Use an older prompt to see the difference.

  1. Search for an older prompt (e.g. one tracked since before the last week) and watch its Runs column: it changed from 42 at 7d to 176 at 30d on the instance this was tested against.
  2. ?range=7 appears in the URL on selection and disappears when returning to 30d; loading ?range=90 directly starts on 90d.
  3. The selector is absent on the Insights tab.

Not yet exercised by hand: the CSV header change and the suggestions card staying put across ranges — both are covered by code (the card takes no range prop and calls its own action), but worth a glance on review.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/)
  • Commits follow Conventional Commits
  • yarn lint passes — no new warnings
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR

Every number on the Prompts page was pinned to 30 days, so "what changed
this week" was invisible inside a monthly average — and Prompts was the only
major analytics page without a date control.

The selector sits next to the tabs and drives the All Prompts table and the
Query Fan-out tab. It is hidden on Insights: that tab shows keyword volume
estimates, which carry no date dimension, so a range there would be a
control that changes nothing. (The issue assumed all three tabs; reading the
code showed otherwise.)

Also made every window-scoped label follow the selection rather than saying
"30 days" regardless: the column tooltips, the per-row hover text, the
fan-out description and empty state, and the CSV headers — exporting 7-day
data under a runs_30d column would have quietly shipped wrong data.

The selection is mirrored in the URL as ?range=, omitted at the default so
existing links keep their shape. At 30d the page produces exactly what it
did before.

Closes #686
@gkhngyk
gkhngyk merged commit 7b6be5a into main Aug 10, 2026
5 checks passed
@gkhngyk
gkhngyk deleted the feature/686-prompts-date-range branch August 10, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant