HarperFast / HarperFast/studio

Custom time range and brush/zoom for Status charts

Open
#1,456 0 comments 0 reactions 1 assignee Claimed by @kylebernhardy View on GitHub
Dominant language
TypeScript
Stars
5
Forks
4
Avg merge
1d 8h
Merged PRs (30d)
40

Description

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 ``, 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=&end=` 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.