Repository navigation
Description
π€ This pull request was created by Repo Assist, an automated AI assistant.
Summary
Removes two instances of copy-pasted logic from MainWindow.xaml.cs β no behaviour change.
Changes
1. Colour-temperature colour helper
SetColorTemperature and UpdateAdditionalMonitorWindows each contained an identical local Lerp closure plus identical cool/warm colour definitions and gradient-stop loop. Extracted into two private static helpers:
ComputeTemperatureColor(double temperature)β returns the interpolatedColorApplyTemperatureColorToBrush(LinearGradientBrush brush, double temperature)β applies it to the inner gradient stops
Both call sites are now one line each.
2. Frame geometry constants
CreateFrameGeometry, CreateMonitorWindow, and UpdateMonitorGeometry each declared the same three local constants:
const double frameThickness = 80;
const double outerRadius = 100;
const double innerRadius = 60;Promoted to class-level private const fields (FrameThickness, FrameOuterRadius, FrameInnerRadius). Any future adjustment to the frame shape now requires a single edit.
Test Status
Build: 0 errors, 0 warnings (dotnet build -p:EnableWindowsTargeting=true)
Note
π Integrity filter blocked 1 item
The following item were blocked because they don't meet the GitHub integrity level.
- 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 | noneGenerated by Repo Assist Β· β 2.9M Β· β·
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/improve-dedup-2026-07-14-e0d27251d48fa4c9.
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 (175 of 175 lines)
From 0b6f267b4dd6b3bab99284299c9c5e8cdb353ac4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 14 Jul 2026 01:16:20 +0000
Subject: [PATCH] refactor: eliminate duplicated Lerp/frame-constants in
MainWindow
- Add ComputeTemperatureColor and ApplyTemperatureColorToBrush helpers,
replacing identical local Lerp closures in SetColorTemperature and
UpdateAdditionalMonitorWindows
- Promote FrameThickness / FrameOuterRadius / FrameInnerRadius to
class-level constants, replacing three separate sets of identical
local const declarations in CreateFrameGeometry, CreateMonitorWindow,
and UpdateMonitorGeometry
No behaviour change. Build: 0 errors, 0 warnings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
WindowsEdgeLight/MainWindow.xaml.cs | 97 ++++++++++++-----------------
1 file changed, 39 insertions(+), 58 deletions(-)
diff --git a/WindowsEdgeLight/MainWindow.xaml.cs b/WindowsEdgeLight/MainWindow.xaml.cs
index 3644301..b8f58c7 100644
--- a/WindowsEdgeLight/MainWindow.xaml.cs
+++ b/WindowsEdgeLight/MainWindow.xaml.cs
@@ -26,6 +26,11 @@ public partial class MainWindow : Window
private const double MinColorTemp = 0.0;
private const double MaxColorTemp = 1.0;
+ // Frame geometry constants (shared by CreateFrameGeometry, CreateMonitorWindow, UpdateMonitorGeometry)
+ private const double FrameThickness = 80;
+ private const double FrameOuterRadius = 100;
+ private const double FrameInnerRadius = 60;
+
// DPI Scale
private double _dpiScaleX = 1.0;
private double _dpiScaleY = 1.0;
@@ -570,9 +575,9 @@ Version {version}";
double width = this.ActualWidth - 40; // 20px margin on each side
double height = this.ActualHeight - 40;
- const double frameThickness = 80;
- const double outerRadius = 100; // Extra rounded like macOS
- const double innerRadius = 60; // Keep proportional
+ const do
... (truncated)
Activity
shanselman commentedon Aug 8, 2026
Refactor-only churn does not meet the significance bar.