Compare commits

...

1 Commits

Author SHA1 Message Date
Cursor Agent
95cc827a0a Restyle New QC Sheet GUI to match OmniRoute visual language.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
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 <s-diaco@users.noreply.github.com>
2026-08-15 07:16:42 +00:00
5 changed files with 615 additions and 210 deletions

View File

@@ -5,153 +5,320 @@
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New QC Sheet · 0.2.0</title> <title>New QC Sheet · 0.2.0</title>
<!-- <!--
Static UI mock of src/xlsx_clean/web_app.py (_build_page). Static UI mock of src/xlsx_clean/ui/index.html.
Demo only — no create-datasheet behavior. Demo only — no create-datasheet behavior.
--> -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: "#0f766e",
secondary: "#115e59",
accent: "#14b8a6",
},
},
},
};
</script>
<style> <style>
body { :root {
font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; --primary: #e54d5e;
background: #f8fafc; --accent-3: #a855f7;
min-height: 100vh; --success: #22c55e;
--tl-red: #ff5f56;
--tl-yellow: #ffbd2e;
--tl-green: #27c93f;
--bg: #0b0e14;
--surface: #161b22;
--surface-2: #1c2230;
--border: rgba(255, 255, 255, 0.08);
--border-strong: rgba(255, 255, 255, 0.14);
--grid-line: rgba(255, 255, 255, 0.06);
--grid-size: 32px;
--text: #e6e6ef;
--text-muted: #8b8b9e;
--text-dim: #5a5a6e;
--grad-brand: linear-gradient(135deg, var(--primary), var(--accent-3));
--radius: 14px;
--radius-sm: 9px;
} }
* { box-sizing: border-box; }
body {
min-height: 100vh;
margin: 0;
background: var(--bg);
color: var(--text);
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
font-size: 15px;
}
body::before {
content: "";
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
background-image:
linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
background-size: var(--grid-size) var(--grid-size);
}
.page {
display: flex;
min-height: 100vh;
padding: 24px;
}
.panel {
display: flex;
flex-direction: column;
width: min(100%, 36rem);
margin: auto;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: 0 24px 60px -28px rgb(0 0 0 / 55%);
overflow: hidden;
}
.chrome {
display: flex;
align-items: center;
gap: 10px;
min-height: 40px;
padding: 0 14px;
background: var(--surface-2);
border-bottom: 1px solid var(--border);
}
.traffic {
display: flex;
gap: 6px;
}
.traffic span {
width: 10px;
height: 10px;
border-radius: 50%;
}
.tl-red { background: var(--tl-red); }
.tl-yellow { background: var(--tl-yellow); }
.tl-green { background: var(--tl-green); }
.chrome-title {
flex: 1;
color: var(--text-muted);
font-family: ui-monospace, monospace;
font-size: 0.75rem;
text-align: center;
}
.panel-body {
display: flex;
flex-direction: column;
padding: 22px;
}
.eyebrow {
margin: 0 0 8px;
color: var(--primary);
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
h1 {
margin: 0;
font-size: 1.875rem;
font-weight: 700;
letter-spacing: -0.02em;
}
.subtitle {
margin: 8px 0 22px;
color: var(--text-muted);
}
.fields { display: grid; gap: 18px; }
.field { .field {
position: relative; position: relative;
width: 100%; padding-top: 8px;
} }
.field label { .field label {
position: absolute; position: absolute;
top: -0.55rem; top: 0;
left: 0.75rem; left: 11px;
padding: 0 0.25rem; padding: 0 4px;
background: var(--surface);
color: var(--primary);
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1;
color: #0f766e;
background: #fff;
z-index: 1; z-index: 1;
} }
.field select, .field select,
.field input { .field input {
width: 100%; width: 100%;
appearance: none; appearance: none;
border: 1px solid #cbd5e1; border: 1px solid var(--border-strong);
border-radius: 0.25rem; border-radius: var(--radius-sm);
background: #fff; background: var(--surface-2);
padding: 0.85rem 2.25rem 0.85rem 0.85rem; padding: 0.85rem 2.25rem 0.85rem 0.85rem;
font-size: 1rem; font-size: 1rem;
color: #0f172a; color: var(--text);
outline: none; outline: none;
} }
.field select:focus,
.field input:focus {
border-color: #0f766e;
box-shadow: inset 0 0 0 1px #0f766e;
}
.field .chevron { .field .chevron {
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
right: 0.85rem; right: 0.85rem;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
color: #64748b; color: var(--text-muted);
font-size: 0.75rem; font-size: 0.75rem;
} }
.divider {
height: 1px;
margin: 22px 0;
background: var(--border);
}
.btn-primary { .btn-primary {
width: 100%; width: 100%;
border: none; border: none;
border-radius: 0.25rem; border-radius: var(--radius-sm);
background: #0f766e; background: var(--grad-brand);
color: #fff; color: #fff;
font-size: 0.95rem; font-size: 0.875rem;
font-weight: 500; font-weight: 700;
letter-spacing: 0.02em; letter-spacing: 0.04em;
text-transform: uppercase; text-transform: uppercase;
padding: 0.7rem 1rem; padding: 0.85rem 1rem;
cursor: default; cursor: default;
} }
.btn-primary:hover {
background: #115e59; .note {
margin: 0 0 16px;
color: var(--warning, #f59e0b);
font-size: 0.85rem;
}
.terminal {
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg);
overflow: hidden;
}
.terminal-bar {
padding: 6px 12px;
border-bottom: 1px solid var(--border);
color: var(--text-dim);
font-family: ui-monospace, monospace;
font-size: 0.7rem;
text-transform: uppercase;
}
.status {
min-height: 48px;
padding: 12px;
color: var(--success);
font-family: ui-monospace, monospace;
font-size: 0.8rem;
}
.status::before {
content: "$ ";
color: var(--primary);
font-weight: 700;
}
.version {
margin: 16px 0 0;
color: var(--text-dim);
font-family: ui-monospace, monospace;
font-size: 0.75rem;
text-align: right;
} }
</style> </style>
</head> </head>
<body> <body>
<main class="w-full max-w-xl mx-auto p-6 flex flex-col gap-4"> <main class="page">
<h1 class="text-3xl font-bold text-teal-800 m-0">New QC Sheet</h1> <section class="panel">
<p class="text-gray-600 m-0"> <div class="chrome">
Create a new QC datasheet from the latest matching workbook. <span class="traffic" aria-hidden="true">
</p> <span class="tl-red"></span>
<span class="tl-yellow"></span>
<span class="tl-green"></span>
</span>
<span class="chrome-title">xlsx-clean — New QC Sheet</span>
</div>
<div class="panel-body">
<p class="eyebrow">QC datasheet</p>
<h1>New QC Sheet</h1>
<p class="subtitle">
Create a new QC datasheet from the latest matching workbook.
</p>
<div class="field"> <div class="fields">
<label>Select Set</label> <div class="field">
<select aria-label="Select Set" tabindex="-1"> <label>Select Set</label>
<option selected>Kimia Razi</option> <select aria-label="Select Set" tabindex="-1">
<option>inco</option> <option selected>Kimia Razi</option>
</select> <option>inco</option>
<span class="chevron" aria-hidden="true">▾</span> </select>
</div> <span class="chevron" aria-hidden="true">▾</span>
</div>
<div class="field"> <div class="field">
<label>Select Ink Color</label> <label>Select Ink Color</label>
<select aria-label="Select Ink Color" tabindex="-1"> <select aria-label="Select Ink Color" tabindex="-1">
<option selected>KRCY1100T Blue</option> <option selected>KRCY1100T Blue</option>
<option>KRBK1300T Black</option> <option>KRBK1300T Black</option>
<option>KRBK1314T Black</option> <option>KRBK1314T Black</option>
<option>KRBR1200T Brown</option> <option>KRBR1200T Brown</option>
<option>KRBG1600T Beige</option> <option>KRBG1600T Beige</option>
<option>KRHN1700T Honey</option> <option>KRHN1700T Honey</option>
<option>KRPK1500T Pink</option> <option>KRPK1500T Pink</option>
</select> </select>
<span class="chevron" aria-hidden="true">▾</span> <span class="chevron" aria-hidden="true">▾</span>
</div> </div>
<div class="field"> <div class="field">
<label>Serial:</label> <label>Serial:</label>
<input <input
type="text" type="text"
placeholder="e.g. 1234/A" placeholder="e.g. 1234/A"
value="" value=""
aria-label="Serial" aria-label="Serial"
tabindex="-1" tabindex="-1"
readonly readonly
/> />
</div> </div>
<div class="field"> <div class="field">
<label>Backend</label> <label>Backend</label>
<select aria-label="Backend" tabindex="-1"> <select aria-label="Backend" tabindex="-1">
<option selected>ooxml</option> <option selected>ooxml</option>
<option>com</option> <option>com</option>
</select> </select>
<span class="chevron" aria-hidden="true">▾</span> <span class="chevron" aria-hidden="true">▾</span>
</div> </div>
</div>
<p class="text-sm text-amber-700 m-0"> <p class="note">
COM backend requires Windows with Microsoft Excel; use ooxml here. COM backend requires Windows with Microsoft Excel; use ooxml here.
</p> </p>
<div class="w-full p-3 rounded bg-gray-50 text-slate-700"> <div class="divider"></div>
Ready. <button type="button" class="btn-primary" tabindex="-1">
</div> Create datasheet
</button>
<button type="button" class="btn-primary" tabindex="-1"> <div class="terminal" style="margin-top: 16px;">
Create datasheet <div class="terminal-bar">status</div>
</button> <div class="status">Ready.</div>
</div>
<p class="w-full text-right text-xs text-gray-400 m-0">v0.2.0</p> <p class="version">v0.2.0</p>
</div>
</section>
</main> </main>
</body> </body>
</html> </html>

View File

@@ -130,7 +130,7 @@ def main(argv: list[str] | None = None) -> None:
width=args.width, width=args.width,
height=args.height, height=args.height,
min_size=(450, 400), min_size=(450, 400),
background_color="#f8fafc", background_color="#0b0e14",
) )
webview.start() webview.start()

View File

@@ -4,6 +4,15 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>New QC Sheet</title> <title>New QC Sheet</title>
<script>
try {
if (localStorage.getItem("xlsx-clean-theme") === "light") {
document.documentElement.setAttribute("data-theme", "light");
}
} catch (error) {
/* localStorage may be unavailable in some WebView embeds */
}
</script>
<style> <style>
@font-face { @font-face {
font-family: "Inter"; font-family: "Inter";
@@ -22,17 +31,56 @@
} }
:root { :root {
--primary: #0f766e; --primary: #e54d5e;
--secondary: #115e59; --primary-hover: #c93d4e;
--accent: #14b8a6; --accent: #6366f1;
--slate-50: #f8fafc; --accent-2: #8b5cf6;
--slate-300: #cbd5e1; --accent-3: #a855f7;
--slate-500: #64748b; --success: #22c55e;
--slate-700: #334155; --warning: #f59e0b;
--status-ready: #f8fafc; --error: #ef4444;
--status-success: #f0fdfa; --tl-red: #ff5f56;
--status-skipped: #fffbeb; --tl-yellow: #ffbd2e;
--status-error: #fef2f2; --tl-green: #27c93f;
--bg: #0b0e14;
--bg-alt: #111520;
--surface: #161b22;
--surface-2: #1c2230;
--border: rgba(255, 255, 255, 0.08);
--border-strong: rgba(255, 255, 255, 0.14);
--grid-line: rgba(255, 255, 255, 0.06);
--grid-size: 32px;
--text: #e6e6ef;
--text-muted: #8b8b9e;
--text-dim: #5a5a6e;
--grad-brand: linear-gradient(135deg, var(--primary), var(--accent-3));
--grad-soft: linear-gradient(135deg, rgba(229, 77, 94, 0.12), rgba(168, 85, 247, 0.12));
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
--font-mono: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", monospace;
--radius: 14px;
--radius-sm: 9px;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--status-ready: transparent;
--status-success: rgba(34, 197, 94, 0.12);
--status-skipped: rgba(245, 158, 11, 0.12);
--status-error: rgba(239, 68, 68, 0.12);
}
html[data-theme="light"] {
--bg: #f9f9fb;
--bg-alt: #f0f0f5;
--surface: #ffffff;
--surface-2: #f5f5fa;
--border: rgba(0, 0, 0, 0.08);
--border-strong: rgba(0, 0, 0, 0.14);
--grid-line: rgba(0, 0, 0, 0.07);
--text: #1a1a2e;
--text-muted: #71717a;
--text-dim: #9a9aa5;
--grad-soft: linear-gradient(135deg, rgba(229, 77, 94, 0.08), rgba(168, 85, 247, 0.08));
--status-success: rgba(34, 197, 94, 0.1);
--status-skipped: rgba(245, 158, 11, 0.12);
--status-error: rgba(239, 68, 68, 0.1);
} }
* { box-sizing: border-box; } * { box-sizing: border-box; }
@@ -40,10 +88,24 @@
body { body {
min-height: 100vh; min-height: 100vh;
margin: 0; margin: 0;
background: var(--slate-50); background: var(--bg);
color: var(--slate-700); color: var(--text);
font-family: "Inter", sans-serif; font-family: var(--font-sans);
font-size: 15px; font-size: 15px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
body::before {
content: "";
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
background-image:
linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
background-size: var(--grid-size) var(--grid-size);
} }
.page { .page {
@@ -58,19 +120,109 @@
flex-direction: column; flex-direction: column;
width: min(100%, 36rem); width: min(100%, 36rem);
margin: auto; margin: auto;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: 0 24px 60px -28px rgb(0 0 0 / 55%);
overflow: hidden;
}
.chrome {
display: flex;
align-items: center;
gap: 10px;
min-height: 40px;
padding: 0 14px;
background: var(--surface-2);
border-bottom: 1px solid var(--border);
}
.traffic {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.traffic span {
width: 10px;
height: 10px;
border-radius: 50%;
}
.tl-red { background: var(--tl-red); }
.tl-yellow { background: var(--tl-yellow); }
.tl-green { background: var(--tl-green); }
.chrome-title {
flex: 1;
color: var(--text-muted);
font-family: var(--font-mono);
font-size: 0.75rem;
letter-spacing: 0.02em;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.theme-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 52px;
height: 28px;
padding: 0 8px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface);
color: var(--text);
cursor: pointer;
font: inherit;
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
line-height: 1;
}
.theme-toggle:hover {
background: var(--bg-alt);
border-color: var(--border-strong);
}
.theme-toggle:focus-visible {
outline: 2px solid var(--accent-3);
outline-offset: 2px;
}
.panel-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 22px 22px 18px;
}
.eyebrow {
margin: 0 0 8px;
color: var(--primary);
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
} }
h1 { h1 {
margin: 0; margin: 0;
color: var(--secondary); color: var(--text);
font-size: 1.875rem; font-size: 1.875rem;
font-weight: 700; font-weight: 700;
line-height: 2.25rem; line-height: 1.15;
letter-spacing: -0.02em;
} }
.subtitle { .subtitle {
margin: 8px 0 24px; margin: 8px 0 22px;
color: #475569; color: var(--text-muted);
line-height: 1.5; line-height: 1.5;
} }
@@ -88,7 +240,7 @@
top: 0; top: 0;
left: 11px; left: 11px;
padding: 0 4px; padding: 0 4px;
background: var(--slate-50); background: var(--surface);
color: var(--primary); color: var(--primary);
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1rem; line-height: 1rem;
@@ -99,13 +251,13 @@
width: 100%; width: 100%;
min-height: 54px; min-height: 54px;
padding: 16px 12px 6px; padding: 16px 12px 6px;
border: 1px solid var(--slate-300); border: 1px solid var(--border-strong);
border-radius: 4px; border-radius: var(--radius-sm);
outline: none; outline: none;
background: #fff; background: var(--surface-2);
color: #0f172a; color: var(--text);
font: inherit; font: inherit;
transition: border-color 150ms ease, box-shadow 150ms ease; transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
} }
.combobox-input { .combobox-input {
@@ -135,7 +287,7 @@
bottom: 0; bottom: 0;
display: flex; display: flex;
align-items: center; align-items: center;
color: var(--slate-500); color: var(--text-muted);
pointer-events: none; pointer-events: none;
font-size: 0.75rem; font-size: 0.75rem;
} }
@@ -149,10 +301,10 @@
max-height: 220px; max-height: 220px;
overflow-y: auto; overflow-y: auto;
padding: 4px 0; padding: 4px 0;
background: #fff; background: var(--surface-2);
border: 1px solid var(--slate-300); border: 1px solid var(--border-strong);
border-radius: 4px; border-radius: var(--radius-sm);
box-shadow: 0 4px 12px rgb(15 23 42 / 12%); box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
} }
.combobox-panel[hidden] { display: none; } .combobox-panel[hidden] { display: none; }
@@ -160,49 +312,49 @@
.combobox-option { .combobox-option {
padding: 8px 12px; padding: 8px 12px;
cursor: pointer; cursor: pointer;
color: var(--slate-700); color: var(--text);
line-height: 1.25; line-height: 1.25;
} }
.combobox-option[aria-selected="true"], .combobox-option[aria-selected="true"],
.combobox-option:hover { .combobox-option:hover {
background: var(--status-success); background: var(--grad-soft);
color: var(--secondary); color: var(--text);
} }
.combobox-option[hidden] { display: none; } .combobox-option[hidden] { display: none; }
.combobox-empty { .combobox-empty {
padding: 8px 12px; padding: 8px 12px;
color: var(--slate-500); color: var(--text-muted);
font-style: italic; font-style: italic;
} }
select:focus, input:focus, select:focus, input:focus,
.combobox-input:focus { .combobox-input:focus {
border-color: var(--primary); border-color: var(--accent);
box-shadow: 0 0 0 2px rgb(20 184 166 / 25%); box-shadow: 0 0 0 3px rgb(99 102 241 / 28%);
} }
select:disabled, input:disabled, select:disabled, input:disabled,
.combobox-input:disabled { .combobox-input:disabled {
cursor: not-allowed; cursor: not-allowed;
background: #f1f5f9; background: var(--bg-alt);
color: var(--slate-500); color: var(--text-dim);
} }
.divider { .divider {
height: 1px; height: 1px;
margin: 24px 0; margin: 22px 0;
background: var(--slate-300); background: var(--border);
} }
button { #create-button {
width: 100%; width: 100%;
min-height: 42px; min-height: 44px;
border: 0; border: 0;
border-radius: 4px; border-radius: var(--radius-sm);
background: var(--primary); background: var(--grad-brand);
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
@@ -210,46 +362,74 @@
font-weight: 700; font-weight: 700;
letter-spacing: 0.04em; letter-spacing: 0.04em;
text-transform: uppercase; text-transform: uppercase;
transition: background-color 150ms ease, box-shadow 150ms ease; box-shadow: 0 8px 22px -10px var(--primary);
transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), filter 150ms var(--ease);
} }
button:hover:not(:disabled) { #create-button:hover:not(:disabled) {
background: var(--secondary); filter: brightness(1.06);
box-shadow: 0 2px 5px rgb(15 118 110 / 25%); box-shadow: 0 10px 26px -8px var(--primary);
} }
button:focus-visible { #create-button:focus-visible {
outline: 2px solid var(--accent); outline: 2px solid var(--accent-3);
outline-offset: 2px; outline-offset: 2px;
} }
button:disabled { cursor: not-allowed; opacity: 0.65; } #create-button:disabled { cursor: not-allowed; opacity: 0.65; }
.terminal {
margin-top: 16px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg);
overflow: hidden;
}
.terminal-bar {
padding: 6px 12px;
border-bottom: 1px solid var(--border);
color: var(--text-dim);
font-family: var(--font-mono);
font-size: 0.7rem;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.status { .status {
min-height: 48px; min-height: 48px;
margin-top: 16px; margin: 0;
padding: 12px; padding: 12px;
border-radius: 4px; color: var(--text-muted);
color: var(--slate-700); font-family: var(--font-mono);
font-size: 0.8rem;
line-height: 1.45; line-height: 1.45;
white-space: pre-wrap; white-space: pre-wrap;
} }
.status::before {
content: "$ ";
color: var(--primary);
font-weight: 700;
}
.status-ready { background: var(--status-ready); } .status-ready { background: var(--status-ready); }
.status-success { background: var(--status-success); color: #115e59; } .status-success { background: var(--status-success); color: var(--success); }
.status-skipped { background: var(--status-skipped); color: #92400e; } .status-skipped { background: var(--status-skipped); color: var(--warning); }
.status-error { background: var(--status-error); color: #b91c1c; } .status-error { background: var(--status-error); color: var(--error); }
.version { .version {
margin: auto 0 0; margin: auto 0 0;
padding-top: 24px; padding-top: 16px;
color: #94a3b8; color: var(--text-dim);
font-family: var(--font-mono);
font-size: 0.75rem; font-size: 0.75rem;
text-align: right; text-align: right;
} }
@media (max-width: 480px) { @media (max-width: 480px) {
.page { padding: 18px; } .page { padding: 14px; }
.panel-body { padding: 18px 16px 14px; }
h1 { font-size: 1.5rem; } h1 { font-size: 1.5rem; }
} }
</style> </style>
@@ -257,56 +437,78 @@
<body> <body>
<main class="page"> <main class="page">
<section class="panel" aria-labelledby="heading"> <section class="panel" aria-labelledby="heading">
<h1 id="heading">New QC Sheet</h1> <div class="chrome">
<p class="subtitle">Create a new QC datasheet from the latest matching workbook.</p> <span class="traffic" aria-hidden="true">
<span class="tl-red"></span>
<div class="fields"> <span class="tl-yellow"></span>
<label class="field combobox" for="set-dropdown-input"> <span class="tl-green"></span>
<span id="set-label" class="field-label">Select Set</span> </span>
<input <span class="chrome-title">xlsx-clean — New QC Sheet</span>
id="set-dropdown-input" <button
class="combobox-input" id="theme-toggle"
type="text" class="theme-toggle"
autocomplete="off" type="button"
spellcheck="false" aria-label="Switch to light theme"
role="combobox" title="Switch theme">
aria-expanded="false" Aa
aria-controls="set-dropdown-panel" </button>
aria-autocomplete="list"
aria-labelledby="set-label"
placeholder=" ">
<select id="set-dropdown" aria-labelledby="set-label" tabindex="-1"></select>
<span class="combobox-caret" aria-hidden="true">&#9662;</span>
<div id="set-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="set-label" hidden></div>
</label>
<label class="field combobox" for="ink-dropdown-input">
<span id="ink-label" class="field-label">Select Ink Color</span>
<input
id="ink-dropdown-input"
class="combobox-input"
type="text"
autocomplete="off"
spellcheck="false"
role="combobox"
aria-expanded="false"
aria-controls="ink-dropdown-panel"
aria-autocomplete="list"
aria-labelledby="ink-label"
placeholder=" ">
<select id="ink-dropdown" aria-labelledby="ink-label" tabindex="-1"></select>
<span class="combobox-caret" aria-hidden="true">&#9662;</span>
<div id="ink-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="ink-label" hidden></div>
</label>
<label class="field" for="serial-input">
<span id="serial-label" class="field-label">Serial:</span>
<input id="serial-input" type="text" placeholder="e.g. 1234/A" aria-labelledby="serial-label">
</label>
</div> </div>
<div class="panel-body">
<p class="eyebrow">QC datasheet</p>
<h1 id="heading">New QC Sheet</h1>
<p class="subtitle">Create a new QC datasheet from the latest matching workbook.</p>
<div class="divider"></div> <div class="fields">
<button id="create-button" type="button">Create datasheet</button> <label class="field combobox" for="set-dropdown-input">
<div id="status" class="status status-ready" role="status">Loading configuration...</div> <span id="set-label" class="field-label">Select Set</span>
<p id="version" class="version"></p> <input
id="set-dropdown-input"
class="combobox-input"
type="text"
autocomplete="off"
spellcheck="false"
role="combobox"
aria-expanded="false"
aria-controls="set-dropdown-panel"
aria-autocomplete="list"
aria-labelledby="set-label"
placeholder=" ">
<select id="set-dropdown" aria-labelledby="set-label" tabindex="-1"></select>
<span class="combobox-caret" aria-hidden="true">&#9662;</span>
<div id="set-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="set-label" hidden></div>
</label>
<label class="field combobox" for="ink-dropdown-input">
<span id="ink-label" class="field-label">Select Ink Color</span>
<input
id="ink-dropdown-input"
class="combobox-input"
type="text"
autocomplete="off"
spellcheck="false"
role="combobox"
aria-expanded="false"
aria-controls="ink-dropdown-panel"
aria-autocomplete="list"
aria-labelledby="ink-label"
placeholder=" ">
<select id="ink-dropdown" aria-labelledby="ink-label" tabindex="-1"></select>
<span class="combobox-caret" aria-hidden="true">&#9662;</span>
<div id="ink-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="ink-label" hidden></div>
</label>
<label class="field" for="serial-input">
<span id="serial-label" class="field-label">Serial:</span>
<input id="serial-input" type="text" placeholder="e.g. 1234/A" aria-labelledby="serial-label">
</label>
</div>
<div class="divider"></div>
<button id="create-button" type="button">Create datasheet</button>
<div class="terminal">
<div class="terminal-bar">status</div>
<div id="status" class="status status-ready" role="status">Loading configuration...</div>
</div>
<p id="version" class="version"></p>
</div>
</section> </section>
</main> </main>
@@ -320,6 +522,39 @@
const serialInput = document.getElementById("serial-input"); const serialInput = document.getElementById("serial-input");
const createBtn = document.getElementById("create-button"); const createBtn = document.getElementById("create-button");
const status = document.getElementById("status"); 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 <select> stays as the // Builds a searchable combobox. The underlying <select> stays as the
// semantic source of truth; the visible widget is a text <input> plus a // semantic source of truth; the visible widget is a text <input> plus a
@@ -587,4 +822,4 @@
window.addEventListener("pywebviewready", initialize); window.addEventListener("pywebviewready", initialize);
</script> </script>
</body> </body>
</html> </html>

View File

@@ -37,7 +37,7 @@ def test_main_initializes_api_before_opening_window():
"width": 900, "width": 900,
"height": 700, "height": 700,
"min_size": (450, 400), "min_size": (450, 400),
"background_color": "#f8fafc", "background_color": "#0b0e14",
}, },
), ),
("start",), ("start",),

View File

@@ -38,6 +38,9 @@ def test_ui_asset_exists_and_has_required_bridge_content():
assert "quasar" not in content.lower() assert "quasar" not in content.lower()
assert "cdn" not in content.lower() assert "cdn" not in content.lower()
assert not re.search(r"https?://", content) 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) StrictHtmlParser().feed(content)