Add year-view heatmap to History window - #6
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
Adds a "Year" option to the period picker that replaces the bar chart with a 52x7 grid of cells, color intensity scaled to the in-view 90th-percentile day. Hovering a cell reveals the same date / total-keystrokes tooltip pattern as the existing chart. - Sources/HistoryView.swift: new HeatmapSection view, mirrors ChartSection's EquatableView pattern to avoid re-renders. 5-level accent-color ramp with empty-day distinct from low-count. Responsive cell sizing via GeometryReader - Sources/AppDelegate.swift: pruneAllDevices(keepingDays:) bumped from 60 to 365 in both call sites so the year view actually has data to render No schema change. Uses existing SyncData.totalCount(for:) API. No new dependencies in Package.swift.
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.
Adds a GitHub-style year-view heatmap to the History window. Selecting
Yearin the period picker replaces the bar chart with a 52×7 grid ofcells, color intensity scaled to the in-view 90th-percentile day.
HeatmapSectionview inHistoryView.swift, mirrorsChartSection'sEquatableViewpattern to avoid re-renders on list scrolldays; responsive cell sizing via
GeometryReaderso the window stays atthe existing 540×550
existing chart
pruneAllDevices(keepingDays:)bumped from60to365in both callsites (
applicationWillTerminateandloadAndReconcileCounts) so theyear view actually has data to render
Package.swiftThe demo uses a synthesized 365-day dataset with a seasonal pattern + a
couple of zero-stretch "vacation" weeks so the heatmap looks lived-in. Dev
builds run ad-hoc-signed without iCloud entitlements; the new view code
exercises the same
SyncData.totalCount(for:)aggregation the productionapp already uses.
AI was used for assistance.