HarperFast / HarperFast/studio

Widening the Status time range rescales stale data into a sliver instead of showing skeletons

Open
#1,517 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

Follow-up spun out of a review comment on #1506 ([discussion](https://github.com/HarperFast/studio/pull/1506#discussion_r3588090476)) so it's tracked rather than living as a loose end in a PR thread. Non-blocking; can be folded into #1506 or taken separately.

### The behavior
The Status analytics charts share `placeholderData: keepPreviousData` (`hooks/useAnalyticsRecords.ts`). When you widen the time range, the previous window's data is kept and **rescaled** onto the new x-domain while the real data loads in the background — and the only loading affordance is the spinner in the top-right.

- Widening by a small factor is genuinely nice: **1 week → 1 day** fills the plot and re-granularizes in place.
- But a big jump like **1 hour → 7 days** squashes the old window into ~1% at the far-right edge of every chart — you lose essentially the whole plot to a sliver, with no obvious "loading" state.

### Suggested direction
When the new range is much wider than the previous one (i.e. `keepPreviousData` would leave most of the chart empty), drop the stale data and show the loading skeletons across the charts instead of rescaling a sliver. A simple `newRange / oldRange` ratio threshold would do it — keep the current reuse for narrowing and for small widenings. #1506 already exposes `isPlaceholderData`, which plus that ratio is enough to gate it.

Discovered during local review of #1506.

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.