Skip to content

feat(web): add full date range picker to AI Traffic Analytics - #509

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Utkarsh-Singhal-26:feature/traffic-date-range-picker
Jul 23, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Utkarsh-Singhal-26:feature/traffic-date-range-picker

Conversation

@Utkarsh-Singhal-26

Copy link
Copy Markdown
Contributor

Summary

  • Replace the Traffic page’s partial 7d / 30d / 90d picker with the full Insights-style bar: 24h / 7d / 30d / 90d / All / Custom (with From/To inputs), defaulting to 7d.
  • Update getTrafficSummary, getTrafficTrend, and getTrafficLogs to accept { dateFrom?, dateTo? } instead of days, using expandDateToEndOfDay so custom To dates match Insights.
  • KPIs, trend chart, and visits table now share the same resolved window; visits pager resets when the range changes.
  • Section labels (KPI subtext, trend title) are range-aware for every preset including Custom and All.
  • “All time” trend buckets are capped at 365 days to keep the chart usable on long histories.

Screenshots

2026-07-22_21-15-07

Related issue

Closes #505

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against #505's acceptance criteria and re-checked locally — all three surfaces share one resolved window, the pager resets on every range change, the labels are range-aware, and the missing-previous-window case is handled cleanly (delta falls back to the range label instead of a bogus percentage). The key={brand.id} remount is a nice simplification too. Thanks for the thorough work!

@gkhngyk
gkhngyk merged commit 7cb5f58 into ansvisor:main Jul 23, 2026
4 checks passed
@Utkarsh-Singhal-26
Utkarsh-Singhal-26 deleted the feature/traffic-date-range-picker branch July 23, 2026 03:24
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.

Traffic: align the date range picker with the Insights filter (24h / All / Custom)

2 participants