Skip to content

[Repo Assist] fix: persist brightness, colour temperature and on/off state across restartsΒ #111

Description

@github-actions

πŸ€– This PR was created by Repo Assist, an automated AI assistant.

Problem

User-configured brightness (Ctrl+Shift+↑/↓), colour temperature (K+/K-), and on/off state (Ctrl+Shift+L) are all reset to their default values every time the app restarts. The three in-memory fields β€” currentOpacity, _colorTemperature, and isLightOn β€” were never persisted to AppSettings.json.

Changes

AppSettings.cs

Added three new persisted properties:

Property Type Default
Brightness double 1.0
ColorTemperature double 0.5
IsLightOn bool true

MainWindow.xaml.cs

  1. Restore on startup (constructor): currentOpacity, _colorTemperature, and isLightOn are initialised from the loaded settings before the UI is created.
  2. Apply to UI (Window_Loaded): After frame geometry is ready, EdgeLightBorder.Opacity and Visibility are set from the restored values, and SetColorTemperature is called to repaint the gradient.
  3. Save on change:
    • IncreaseBrightness / DecreaseBrightness β†’ saves Brightness
    • SetColorTemperature β†’ saves ColorTemperature
    • ToggleLight β†’ saves IsLightOn

Test Status

Build passes on Linux CI with -p:EnableWindowsTargeting=true:

Build succeeded.
    0 Warning(s)
    0 Error(s)

Note: This is a .NET 10 / WPF project β€” runtime tests require Windows. The changes are minimal, surgical, and follow the existing AppSettings.Save() pattern already used by ExcludeFromCapture.

Trade-offs

  • Saving on every brightness/temperature change adds a small disk write. This is negligible given changes only happen on explicit user action (button click or hotkey press), not in tight loops.
  • No migration needed: the new JSON properties have sensible defaults; existing settings.json files without these fields will deserialise correctly (JSON property defaults kick in).

Closes #24 (partially β€” addresses the state persistence aspect)

Note

πŸ”’ Integrity filter blocked 3 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #68 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #26 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Detect camera is being used by another application and automatically turn onΒ #21 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Repo Assist Β· ● 3.3M Β· β—·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch repo-assist/fix-persist-settings-2026-07-05-c305fb737056bd75.

Click here to create the pull request

To fix the permissions issue, go to Settings β†’ Actions β†’ General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (124 of 124 lines)
From 82deca5f6312848f97e0a18306f04435966a382c Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sun, 5 Jul 2026 01:26:31 +0000
Subject: [PATCH] fix: persist brightness, colour temperature and on/off state
 across restarts

Adds three new properties to AppSettings:
- Brightness (double, default 1.0)
- ColorTemperature (double, default 0.5)
- IsLightOn (bool, default true)

Restores all three values on startup in Window_Loaded (applied to UI
after frame geometry is ready). Saves each value whenever it changes:
- Brightness saved in IncreaseBrightness / DecreaseBrightness
- ColorTemperature saved in SetColorTemperature
- IsLightOn saved in ToggleLight

Closes #24 (partially - addresses state persistence aspect of HDR/UX)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 WindowsEdgeLight/AppSettings.cs     | 16 ++++++++++++++++
 WindowsEdgeLight/MainWindow.xaml.cs | 22 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/WindowsEdgeLight/AppSettings.cs b/WindowsEdgeLight/AppSettings.cs
index bf12831..f05ef18 100644
--- a/WindowsEdgeLight/AppSettings.cs
+++ b/WindowsEdgeLight/AppSettings.cs
@@ -20,6 +20,22 @@ public class AppSettings
     /// </summary>
     public bool ExcludeFromCapture { get; set; } = true;
 
+    /// <summary>
+    /// Edge-light opacity (brightness), in the range [0.2, 1.0]. Defaults to 1.0 (full brightness).
+    /// </summary>
+    public double Brightness { get; set; } = 1.0;
+
+    /// <summary>
+    /// Colour temperature blend value in the range [0.0, 1.0] where 0 = coolest blue, 1 = warmest amber.
+    /// Defaults to 0.5 (neutral white).
+    /// </summary>
+    public double ColorTemperature { get; set; } = 0.5;
+
+    /// <summary>
+    /// Whether the edge light is currently on. Defaults to true.
+    /// </summary>
+    public bool IsLightOn { get; set; } = true;
+
     /// <summary>
     /// Load settings from disk
     /// </summary>
dif
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions