Skip to content

[Repo Assist] feat: persist brightness, colour temperature, on/off state; add Start with WindowsΒ #110

Description

@github-actions

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

Problem

User-configured brightness, colour temperature, and on/off state are lost every time the app restarts β€” they reset to defaults. There is also no way to make the app launch automatically at Windows startup.

Changes

AppSettings.cs

Added four new persisted properties:

Property Type Default Description
Brightness double 1.0 Edge-light opacity (0.2–1.0)
ColorTemperature double 0.5 0 = coolest, 1 = warmest
IsLightOn bool true Whether the light is on
StartWithWindows bool false Launch at Windows startup

MainWindow.xaml.cs

  • Restore on startup (Window_Loaded): applies saved brightness, colour temperature, and on/off state before the first frame is rendered.
  • Persist on change: IncreaseBrightness / DecreaseBrightness save Brightness; SetColorTemperature saves ColorTemperature; ToggleLight saves IsLightOn.
  • Start with Windows: new πŸš€ Start with Windows checked item in the system-tray context menu. Toggling it writes/removes a HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run entry via ApplyStartWithWindows(), which is also called on startup to keep the registry in sync.

Root Cause

AppSettings previously only persisted ExcludeFromCapture. Brightness and colour temperature were held only in private fields and discarded at shutdown.

Trade-offs

  • Each user-triggered change writes the settings JSON (one tiny file). On startup there is one extra write (SetColorTemperature re-saves the loaded value) β€” acceptable.
  • StartWithWindows uses the standard per-user Run key so it does not require elevation and is trivially removable by the user or from Task Manager β†’ Startup.

Test Status

dotnet build -p:EnableWindowsTargeting=true
β†’ Build succeeded. 0 Warning(s), 0 Error(s).

Closes #81, #84, #95, #99, #104, #108

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

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-start-with-windows-2026-07-04-6b31c84a110cdcfc.

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 (191 of 191 lines)
From 1352c1ea97c12f928d45d8b47323b63861fee829 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sat, 4 Jul 2026 13:16:30 +0000
Subject: [PATCH] feat: persist brightness, colour temperature, on/off state
 and add Start with Windows
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- AppSettings: add Brightness (default 1.0), ColorTemperature (default 0.5),
  IsLightOn (default true), and StartWithWindows (default false) properties.
- MainWindow: restore brightness, colour temperature, and on/off state from
  settings in Window_Loaded so user preferences survive restarts.
- MainWindow: save Brightness after IncreaseBrightness / DecreaseBrightness.
- MainWindow: save ColorTemperature at the end of SetColorTemperature.
- MainWindow: save IsLightOn at the end of ToggleLight.
- MainWindow: add 'πŸš€ Start with Windows' checked menu item in the system-tray
  context menu; toggling it writes / removes HKCU Run registry entry via
  ApplyStartWithWindows(). Registry state is also synced on every startup.

Closes #81 #84 #95 #99 #104 #108

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

diff --git a/WindowsEdgeLight/AppSettings.cs b/WindowsEdgeLight/AppSettings.cs
index bf12831..17e0e73 100644
--- a/WindowsEdgeLight/AppSettings.cs
+++ b/WindowsEdgeLight/AppSettings.cs
@@ -20,6 +20,18 @@ public class AppSettings
     /// </summary>
     public bool ExcludeFromCapture { get; set; } = true;
 
+    /// <summary>Brightness level (0.2–1.0). Default is full brightness.</summary>
+    public double Brightness { get; set; } = 1.0;
+
+    /// <summary>Colour temperature (0.0 = coolest, 1.0 = warmest). Default is neutral.</summary>
+    public double ColorTemperature { get; set; } = 0.5;
+
+    /// <summary>Whether t
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions