Skip to content

[Repo Assist] Persist brightness, color temperature, and on/off state across restarts - #36

Closed
shanselman wants to merge 1 commit into
masterfrom
repo-assist/eng-persist-user-settings-2026-06-08-194569ab690925ae
Closed

shanselman wants to merge 1 commit into
masterfrom
repo-assist/eng-persist-user-settings-2026-06-08-194569ab690925ae

Conversation

@shanselman

Copy link
Copy Markdown
Owner

Previously, only ExcludeFromCapture was saved to settings.json. Brightness, color temperature, and on/off state reset to defaults on every app restart.

Changes:

  • AppSettings: add IsLightOn, Brightness, and ColorTemperature properties
  • MainWindow: read persisted values after loading settings in constructor
  • MainWindow: save settings after every brightness, color temp, or toggle change
  • Window_Loaded: apply persisted opacity, color temperature, and visibility

No breaking changes - existing settings.json files gain the new fields with their default values (IsLightOn=true, Brightness=1.0, ColorTemperature=0.5).

Previously, only ExcludeFromCapture was saved to settings.json. Brightness,
color temperature, and on/off state reset to defaults on every app restart.

Changes:
- AppSettings: add IsLightOn, Brightness, and ColorTemperature properties
- MainWindow: read persisted values after loading settings in constructor
- MainWindow: save settings after every brightness, color temp, or toggle change
- Window_Loaded: apply persisted opacity, color temperature, and visibility

No breaking changes - existing settings.json files gain the new fields with
their default values (IsLightOn=true, Brightness=1.0, ColorTemperature=0.5).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@garrettcampbell3 garrettcampbell3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is great! I'm hoping to make contributions to add a full settings view, and this would be beneficial

@shanselman

Copy link
Copy Markdown
Owner Author

Thanks for this. I took the intent, but I'm closing this PR in favor of a maintainer-side implementation that includes the extra hardening found during review.

What landed locally in commit 054cecb:

  • persists on/off state, brightness, and color temperature
  • clamps persisted numeric settings and rejects NaN/Infinity before applying them to WPF properties
  • saves settings through a temp file + replace path to avoid partial settings.json writes
  • keeps all-monitor windows synchronized with current brightness, visibility, and color temperature
  • reuses the color interpolation helper instead of duplicating local functions

Closing this PR as superseded rather than merging the generated patch as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants