Skip to content

feat(heatmap): configurable heatmap color schemes (Windows + macOS) - #152

Merged
debugtheworldbot merged 4 commits into
debugtheworldbot:mainfrom
LingyiChen-AI:feature/heatmap-color-scheme
Oct 22, 2026
Merged

debugtheworldbot merged 4 commits into
debugtheworldbot:mainfrom
LingyiChen-AI:feature/heatmap-color-scheme

Conversation

@LingyiChen-AI

Copy link
Copy Markdown
Contributor

Summary

Adds a heatmap color scheme setting on both Windows and macOS. The default palette stays exactly as it is today.

  • 7 presets: Default (blue, follows the system accent), Warm (orange-red), Spectrum (blue-yellow-red), Green, Teal, Purple, Rose
  • Custom: pick a low and a high color from the system color picker (ColorDialog on Windows, NSColorWell on macOS)
  • Preview: each dropdown item shows a gradient swatch, and the settings card has a "Less → More" palette strip
  • Changes are saved right away and open heatmap windows repaint live
  • Light and dark mode each have their own stops
  • Localized for en, zh-Hans and zh-Hant
  • PostHog click events: settings_heatmap_color_scheme and settings_heatmap_custom_color on Windows, setting_heatmap_color_scheme on macOS

New settings (backward compatible; missing or unknown values fall back to the default)

Key Values Default
heatmapColorScheme default / warm / spectrum / green / teal / purple / rose / custom default
heatmapCustomLowColor #RRGGBB #FFE082
heatmapCustomHighColor #RRGGBB #C62828

Windows stores these in settings.json and macOS stores them in UserDefaults. The palette math lives in HeatmapPalette: KeyStats.Windows/KeyStats/Helpers/HeatmapPalette.cs on Windows, and inside KeyboardHeatmapViewController.swift on macOS. Both ports use the same color stops. No new Swift files, so project.pbxproj is untouched.

Screenshots (Windows)

Palette picker Custom colors

Default (unchanged)

Warm

Spectrum

Green

Custom (light blue → purple)

Test plan

  • Windows: dotnet build -c Debug passes with 0 warnings, and the screenshots above come from that build
  • Windows: an existing settings.json without the new keys still loads with the default palette
  • macOS: build and run in Xcode. This PR was authored on Windows, so the Swift changes have not been compiled yet
  • macOS: Default keeps the current look; check the light/dark switch and the custom color wells

🤖 Generated with Claude Code

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.
@debugtheworldbot
debugtheworldbot requested a balanced review from Copilot October 22, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@debugtheworldbot
debugtheworldbot merged commit 71dd9e1 into debugtheworldbot:main Oct 22, 2026
1 check passed
@LingyiChen-AI
LingyiChen-AI deleted the feature/heatmap-color-scheme branch October 23, 2026 02:20
LingyiChen-AI added a commit to LingyiChen-AI/keyStats that referenced this pull request Oct 23, 2026
…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
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.

3 participants