Repository navigation
feat(year-review): Year in Review — activity wall, keyboard personality, active hours, achievements (Windows + macOS) - #153
Open
LingyiChen-AI wants to merge 11 commits into
Conversation
Add a heatmap color setting with 7 presets (default blue, warm, spectrum, green, teal, purple, rose) plus a custom low/high color picked from the system color dialog. The settings card shows a live palette preview and open heatmap windows repaint immediately. Default palette is unchanged.
Mirror the Windows heatmap color setting: same presets and gradient math, custom low/high colors via NSColorWell, palette preview in settings, and live repaint of open heatmap views. Default palette is unchanged.
Add a Year in Review window with an activity wall (GitHub-style daily grid, past 12 months or calendar year, keys or clicks, quartile color levels that follow the heatmap palette, streak and best-day summary) and a keyboard personality tab (shortcut ratio, regret index, copy/paste, undo, arrow keys, click ratio, top keys). Entry points: stats popup header and tray menu. Persona rules live in KeyboardPersonaAnalyzer with unit tests.
Mirror the Windows Year in Review window: activity wall and keyboard personality tabs with the same rules, opened from the stats popover. Pure logic lives in YearReviewModels.swift (added to KeyStatsCore) with unit tests.
Record key presses and clicks per local hour in DailyStats (new optional hourlyKeyPresses/hourlyClicks fields; legacy data reads as zeros, merge sums per hour, not part of the sync protocol). Year in Review gains an Active Hours tab (daily-average bar chart, peak hour, chronotype, night share) and an Achievements tab (16 milestones with progress and unlock dates). AchievementService evaluates every 60s, backfills silently on first run and toasts new unlocks; the toast can be turned off in notification settings.
Mirror the Windows tabs on macOS. Active Hours reuses the existing HourlyStats data instead of adding new DailyStats fields. AchievementManager evaluates every 60s, backfills silently on first run and sends unlock notifications, with a toggle in notification settings.
人格页卡片行高写死 76pt,而「标题 + 数值 + 说明」三行加上下 12pt 内边距实测需要 84pt,导致说明那行被卡片底边截掉一半(深浅色均复现)。 改为 84pt,与活跃时段 / 贡献墙页同款卡片的留白一致。
…ground app attribution debugtheworldbot#151) # Conflicts: # KeyStats.Windows/KeyStats/Models/AppSettings.cs # KeyStats.Windows/KeyStats/Properties/Strings.cs # KeyStats.Windows/KeyStats/Properties/Strings.resx # KeyStats.Windows/KeyStats/Properties/Strings.zh-Hans.resx # KeyStats.Windows/KeyStats/Properties/Strings.zh-Hant.resx # KeyStats/en.lproj/Localizable.strings # KeyStats/zh-Hans.lproj/Localizable.strings # KeyStats/zh-Hant.lproj/Localizable.strings # Package.swift
This branch has not been deployed
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
Adds a Year in Review window on both Windows and macOS with four tabs: Activity Wall, Keyboard Personality, Active Hours and Achievements. All charts follow the heatmap color scheme from #152.
Entry points:
1. Activity Wall
2. Keyboard Personality
Covers today, the last 7 days, the last 30 days or all time.
Metrics: shortcut ratio, regret index (Backspace/Delete share), copy vs. paste, undo count, arrow-key share, clicks per 100 keys and top keys.
Picks one main personality from Shortcut Master, Copy-Paste Engineer, Perfectionist, Arrow Key Walker, Mouse Person, Keyboard Purist and Balanced Player. Any other personalities that also match are shown as secondary tags. The rules live in a pure analyzer that is identical on both platforms.
3. Active Hours
DailyStatsgains optionalhourlyKeyPresses/hourlyClicksarrays, recorded per local hour.HourlyStatsdata, so the data layer is unchanged.4. Achievements
16 milestones:
Locked cards show progress. Unlocks are evaluated every 60 s:
New settings:
unlockedAchievements(id → yyyy-MM-dd){}achievementsInitializedfalseachievementNotificationsEnabledtrueScreenshots
All screenshots use synthetic data.
Windows
Achievements

macOS
Test plan
dotnet buildpasses with 0 warnings.SingleDeviceCodeWithoutAuthoritativeCount_RemainsAConflict,ManualTransportFailure_AddsSixtySecondRetryDelay). They fail onmaintoo, so this PR does not cause them.swift testtests pass.settings.json/daily_stats.jsonwithout the new fields still loads.main(fix(stats): attribute activity to foreground apps #151, feat(heatmap): configurable heatmap color schemes (Windows + macOS) #152). The diff only contains the new features.