Skip to content

insights: default the date range to 24h instead of All #260

Closed

Description

@gkhngyk

What

The Answer Engine Insights page (/dashboard/insights) opens with the All date range selected by default. It should default to 24h (last 24 hours).

Why

"All" pulls the entire history on first load, which is the slowest and least relevant default — users almost always want their most recent results first, and the heavier query makes the initial page load slower. Starting at 24h gives an immediate, fast, recency-focused view; users can widen the range when they need to.

Where

The default lives in the initial filter state in web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx:

datePreset: 'all',

The '24h' preset already exists (it's a valid DatePreset and is already rendered in the range selector + has a "last 24 hours" label), so this is just flipping the initial value.

Fix

Change the initial datePreset to '24h' and make sure the derived dateFrom/dateTo are computed from it on first load.

Acceptance

  • Insights opens on the 24h range by default
  • The 24h chip is highlighted as active on first load
  • Switching to other ranges (7d/30d/90d/All/Custom) still works

Activity

  1. Srija-65 commented on Jun 16, 2026

    @Srija-65
    Contributor

    Hi! I'd like to work on this issue.

  2. gkhngyk commented on Jun 16, 2026

    @gkhngyk
    ContributorAuthor

    Hi @Srija-65, thanks for your interest! I've assigned this issue to you. Feel free to reach out if you have any questions. Happy coding!

  3. Srija-65 commented on Jun 16, 2026

    @Srija-65
    Contributor

    Thank you for assigning this issue to me! I'm glad to contribute to Ansvisor.

    I'll start working on it right away and will do my best to complete it as soon as possible. If I run into any questions or need clarification, I'll be sure to reach out.

    Thanks again, and happy to be contributing!

  4. gkhngyk commented on Jun 18, 2026

    @gkhngyk
    ContributorAuthor

    Fixed in #274 (thanks @Srija-65!) — Insights now defaults to the 24h range. (The PR referenced #262 by mistake, so this didn't auto-close.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions