Repository navigation
feat(prompts): date range filter on the prompt detail page - #496
Merged
Merged
Conversation
Adds the insights-style date preset bar (24h / 7d / 30d / 90d / All / Custom, default 30d) to the prompt detail page. getPromptDetail accepts dateFrom/dateTo and applies them to the results query, so the KPI cards, Platform Results groups and the Top Sources tabs all follow the selected window from a single filtered set. Date changes reuse the insights refetch overlay (dimmed content + floating spinner) instead of a skeleton flash, the empty state is period-aware with a one-click 'Show all data' reset, and the Last run badge is pinned to the prompt's true latest run so it doesn't move or empty out with the window.
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
Adds an insights-style date range filter to the prompt detail page (
/dashboard/prompts/[id]), so a prompt can be inspected over the last 24h, week, month, etc. instead of all-time only.getDateRangelogic to the insights filter bar. Defaults to 30d so the detail page opens on the same window as insights.getPromptDetailacceptsdateFrom/dateTo(via theexpandDateToEndOfDayconvention) and applies them to the results query — the KPI cards, Platform Results groups, and Top Sources tabs all derive from the same filtered results, so they always agree.lastCheckedAtnow comes from a separate 1-row query for the prompt's true latest run, so it doesn't move or disappear when a narrow window is selected.Related issue
—
Type of change
feat— New featureHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)