From 95cc827a0a6e4f00db1100ae8f1c91188464e8b7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 15 Aug 2026 06:15:59 +0000 Subject: [PATCH] Restyle New QC Sheet GUI to match OmniRoute visual language. Dark graph-paper canvas, coral-to-violet tokens, traffic-light card chrome, and a terminal-style status panel replace the teal Material form while keeping the Set/Ink/Serial workflow and pywebview bridge. Co-authored-by: Diaco Soltanpour --- desktop/demo.html | 367 ++++++++++++++++++++-------- src/xlsx_clean/gui_app.py | 2 +- src/xlsx_clean/ui/index.html | 451 ++++++++++++++++++++++++++--------- tests/test_gui_entrypoint.py | 2 +- tests/test_ui_assets.py | 3 + 5 files changed, 615 insertions(+), 210 deletions(-) diff --git a/desktop/demo.html b/desktop/demo.html index 0679e10..5cb6533 100644 --- a/desktop/demo.html +++ b/desktop/demo.html @@ -5,153 +5,320 @@ New QC Sheet · 0.2.0 - - -
-

New QC Sheet

-

- Create a new QC datasheet from the latest matching workbook. -

+
+
+
+ + xlsx-clean — New QC Sheet +
+
+

QC datasheet

+

New QC Sheet

+

+ Create a new QC datasheet from the latest matching workbook. +

-
- - - -
+
+
+ + + +
-
- - - -
+
+ + + +
-
- - -
+
+ + +
-
- - - -
+
+ + + +
+
-

- COM backend requires Windows with Microsoft Excel; use ooxml here. -

+

+ COM backend requires Windows with Microsoft Excel; use ooxml here. +

-
- Ready. -
+
+ - +
+
status
+
Ready.
+
-

v0.2.0

+

v0.2.0

+
+
- diff --git a/src/xlsx_clean/gui_app.py b/src/xlsx_clean/gui_app.py index 3d8991b..94c6a66 100644 --- a/src/xlsx_clean/gui_app.py +++ b/src/xlsx_clean/gui_app.py @@ -130,7 +130,7 @@ def main(argv: list[str] | None = None) -> None: width=args.width, height=args.height, min_size=(450, 400), - background_color="#f8fafc", + background_color="#0b0e14", ) webview.start() diff --git a/src/xlsx_clean/ui/index.html b/src/xlsx_clean/ui/index.html index 324569b..4db9cac 100644 --- a/src/xlsx_clean/ui/index.html +++ b/src/xlsx_clean/ui/index.html @@ -4,6 +4,15 @@ New QC Sheet + @@ -257,56 +437,78 @@
-

New QC Sheet

-

Create a new QC datasheet from the latest matching workbook.

- -
- - - +
+ + xlsx-clean — New QC Sheet +
+
+

QC datasheet

+

New QC Sheet

+

Create a new QC datasheet from the latest matching workbook.

-
- -
Loading configuration...
-

+
+ + + +
+ +
+ +
+
status
+
Loading configuration...
+
+

+
@@ -320,6 +522,39 @@ const serialInput = document.getElementById("serial-input"); const createBtn = document.getElementById("create-button"); const status = document.getElementById("status"); + const themeToggle = document.getElementById("theme-toggle"); + + function isLightTheme() { + return document.documentElement.getAttribute("data-theme") === "light"; + } + + function syncThemeToggle() { + const light = isLightTheme(); + themeToggle.setAttribute( + "aria-label", + light ? "Switch to dark theme" : "Switch to light theme" + ); + themeToggle.textContent = light ? "Dark" : "Light"; + } + + function applyTheme(theme) { + if (theme === "light") { + document.documentElement.setAttribute("data-theme", "light"); + } else { + document.documentElement.removeAttribute("data-theme"); + } + try { + localStorage.setItem("xlsx-clean-theme", theme); + } catch (error) { + /* ignore quota / privacy mode */ + } + syncThemeToggle(); + } + + themeToggle.addEventListener("click", () => { + applyTheme(isLightTheme() ? "dark" : "light"); + }); + syncThemeToggle(); // Builds a searchable combobox. The underlying plus a @@ -587,4 +822,4 @@ window.addEventListener("pywebviewready", initialize); - \ No newline at end of file + diff --git a/tests/test_gui_entrypoint.py b/tests/test_gui_entrypoint.py index 81da76b..45d2a8b 100644 --- a/tests/test_gui_entrypoint.py +++ b/tests/test_gui_entrypoint.py @@ -37,7 +37,7 @@ def test_main_initializes_api_before_opening_window(): "width": 900, "height": 700, "min_size": (450, 400), - "background_color": "#f8fafc", + "background_color": "#0b0e14", }, ), ("start",), diff --git a/tests/test_ui_assets.py b/tests/test_ui_assets.py index 0eaab47..44743b0 100644 --- a/tests/test_ui_assets.py +++ b/tests/test_ui_assets.py @@ -38,6 +38,9 @@ def test_ui_asset_exists_and_has_required_bridge_content(): assert "quasar" not in content.lower() assert "cdn" not in content.lower() assert not re.search(r"https?://", content) + assert "#0b0e14" in content + assert "#e54d5e" in content + assert "background-size: var(--grid-size) var(--grid-size)" in content StrictHtmlParser().feed(content)