Skip to content

feat: Add time-of-day filtering with quick hour filters and time range picker#3978

Open
Yashh56 wants to merge 9 commits intoumami-software:devfrom
Yashh56:feat/timeRanges
Open

feat: Add time-of-day filtering with quick hour filters and time range picker#3978
Yashh56 wants to merge 9 commits intoumami-software:devfrom
Yashh56:feat/timeRanges

Conversation

@Yashh56
Copy link
Copy Markdown
Contributor

@Yashh56 Yashh56 commented Jan 23, 2026

This pull request adds enhanced time-based filtering options to the DateFilter component, allowing users to select more granular time ranges, including specific hours within a day. It introduces a new TimeRangePickerForm component, updates the available filter options, and adds supporting labels for improved user experience.

New time range filtering features:

  • Added a new TimeRangePickerForm component that allows users to select a specific date and start/end hours, enabling hour-level granularity for date filters. (src/components/metrics/TimeRangePickerForm.tsx)
  • Updated the DateFilter component to include new quick-select options for the last 1, 2, 4, 6, and 12 hours, and added a "Time range" option that opens the new time picker modal. (src/components/input/DateFilter.tsx) [1] [2]
  • Integrated the new time range picker modal into the DateFilter component, handling its open/close state and passing selected values back to the parent. (src/components/input/DateFilter.tsx) [1] [2] [3] [4]

Internationalization and UI improvements:

  • Added new message labels for "Time range", "Start time", and "End time" to support the new filtering options. (src/components/messages.ts)
  • Imported the new TimeRangePickerForm in the DateFilter component to enable the modal functionality. (src/components/input/DateFilter.tsx)

Closes #3962

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 23, 2026

@Yashh56 is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Jan 23, 2026

Greptile Summary

This PR enhances the DateFilter component with five new quick-select hour options (1 h, 2 h, 4 h, 6 h, 12 h) and a custom "Time range" picker that lets users select a specific calendar date plus a start/end hour, emitting the result in the existing range:<startMs>:<endMs> format that the rest of the codebase already parses correctly.

The previously flagged issues (duplicate export const labels, missing defineMessages import, formatMessage calls that would throw at runtime, and uninitialized hour state) have all been resolved in this revision. One remaining issue:

  • Missing locale translations (P1) — The three new label keys (label.time-range, label.start-time, label.end-time) are defined in messages.ts but not present in any locale file (including public/intl/messages/en-US.json). next-intl will render the raw key string verbatim for all users until the translations are added.

Confidence Score: 4/5

Safe to merge once the missing locale translation strings are added; all previously flagged runtime errors are resolved.

All major prior issues (formatMessage crash, duplicate labels declaration, uninitialized state) are fixed. The one remaining P1 is missing translation entries in locale files — the new UI elements will render raw key strings (e.g. "label.time-range") for every user until the strings are added.

public/intl/messages/en-US.json (and other locale files) need the three new translation keys added.

Important Files Changed

Filename Overview
src/components/metrics/TimeRangePickerForm.tsx New time-range picker component; logic and hook usage are correct, but the translation keys it references are missing from locale files.
src/components/input/DateFilter.tsx Adds 1/2/4/6/12-hour quick filters and a Time Range modal trigger; references label.timeRange which has no locale translation yet.
src/components/messages.ts New keys timeRange, startTime, endTime correctly appended to the existing labels Record; no structural issues.

Reviews (5): Last reviewed commit: "Use translation function for time range ..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/components/metrics/TimeRangePickerForm.tsx Outdated
Comment thread src/components/metrics/TimeRangePickerForm.tsx Outdated
Comment thread src/components/metrics/TimeRangePickerForm.tsx Outdated
Yashh56 and others added 3 commits January 23, 2026 20:53
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@Yashh56
Copy link
Copy Markdown
Contributor Author

Yashh56 commented Jan 23, 2026

@greptileai

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Yashh56
Copy link
Copy Markdown
Contributor Author

Yashh56 commented Mar 30, 2026

@greptileai

Comment thread src/components/messages.ts Outdated
Comment thread src/components/input/DateFilter.tsx Outdated
Comment thread src/components/input/DateFilter.tsx Outdated
@Yashh56
Copy link
Copy Markdown
Contributor Author

Yashh56 commented Mar 30, 2026

@greptileai

Comment thread src/components/metrics/TimeRangePickerForm.tsx Outdated
Yashh56 and others added 2 commits March 30, 2026 20:30
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@Yashh56
Copy link
Copy Markdown
Contributor Author

Yashh56 commented Mar 30, 2026

@greptileai

@Yashh56
Copy link
Copy Markdown
Contributor Author

Yashh56 commented Apr 13, 2026

Hey @mikecao , can you please have a look at this?

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.

1 participant