diff --git a/web-common/src/components/date-picker/DateInput.svelte b/web-common/src/components/date-picker/DateInput.svelte index d92ad30c4e6..7300e53ef83 100644 --- a/web-common/src/components/date-picker/DateInput.svelte +++ b/web-common/src/components/date-picker/DateInput.svelte @@ -57,7 +57,6 @@ const dateString = e.currentTarget.value; let date: DateTime = DateTime.invalid("invalid"); - let format: string | null = null; for (const potentialFormat of formats) { diff --git a/web-common/src/features/dashboards/stores/dashboard-stores.ts b/web-common/src/features/dashboards/stores/dashboard-stores.ts index dfb82049709..d6b43764bfb 100644 --- a/web-common/src/features/dashboards/stores/dashboard-stores.ts +++ b/web-common/src/features/dashboards/stores/dashboard-stores.ts @@ -14,10 +14,11 @@ import { } from "@rilldata/web-common/features/dashboards/stores/filter-utils"; import type { MetricsExplorerEntity } from "@rilldata/web-common/features/dashboards/stores/metrics-explorer-entity"; import { TDDChart } from "@rilldata/web-common/features/dashboards/time-dimension-details/types"; -import type { - DashboardTimeControls, - ScrubRange, - TimeRange, +import { + TimeRangePreset, + type DashboardTimeControls, + type ScrubRange, + type TimeRange, } from "@rilldata/web-common/lib/time/types"; import { DashboardState_ActivePage } from "@rilldata/web-common/proto/gen/rill/ui/v1/dashboard_pb"; import type { @@ -531,6 +532,10 @@ const metricsViewReducers = { // Reset scrub when range changes setSelectedScrubRange(metricsExplorer, undefined); + if (timeRange.name === TimeRangePreset.ALL_TIME) { + metricsExplorer.showTimeComparison = false; + } + metricsExplorer.selectedTimeRange = { ...timeRange, interval: timeGrain, diff --git a/web-common/src/features/dashboards/time-controls/comparison-pill/ComparisonPill.svelte b/web-common/src/features/dashboards/time-controls/comparison-pill/ComparisonPill.svelte index 3fa31385e69..4301b3e609e 100644 --- a/web-common/src/features/dashboards/time-controls/comparison-pill/ComparisonPill.svelte +++ b/web-common/src/features/dashboards/time-controls/comparison-pill/ComparisonPill.svelte @@ -4,6 +4,7 @@ import { getStateManagers } from "@rilldata/web-common/features/dashboards/state-managers/state-managers"; import { TimeComparisonOption, + TimeRangePreset, type DashboardTimeControls, type TimeRange, } from "@rilldata/web-common/lib/time/types"; @@ -69,10 +70,17 @@ metricsViewSpec, ); } + + $: disabled = + selectedTimeRange?.name === TimeRangePreset.ALL_TIME || undefined; -