Repository navigation
feat(prompts): add a 7d / 30d / 90d range selector - #697
Merged
Merged
Conversation
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
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
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:
runs_30dcolumn 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
Related issue
Closes #686
Type of change
feat— New featureHow 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.
?range=7appears in the URL on selection and disappears when returning to 30d; loading?range=90directly starts on 90d.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
feature/,fix/,chore/,docs/)yarn lintpasses — no new warningsyarn typecheckpassesyarn format:checkpasses