Repository navigation
fix: lay out the daily trend on the calendar month - #395
Merged
Merged
Conversation
The daily trend split the row width across the days in the series, and the series ends today. On the 1st a single bar filled the whole row, and during the first weeks bar widths and axis labels moved every day. - Add DailyTrendMetrics.monthColumns(series:today:): one column per day of the calendar month, with days after today marked as future. The view pads; the data series still ends today, so the recap ledger keeps treating a zero in the series as a real zero. - Future columns draw no bar and take no hover. Weekend ticks and the regular axis labels stay, so bars and labels keep their place all month. - Days from another month (a provider still holding last month's series just after midnight) stay off the axis. - Hide the caption's peak while only one day has usage, where it repeats the readout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With the axis spanning the whole month, weekend ticks under future columns had no bar above them and read as stray "__ __" marks. Draw them only for past days and today. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
6 of 10 tasks
LuceteYang
added a commit
to LuceteYang/PikaTokenBar
that referenced
this pull request
Oct 5, 2026
Resolve the PopoverView conflict with chattymin#395 (calendar-month trend axis): the stacked bars and hover tooltip now iterate the month columns, leave future days as empty placeholders, and position the tooltip by column.
6 of 10 tasks
donky-ey
pushed a commit
to donky-ey/PokeDexBar
that referenced
this pull request
Oct 15, 2026
…n#395) The daily trend split the row width across the days in the series, and the series ends today. On the 1st a single bar filled the whole row, and during the first weeks bar widths and axis labels moved every day. DailyTrendMetrics.monthColumns pads one column per calendar day; future columns draw no bar and take no hover, and days from another month stay off the axis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the 1st of the month the daily trend draws a single bar across the whole row (screenshot in the #348 discussion). The series runs from the 1st to today, and the view splits the row width across however many days it has. So during the first weeks, bar widths and the axis labels (1, 7, 14, …) move every day.
DailyTrendMetrics.monthColumns(series:today:), a pure function that returns one column per day of the calendar month and marks days after today as future. Only the view pads.monthDailySeriesstill ends today, astestSeriesStopsAtTodayAndNeverRunsToTheEndOfTheMonthpins, soUsageLedger.mergekeeps treating a zero in the series as a real zero.__ __marks.monthDailyTotalsis the union of the providers' axes, so just after midnight a provider can still hold last month's series.Following the discussion in #348: this overlaps that PR's bar row and caption, and we agreed to open it separately. Whichever lands second takes the rebase; I'm happy to do it on my side.
Type of change
UI changes
Popover Home tab, "Daily this month" row. Rendered from
MonthDailyTrendat 2x with the same data onmainand on this branch (dark popover background, 360pt width).Korean UI
Checklist
swift buildandswift testpass locally:swift buildpasses locally. This machine has only Command Line Tools (no XCTest), so the full suite ran in CI instead: 1390 tests, 0 failures, coverage gate passed (run).Tests in
MonthDailyTrendTests:🤖 Generated with Claude Code