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; -
+
@@ -109,6 +122,7 @@ grain={activeTimeGrain} zone={activeTimeZone} {onSelectComparisonRange} + disabled={disabled ?? false} /> {/if}
@@ -117,7 +131,7 @@ .wrapper { @apply flex w-fit; @apply h-7 rounded-full; - @apply overflow-hidden; + @apply overflow-hidden select-none; } :global(.wrapper > button) { diff --git a/web-common/src/features/dashboards/time-controls/super-pill/components/Comparison.svelte b/web-common/src/features/dashboards/time-controls/super-pill/components/Comparison.svelte index c76a0ce84d9..59eb3e0783b 100644 --- a/web-common/src/features/dashboards/time-controls/super-pill/components/Comparison.svelte +++ b/web-common/src/features/dashboards/time-controls/super-pill/components/Comparison.svelte @@ -23,6 +23,7 @@ export let showComparison: boolean | undefined; export let selectedComparison: DashboardTimeControls | undefined; export let zone: string; + export let disabled: boolean; export let grain: string; export let minDate: DateTime | undefined = undefined; export let maxDate: DateTime | undefined = undefined; @@ -97,6 +98,7 @@ >