Skip to content

feat(ui): choose the timeframe of the candles and bars - #57

Merged
ShortArrow merged 2 commits into
mainfrom
feat/chart-timeframe
Oct 26, 2026
Merged

ShortArrow merged 2 commits into
mainfrom
feat/chart-timeframe

Conversation

@ShortArrow

@ShortArrow ShortArrow commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Why

The candles and bars of the chart of lines over time span a day, a week or a month, picked from the span of the history shown. There was no way to read the same history by week instead of by day, or to see how much each commit changed, which a trading chart offers by switching its timeframe. The decisions are in ADR 0049.

Timeframes

A row of buttons beside the legend offers Auto, Commit, Day, Week and Month (CumulativeChart.tsx), reusing the segmented control of the settings dialog. The candles and the bars both follow it. Auto keeps the earlier choice of the shortest calendar period that fits about sixty candles, so the chart looks as before until another timeframe is picked. As with the legend, the choice is not saved.

Commit

Commit cuts the time axis into columns 4 pixels wide, and the commits drawn in one column share a candle and a bar (byColumn). A short history gets one per commit. Over a long one, commits a few hours apart fall in the same column; their bars add up rather than drawing over each other, and their candle runs from before the first to after the last. Since the columns follow the pixels, these candles redraw when the chart's width changes. The roadmap item for bars per commit is removed, since Commit covers it.

The candles take any cut of the time axis, by the calendar or by the columns (candles, byTimeframe).

Tests

  • Unit tests: commits drawn in one column make one candle with their lines added up, a short history has a candle per commit, and each timeframe cuts the same history into the expected number of candles.
  • E2E: on repoA, Auto shows one candle for its one day, Commit shows four candles and four bars for its four first parents, and Week shows one again.

@ShortArrow
ShortArrow marked this pull request as ready for review October 26, 2026 07:57
@ShortArrow
ShortArrow merged commit cdd7219 into main Oct 26, 2026
15 checks passed
@ShortArrow
ShortArrow deleted the feat/chart-timeframe branch October 26, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant