Skip to content

Custom time range and brush/zoom for Status charts #1456

Description

@kylebernhardy

The Status time picker is presets-only (1h/6h/24h/7d/30d), which is limiting for incident forensics ("what happened Tuesday 2–4pm?"). Two related additions that share plumbing:

  1. A calendar/date-time custom range in TimeRangePicker — slots into the existing timeRange context; auto-refresh should disable for historical windows.
  2. Brush/zoom on the time-series charts (Recharts <Brush>, or drag-select → narrow timeRange), so a spike seen at 7d can be zoomed into without guessing the preset.

Acceptance criteria

  • TimeRangePicker gains a "Custom…" option opening a date+time range picker; selecting one sets the window and forces auto-refresh to Off while active (a historical window must not slide).
  • Deep-linkable: encodes as range=custom&start=<ms>&end=<ms> in the status route's search schema (statusSearch.ts), with validation (start < end, span capped at 30d, invalid → default preset).
  • Brush/drag-select on any time-series chart narrows to that sub-range (becomes a custom range); a "back to preset" affordance restores the previous preset.
  • bucketMs for custom windows derives from span using the same clamp rationale as TIME_PRESETS (see the SRE note atop timePresets.ts — do not allow 1m buckets on a 30d span).

Implementation notes

  • Extend validateStatusSearch (start/end only meaningful when range=custom); StatusTabsInner's ctx memo branches on preset vs custom.
  • Check src/components/ui/ for an existing shadcn calendar before adding one.

Filed from a Status tab code review.

Comment generated by kAIle (Claude Fable 5)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions