Skip to content

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

Closed

Description

@github-actions

πŸ€– This is an automated PR from Repo Assist.

Problem

User customisations (brightness, colour temperature, on/off toggle) were discarded every time the app restarted β€” only ExcludeFromCapture survived. Users had to re-tune their setup after every launch.

Root Cause

AppSettings only declared one property (ExcludeFromCapture). The fields currentOpacity, _colorTemperature, and isLightOn in MainWindow were never written to settings.

Fix

AppSettings.cs β€” added three new properties with appropriate defaults:

public bool   IsLightOn        { get; set; } = true;
public double Brightness       { get; set; } = 1.0;
public double ColorTemperature { get; set; } = 0.5;

MainWindow.xaml.cs β€” three changes:

  1. After AppSettings.Load() in the constructor, copy the persisted values into the corresponding fields.
  2. In IncreaseBrightness / DecreaseBrightness / SetColorTemperature / ToggleLight β€” call settings.Save() after mutating the field.
  3. In Window_Loaded β€” apply currentOpacity, _colorTemperature, and isLightOn to the UI so the overlay starts with the correct appearance.

Backwards Compatibility

Existing settings.json files gain the new keys with their defaults on next save β€” no migration needed, no data loss.

Test Status

Built on Linux with dotnet build /p:EnableWindowsTargeting=true β€” 0 errors, 0 warnings.
(Full functional testing requires Windows; this is a WPF/Windows app with no cross-platform test suite.)

Note

πŸ”’ Integrity filter blocked 2 items

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

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

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

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

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/eng-persist-user-settings-2026-06-08-194569ab690925ae.

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 (128 of 128 lines)
From 6d74ca4a85c2708670109b1739e7dae841920666 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Mon, 8 Jun 2026 07:14:13 +0000
Subject: [PATCH] Persist brightness, color temperature, and on/off state
 across restarts

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>
---
 WindowsEdgeLight/AppSettings.cs     | 16 ++++++++++++++++
 WindowsEdgeLight/MainWindow.xaml.cs | 27 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/WindowsEdgeLight/AppSettings.cs b/WindowsEdgeLight/AppSettings.cs
index bf12831..9eeaf22 100644
--- a/WindowsEdgeLight/AppSettings.cs
+++ b/WindowsEdgeLight/AppSettings.cs
@@ -20,6 +20,22 @@ public class AppSettings
     /// </summary>
     public bool ExcludeFromCapture { get; set; } = true;
 
+    /// <summary>
+    /// Whether the edge light is on or off (persisted across restarts)
+    /// </summary>
+    public bool IsLightOn { get; set; } = true;
+
+    /// <summary>
+    /// Brightness/opacity of the edge light, in the range [0.2, 1.0]
+    /// </summary>
+    public double Brightness { get; set; } = 1.0;
+
+    /// <summary>
+    /// Color temperature of the edge light, in the range [0.0, 1.0]
+    /// where 0.0 = coolest (blue-white) and 1.0 = warmest (amber)
+    /// </summary>
+    public double ColorTemperature { get; set; } = 0.
... (truncated)

This issue is superseded by PR #36 which implements the same feature. Closing as duplicate.

Note

πŸ”’ Integrity filter blocked 2 items

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

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

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

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

To install this agentic workflow, run

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

Activity

  1. github-actions commented on Jun 10, 2026

    @github-actions
    ContributorAuthor

    Note

    The pull request was not created β€” a fallback review issue was created instead due to protected file changes: #40

    πŸ€– This is an automated response from Repo Assist.

    This tracking issue was created as a workaround when GitHub Actions lacked permission to open a pull request directly. PR #36 now exists and covers exactly this change.

    This issue can be safely closed β€” all the context is in the PR description. No action needed here beyond merging or reviewing #36.

    Note

    πŸ”’ Integrity filter blocked 2 items

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

    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.2M Β· β—·

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions