HarperFast / HarperFast/studio

Comparison overlay: same metric over the previous window

Open
#1,460 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 standard "is this normal?" affordance: a toggle that overlays a ghost/dashed line of the same metric from the previous window (yesterday / last week, matched to the preset) time-shifted onto the current chart. Requires one extra query per panel with the shifted range (the query layer already parameterizes start/end) and a muted series style.

## Acceptance criteria
- Toolbar toggle "Compare: previous period" (URL-encoded, e.g. `compare=1`, in `statusSearch.ts`; default off).
- When on, each line chart overlays the same metric from the immediately preceding window of equal length, time-shifted to align, rendered dashed/muted and legend-labelled "(prev)"; tooltips label both series sets.
- No extra fetches while the toggle is off; presets only (disabled for a custom historical range if #1456 lands first).

## Implementation notes
- One extra `useAnalyticsRecords` call per panel with the shifted window, gated on the toggle; shift each point's x by the window duration before rendering; muted style via `opacity`/`strokeDasharray` on the existing `Series` fields.

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.