SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat: improve date range selection ux (#9994)
Yunus Mf925a15f30f8
diff --git a/frontend/src/components/CustomTimePicker/CalendarContainer.tsx b/frontend/src/components/CustomTimePicker/CalendarContainer.tsxindex c0e857ead8..ce16ca744a 100644--- a/frontend/src/components/CustomTimePicker/CalendarContainer.tsx+++ b/frontend/src/components/CustomTimePicker/CalendarContainer.tsx@@ -20,6 +20,35 @@ function CalendarContainer({}): JSX.Element {const { timezone } = useTimezone();+ // this is to override the default behavior of the shadcn calendar component+ // if a range is already selected, clicking on a date will reset selection and set the new date as the start date+ const handleSelect = (+ _selected: DateRange | undefined,+ clickedDate?: Date,+ ): void => {+ if (!clickedDate) {+ return;+ }++ // No dates selected → start new+ if (!dateRange?.from) {+ onSelectDateRange({ from: clickedDate });+ return;+ }++ // Only start selected → complete the range+ if (dateRange.from && !dateRange.to) {+ if (clickedDate < dateRange.from) {+ onSelectDateRange({ from: clickedDate, to: dateRange.from });+ } else {+ onSelectDateRange({ from: dateRange.from, to: clickedDate });+ }+ return;+ }++ onSelectDateRange({ from: clickedDate, to: undefined });+ };+return (<div className="calendar-container"><div className="calendar-container-header">@@ -44,7 +73,7 @@ function CalendarContainer({disabled={{after: dayjs().toDate(),}}- onSelect={onSelectDateRange}+ onSelect={handleSelect}/><div className="calendar-actions">diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss b/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scssindex 7751b180ad..ec12648eca 100644--- a/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/DateTimeSelectionV2.styles.scss@@ -330,14 +330,6 @@}.periscope-calendar-day {- background: none !important;-- &.periscope-calendar-today {- &.text-accent-foreground {- color: var(--bg-vanilla-100) !important;- }- }-button {&:hover {background-color: var(--bg-robin-500) !important;@@ -556,12 +548,6 @@.calendar-container {.periscope-calendar-day {- &.periscope-calendar-today {- &.text-accent-foreground {- color: var(--bg-ink-500) !important;- }- }-button {&:hover {background-color: var(--bg-robin-500) !important;diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx b/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsxindex 6e608b1189..3755c5f9a2 100644--- a/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/Refresh.tsx@@ -1,6 +1,8 @@+import { Tooltip } from 'antd';+import { Clock } from 'lucide-react';import { useEffect, useState } from 'react';-import { RefreshTextContainer, Typography } from './styles';+import { RefreshTextContainer } from './styles';function RefreshText({onLastRefreshHandler,@@ -23,7 +25,9 @@ function RefreshText({return (<RefreshTextContainer refreshButtonHidden={refreshButtonHidden}>- <Typography>{refreshText}</Typography>+ <Tooltip title={refreshText}>+ <Clock size={12} />+ </Tooltip></RefreshTextContainer>);}