Compare commits

..

13 Commits

Author SHA1 Message Date
Cursor Agent
ed2573d8e4 Require the combobox mousedown handler to call open().
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
The previous substring only checked that a mousedown listener exists.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:43:17 +00:00
Cursor Agent
9121200bfa Reopen combobox on input mousedown after selection.
Selecting an option closes the list without blurring the input, so a later
click never fires focus. Open the panel on mousedown as well.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:42:50 +00:00
Cursor Agent
31cd1783a1 Sync the ink combobox text as soon as the set's ink list rebuilds.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Previously the visible value stayed on the old ink until the box was
clicked, because rebuild only copied the select when the input was empty.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:18:11 +00:00
Cursor Agent
4fdccfb805 Place field labels in document flow above the inputs.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:05:22 +00:00
Cursor Agent
1b933d9042 Give field labels more clearance above the input borders.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:03:54 +00:00
Cursor Agent
97130034dd Sit field labels just above the boxes, clear of the border.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 08:02:27 +00:00
Cursor Agent
653d569149 Revert "Float field labels on focus or value, Material outlined style."
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
This reverts commit 757781f7a0.
2026-08-15 07:59:54 +00:00
Cursor Agent
757781f7a0 Float field labels on focus or value, Material outlined style.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Empty labels sit inside the box; they move up to the border when the
field is focused or has a value.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 07:53:44 +00:00
Cursor Agent
0d6c215fa7 Set field-label backgrounds to 50% opacity of the canvas color.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 07:45:46 +00:00
Cursor Agent
48d9356d10 Make floating field labels transparent so the grid shows through.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 07:37:45 +00:00
Cursor Agent
6d27bceb14 Stop the form panel from stretching so the graph-paper canvas shows through.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 07:32:25 +00:00
Cursor Agent
f2150f9243 Flatten GUI chrome so the form sits on the graph-paper canvas.
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Remove the nested traffic-light window, drop desktop/demo.html, and keep
the OmniRoute grid visible behind the operator form in both themes.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
2026-08-15 07:30:02 +00:00
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
8 changed files with 88 additions and 395 deletions

View File

@@ -39,12 +39,10 @@ To put a self-contained app on other PCs (build **on Windows**):
| Step | Action |
|------|--------|
| 1 | Resolve `[YEAR]` and find the latest matching workbook (template) in that product folder |
| 1 | Find the latest matching workbook in the product folder |
| 2 | Clear configured cells / blank notes |
| 3 | Write the batch serial |
| 4 | Save under the largest existing year folder using the `[SERIAL]` name pattern |
Year folders in `file_data.csv` use a `[YEAR]` placeholder. The template is read from the largest digit-named year directory that already contains matching sheets for that ink. The new workbook is written into the largest digit-named year directory under the same QC parent (existence only; the ink folder is created if missing).
| 4 | Save as a new file using the `[SERIAL]` name pattern |
### Excel backends
@@ -135,7 +133,7 @@ Windows CLI helper: `src\xlsx_clean\new_xslx.bat`
| File | Purpose |
|------|---------|
| `config.toml` | Backend choice and root directory path for each set (auto-generated in `~/.xlsx-clean/` on first run) |
| `src/xlsx_clean/file_data.csv` | Relative product folders (`[YEAR]` placeholder), filename patterns, cells to clear/set |
| `src/xlsx_clean/file_data.csv` | Relative product folders, filename patterns, cells to clear/set |
| `src/xlsx_clean/strings.txt` | UI prompts + Windows Excel add-in paths (`com` only) |
## Project layout (launchers)

View File

@@ -2,78 +2,17 @@
from __future__ import annotations
import logging
import shutil
import sys
from pathlib import Path
# Excel xlMaximized — avoid win32.constants when gen_py early-binding cache is corrupt.
_XL_MAXIMIZED = -4137
_log = logging.getLogger("xlsx_clean.create")
def _is_gen_py_cache_error(exc: BaseException) -> bool:
"""True for the known corrupt gen_py AttributeError (CLSIDTo*Map missing)."""
if not isinstance(exc, AttributeError):
return False
msg = str(exc)
return "CLSIDToClassMap" in msg or "CLSIDToPackageMap" in msg
def _clear_gen_py_cache() -> Path | None:
"""Remove win32com's generated typelib cache and drop it from sys.modules."""
import win32com
gen_path = Path(win32com.__gen_path__)
for name in [m for m in sys.modules if m.startswith("win32com.gen_py")]:
del sys.modules[name]
if gen_path.is_dir():
shutil.rmtree(gen_path, ignore_errors=True)
return gen_path
return None
def _excel_application():
"""Return Excel.Application, recovering from a corrupt win32com gen_py cache.
``gencache.EnsureDispatch`` writes early-binding wrappers under ``%TEMP%\\gen_py``.
Interrupted or partial writes leave modules without ``CLSIDToClassMap`` /
``CLSIDToPackageMap``; deleting that folder and retrying fixes it (same as the
manual workaround). Falls back to late-bound ``Dispatch`` if rebuild still fails.
"""
import win32com.client as win32
try:
return win32.gencache.EnsureDispatch("Excel.Application")
except AttributeError as exc:
if not _is_gen_py_cache_error(exc):
raise
cleared = _clear_gen_py_cache()
_log.warning(
"Corrupt win32com gen_py cache (%s); cleared %s and retrying",
exc,
cleared or "(missing)",
)
try:
return win32.gencache.EnsureDispatch("Excel.Application")
except AttributeError as retry_exc:
if not _is_gen_py_cache_error(retry_exc):
raise
_log.warning(
"EnsureDispatch still failing after cache clear (%s); using late-bound Dispatch",
retry_exc,
)
return win32.Dispatch("Excel.Application")
def _bring_excel_to_front(excel, workbook) -> None:
"""Maximize and force Excel ahead of other windows (e.g. NiceGUI)."""
import win32com.client as win32
import win32con
import win32gui
excel.Visible = True
excel.WindowState = _XL_MAXIMIZED
excel.WindowState = win32.constants.xlMaximized
try:
workbook.Activate()
except Exception:
@@ -118,12 +57,16 @@ def clean_workbook_com(
maximize: bool = True,
) -> None:
"""Clear/set cells via Excel COM, SaveAs destination, leave Excel open."""
# Lazy import so Linux never loads pywin32 (only needed if callers import helpers).
# Lazy import so Linux never loads pywin32.
import win32com.client as win32
source = Path(source)
destination = Path(destination)
destination.parent.mkdir(parents=True, exist_ok=True)
excel = _excel_application()
# AttributeError: ... has no attribute 'CLSIDToClassMap'
# https://stackoverflow.com/questions/52889704
excel = win32.gencache.EnsureDispatch("Excel.Application")
excel.Visible = visible
workbook = excel.Workbooks.Open(str(source.resolve()))

View File

@@ -6,6 +6,7 @@ import csv
import shutil
import tempfile
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
import tomllib
@@ -32,7 +33,6 @@ backend = "com"
NEW_VALUE = ""
YEAR_TOKEN = "[YEAR]"
@dataclass(frozen=True)
@@ -49,61 +49,15 @@ def find_last_workbook(files: list[str]) -> str:
return sorted(files)[-1]
def _split_year_placeholder(dir_with_placeholder: Path) -> tuple[Path, tuple[str, ...]] | None:
parts = dir_with_placeholder.parts
if YEAR_TOKEN not in parts:
return None
idx = parts.index(YEAR_TOKEN)
return Path(*parts[:idx]), parts[idx + 1 :]
def _digit_year_dirs(base: Path) -> list[Path]:
if not base.is_dir():
return []
return [c for c in base.iterdir() if c.is_dir() and c.name.isdigit()]
def resolve_year_dir(dir_with_placeholder: Path, pattern: str) -> Path:
"""Largest digit year dir that has matching template sheets for this ink."""
split = _split_year_placeholder(dir_with_placeholder)
if split is None:
return dir_with_placeholder
base, suffix = split
search_pattern = pattern.replace("[SERIAL]", "*")
years: list[int] = []
for child in _digit_year_dirs(base):
ink_dir = child.joinpath(*suffix) if suffix else child
if any(p.is_file() for p in ink_dir.glob(search_pattern)):
years.append(int(child.name))
if not years:
raise FileNotFoundError(
f"No year directory under {base} with workbooks matching {search_pattern!r}"
)
resolved = base / str(max(years))
return resolved.joinpath(*suffix) if suffix else resolved
def resolve_write_year_dir(dir_with_placeholder: Path) -> Path:
"""Largest digit year dir under the QC parent (existence only, no sheet check)."""
split = _split_year_placeholder(dir_with_placeholder)
if split is None:
return dir_with_placeholder
base, suffix = split
years = [int(c.name) for c in _digit_year_dirs(base)]
if not years:
raise FileNotFoundError(f"No year directory under {base}")
resolved = base / str(max(years))
return resolved.joinpath(*suffix) if suffix else resolved
def get_workbook_names(
files: list[str],
batch_serial: str,
dest_dir: Path,
source_dir: Path,
pattern: str,
) -> tuple[str, Path]:
last_workbook = find_last_workbook(files)
return last_workbook, dest_dir / pattern.replace(
path_of_the_year = Path(str(source_dir).replace("2025", str(datetime.now().year)))
return last_workbook, path_of_the_year / pattern.replace(
"[SERIAL]", batch_serial.split("/")[0]
)
@@ -205,20 +159,13 @@ def create_datasheet(
return CreateResult(ok=False, message=message)
row = matches[0]
path_ = Path(row["dir"])
pattern = row["pattern"]
placeholder_dir = Path(row["dir"])
try:
read_dir = resolve_year_dir(placeholder_dir, pattern)
write_dir = resolve_write_year_dir(placeholder_dir)
except FileNotFoundError as exc:
message = str(exc)
log.error("Create failed: %s (%s)", message, ctx)
return CreateResult(ok=False, message=message, backend=resolved_backend)
search_pattern = pattern.replace("[SERIAL]", "*")
files = [str(x) for x in read_dir.glob(search_pattern) if x.is_file()]
files = [str(x) for x in path_.glob(search_pattern) if x.is_file()]
if not files:
message = f"No workbooks matching {search_pattern!r} in {read_dir}"
message = f"No workbooks matching {search_pattern!r} in {path_}"
log.error("Create failed: %s (%s)", message, ctx)
return CreateResult(
ok=False,
@@ -227,7 +174,7 @@ def create_datasheet(
)
ref_workbook_name, new_workbook_name = get_workbook_names(
files, batch_serial, write_dir, pattern
files, batch_serial, path_, pattern
)
template = Path(ref_workbook_name)

View File

@@ -1,25 +1,25 @@
dir,pattern,set_name,cells_to_clear,serial_cell,notes_cell
Production\QC Datasheet\[YEAR]\KRCY1100T Blue,KRCY1100T Blue [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRBK1300T Black,KRBK1300T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRBK1314T Black,KRBK1314T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12:I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRBR1200T Brown,KRBR1200T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRBR1201T Brown,KRBR1201T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRYL1400T Yellow,KRYL1400T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRYL1401T Yellow,KRYL1401T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRBG1600T Beige,KRBG1600T Beige [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRPK1500T Pink,KRPK1500T Pink [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\[YEAR]\KRHN1700T Honey,KRHN1700T Honey [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ108 Beige,ICJ_108 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ610 Black,ICJ_610 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ308 Blue,ICJ_308 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJEH680 Black,ICJ_EH680 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJEH630 Black,ICJ_EH630 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJEH600 Black,ICJ_EH600 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ407 Brown,ICJ_407 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\[YEAR]\ICJ408 Brown,ICJ_408 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\[YEAR]\ICJ435 Beige,ICJ_435 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\[YEAR]\ICJ107 Yellow,ICJ_107 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ703 Pink,ICJ_703 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ309 Cyan,ICJ_309 cyan op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ109 Golden Yellow,ICJ_109 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\[YEAR]\ICJ152 Yellow,ICJ_152 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRCY1100T Blue,KRCY1100T Blue [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRBK1300T Black,KRBK1300T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRBK1314T Black,KRBK1314T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12:I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRBR1200T Brown,KRBR1200T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRBR1201T Brown,KRBR1201T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRYL1400T Yellow,KRYL1400T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRYL1401T Yellow,KRYL1401T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRBG1600T Beige,KRBG1600T Beige [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRPK1500T Pink,KRPK1500T Pink [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Production\QC Datasheet\1403\KRHN1700T Honey,KRHN1700T Honey [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
Quality control data sheet\2025\ICJ108 Beige,ICJ_108 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2026\ICJ610 Black,ICJ_610 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2026\ICJ308 Blue,ICJ_308 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2026\ICJEH680 Black,ICJ_EH680 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2026\ICJEH630 Black,ICJ_EH630 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2025\ICJEH600 Black,ICJ_EH600 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2025\ICJ407 Brown,ICJ_407 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\2025\ICJ408 Brown,ICJ_408 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\2026\ICJ435 Beige,ICJ_435 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
Quality control data sheet\2025\ICJ107 Yellow,ICJ_107 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2025\ICJ703 Pink,ICJ_703 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2024\ICJ309 Cyan,ICJ_309 cyan op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2025\ICJ109 Golden Yellow,ICJ_109 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
Quality control data sheet\2026\ICJ152 Yellow,ICJ_152 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
1 dir pattern set_name cells_to_clear serial_cell notes_cell
2 Production\QC Datasheet\[YEAR]\KRCY1100T Blue Production\QC Datasheet\1403\KRCY1100T Blue KRCY1100T Blue [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
3 Production\QC Datasheet\[YEAR]\KRBK1300T Black Production\QC Datasheet\1403\KRBK1300T Black KRBK1300T Black [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
4 Production\QC Datasheet\[YEAR]\KRBK1314T Black Production\QC Datasheet\1403\KRBK1314T Black KRBK1314T Black [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!G12:I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
5 Production\QC Datasheet\[YEAR]\KRBR1200T Brown Production\QC Datasheet\1403\KRBR1200T Brown KRBR1200T Brown [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11 Batch!D3 Batch!D25
6 Production\QC Datasheet\[YEAR]\KRBR1201T Brown Production\QC Datasheet\1403\KRBR1201T Brown KRBR1201T Brown [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11 Batch!D3 Batch!D25
7 Production\QC Datasheet\[YEAR]\KRYL1400T Yellow Production\QC Datasheet\1403\KRYL1400T Yellow KRYL1400T Yellow [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
8 Production\QC Datasheet\[YEAR]\KRYL1401T Yellow Production\QC Datasheet\1403\KRYL1401T Yellow KRYL1401T Yellow [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11 Batch!D3 Batch!D25
9 Production\QC Datasheet\[YEAR]\KRBG1600T Beige Production\QC Datasheet\1403\KRBG1600T Beige KRBG1600T Beige [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
10 Production\QC Datasheet\[YEAR]\KRPK1500T Pink Production\QC Datasheet\1403\KRPK1500T Pink KRPK1500T Pink [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
11 Production\QC Datasheet\[YEAR]\KRHN1700T Honey Production\QC Datasheet\1403\KRHN1700T Honey KRHN1700T Honey [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3 Batch!D25
12 Quality control data sheet\[YEAR]\ICJ108 Beige Quality control data sheet\2025\ICJ108 Beige ICJ_108 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
13 Quality control data sheet\[YEAR]\ICJ610 Black Quality control data sheet\2026\ICJ610 Black ICJ_610 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
14 Quality control data sheet\[YEAR]\ICJ308 Blue Quality control data sheet\2026\ICJ308 Blue ICJ_308 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
15 Quality control data sheet\[YEAR]\ICJEH680 Black Quality control data sheet\2026\ICJEH680 Black ICJ_EH680 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
16 Quality control data sheet\[YEAR]\ICJEH630 Black Quality control data sheet\2026\ICJEH630 Black ICJ_EH630 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
17 Quality control data sheet\[YEAR]\ICJEH600 Black Quality control data sheet\2025\ICJEH600 Black ICJ_EH600 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
18 Quality control data sheet\[YEAR]\ICJ407 Brown Quality control data sheet\2025\ICJ407 Brown ICJ_407 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D24
19 Quality control data sheet\[YEAR]\ICJ408 Brown Quality control data sheet\2025\ICJ408 Brown ICJ_408 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D24
20 Quality control data sheet\[YEAR]\ICJ435 Beige Quality control data sheet\2026\ICJ435 Beige ICJ_435 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D24
21 Quality control data sheet\[YEAR]\ICJ107 Yellow Quality control data sheet\2025\ICJ107 Yellow ICJ_107 yellow op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
22 Quality control data sheet\[YEAR]\ICJ703 Pink Quality control data sheet\2025\ICJ703 Pink ICJ_703 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
23 Quality control data sheet\[YEAR]\ICJ309 Cyan Quality control data sheet\2024\ICJ309 Cyan ICJ_309 cyan op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
24 Quality control data sheet\[YEAR]\ICJ109 Golden Yellow Quality control data sheet\2025\ICJ109 Golden Yellow ICJ_109 op. [SERIAL].xlsx inco Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25
25 Quality control data sheet\[YEAR]\ICJ152 Yellow Quality control data sheet\2026\ICJ152 Yellow ICJ_152 yellow op. [SERIAL].xlsx inco Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11 Batch!D3 Batch!D25

View File

@@ -394,53 +394,51 @@
</div>
<p class="subtitle">Create a new QC datasheet from the latest matching workbook.</p>
<form id="create-form">
<div class="fields">
<label class="field combobox" for="set-dropdown-input">
<span id="set-label" class="field-label">Select Set</span>
<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="fields">
<label class="field combobox" for="set-dropdown-input">
<span id="set-label" class="field-label">Select Set</span>
<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="submit">Create datasheet</button>
</form>
<div class="divider"></div>
<button id="create-button" type="button">Create datasheet</button>
<div id="status" class="status status-ready" role="status">Loading configuration...</div>
<p id="version" class="version"></p>
</section>
@@ -454,7 +452,6 @@
const setPanel = document.getElementById("set-dropdown-panel");
const inkPanel = document.getElementById("ink-dropdown-panel");
const serialInput = document.getElementById("serial-input");
const createForm = document.getElementById("create-form");
const createBtn = document.getElementById("create-button");
const status = document.getElementById("status");
const themeToggle = document.getElementById("theme-toggle");
@@ -741,7 +738,7 @@
}
});
async function createDatasheet() {
createBtn.addEventListener("click", async () => {
createBtn.disabled = true;
try {
const result = await window.pywebview.api.create(
@@ -753,11 +750,6 @@
} finally {
createBtn.disabled = false;
}
}
createForm.addEventListener("submit", async (event) => {
event.preventDefault();
await createDatasheet();
});
window.addEventListener("pywebviewready", initialize);

View File

@@ -1,105 +0,0 @@
"""Tests for win32com gen_py cache recovery (no real Excel required)."""
from __future__ import annotations
import sys
from types import ModuleType, SimpleNamespace
from unittest.mock import MagicMock, patch
import pytest
from xlsx_clean.com_backend import (
_clear_gen_py_cache,
_excel_application,
_is_gen_py_cache_error,
)
def _install_fake_win32com(*, ensure, dispatch=None, gen_path="/tmp/gen_py"):
"""Put fake win32com + win32com.client modules into sys.modules."""
win32com = ModuleType("win32com")
win32com.__gen_path__ = gen_path
client = ModuleType("win32com.client")
client.gencache = SimpleNamespace(EnsureDispatch=ensure)
client.Dispatch = dispatch if dispatch is not None else MagicMock()
return patch.dict(sys.modules, {"win32com": win32com, "win32com.client": client})
def test_is_gen_py_cache_error_matches_known_messages():
assert _is_gen_py_cache_error(
AttributeError(
"module 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9' "
"has no attribute 'CLSIDToPackageMap'"
)
)
assert _is_gen_py_cache_error(
AttributeError("... has no attribute 'CLSIDToClassMap'")
)
assert not _is_gen_py_cache_error(AttributeError("something else"))
assert not _is_gen_py_cache_error(RuntimeError("CLSIDToPackageMap"))
def test_clear_gen_py_cache_removes_modules_and_directory(tmp_path):
gen_root = tmp_path / "gen_py"
bad = gen_root / "00020813-0000-0000-C000-000000000046x0x1x9"
bad.mkdir(parents=True)
(bad / "__init__.py").write_text("# corrupt", encoding="utf-8")
mod_name = "win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9"
fake_mod = ModuleType(mod_name)
fake_win32com = ModuleType("win32com")
fake_win32com.__gen_path__ = str(gen_root)
with patch.dict(sys.modules, {"win32com": fake_win32com, mod_name: fake_mod}):
cleared = _clear_gen_py_cache()
assert cleared == gen_root
assert not gen_root.exists()
assert mod_name not in sys.modules
def test_excel_application_clears_cache_and_retries_ensure_dispatch():
excel = object()
ensure = MagicMock(
side_effect=[
AttributeError(
"module 'win32com.gen_py.00020813x0x1x9' has no attribute 'CLSIDToPackageMap'"
),
excel,
]
)
with (
_install_fake_win32com(ensure=ensure),
patch("xlsx_clean.com_backend._clear_gen_py_cache", return_value=None) as clear,
):
result = _excel_application()
assert result is excel
assert ensure.call_count == 2
clear.assert_called_once_with()
def test_excel_application_falls_back_to_dispatch_after_second_failure():
excel = object()
err = AttributeError("has no attribute 'CLSIDToClassMap'")
ensure = MagicMock(side_effect=[err, err])
dispatch = MagicMock(return_value=excel)
with (
_install_fake_win32com(ensure=ensure, dispatch=dispatch),
patch("xlsx_clean.com_backend._clear_gen_py_cache", return_value=None),
):
result = _excel_application()
assert result is excel
dispatch.assert_called_once_with("Excel.Application")
def test_excel_application_rethrows_unrelated_attribute_error():
ensure = MagicMock(side_effect=AttributeError("unrelated"))
with (
_install_fake_win32com(ensure=ensure),
pytest.raises(AttributeError, match="unrelated"),
):
_excel_application()

View File

@@ -1,79 +0,0 @@
from pathlib import Path
import pytest
from xlsx_clean.core import resolve_write_year_dir, resolve_year_dir
def _touch(path: Path) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(b"")
def test_resolve_year_picks_largest_dir_with_matching_sheet(tmp_path: Path):
pattern = "ICJ_108 op. [SERIAL].xlsx"
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
_touch(tmp_path / "2026" / "ICJ108 Beige" / "ICJ_108 op. 2.xlsx")
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2026" / "ICJ108 Beige"
def test_resolve_year_ignores_larger_empty_year(tmp_path: Path):
pattern = "ICJ_108 op. [SERIAL].xlsx"
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
(tmp_path / "2026" / "ICJ108 Beige").mkdir(parents=True)
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2025" / "ICJ108 Beige"
def test_resolve_year_jalali_style(tmp_path: Path):
pattern = "KRCY1100T Blue [SERIAL].xlsx"
_touch(tmp_path / "1402" / "KRCY1100T Blue" / "KRCY1100T Blue 1.xlsx")
_touch(tmp_path / "1403" / "KRCY1100T Blue" / "KRCY1100T Blue 2.xlsx")
placeholder = tmp_path / "[YEAR]" / "KRCY1100T Blue"
assert resolve_year_dir(placeholder, pattern) == tmp_path / "1403" / "KRCY1100T Blue"
def test_resolve_year_passthrough_without_token(tmp_path: Path):
path = tmp_path / "2025" / "ICJ108 Beige"
assert resolve_year_dir(path, "x [SERIAL].xlsx") == path
def test_resolve_year_fails_when_no_sheets(tmp_path: Path):
(tmp_path / "2026" / "ICJ108 Beige").mkdir(parents=True)
with pytest.raises(FileNotFoundError, match="No year directory"):
resolve_year_dir(tmp_path / "[YEAR]" / "ICJ108 Beige", "ICJ_108 op. [SERIAL].xlsx")
def test_resolve_write_year_picks_largest_even_if_empty(tmp_path: Path):
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
(tmp_path / "2026").mkdir()
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
assert resolve_write_year_dir(placeholder) == tmp_path / "2026" / "ICJ108 Beige"
def test_resolve_write_year_jalali_style(tmp_path: Path):
(tmp_path / "1402").mkdir()
(tmp_path / "1403").mkdir()
placeholder = tmp_path / "[YEAR]" / "KRCY1100T Blue"
assert resolve_write_year_dir(placeholder) == tmp_path / "1403" / "KRCY1100T Blue"
def test_resolve_write_year_passthrough_without_token(tmp_path: Path):
path = tmp_path / "2025" / "ICJ108 Beige"
assert resolve_write_year_dir(path) == path
def test_resolve_write_year_fails_when_no_digit_dirs(tmp_path: Path):
(tmp_path / "notes").mkdir()
with pytest.raises(FileNotFoundError, match="No year directory"):
resolve_write_year_dir(tmp_path / "[YEAR]" / "ICJ108 Beige")
def test_read_and_write_year_differ_when_sheets_only_in_older(tmp_path: Path):
pattern = "ICJ_108 op. [SERIAL].xlsx"
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
(tmp_path / "2026").mkdir()
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2025" / "ICJ108 Beige"
assert resolve_write_year_dir(placeholder) == tmp_path / "2026" / "ICJ108 Beige"

View File

@@ -21,8 +21,6 @@ def test_ui_asset_exists_and_has_required_bridge_content():
'id="set-label"',
'id="ink-label"',
'id="serial-label"',
'id="create-form"',
'id="create-button" type="submit"',
"Create datasheet",
"status-ready",
"status-success",
@@ -33,7 +31,6 @@ def test_ui_asset_exists_and_has_required_bridge_content():
"get_initial_data()",
"get_inks(setDropdown.value)",
"api.create(",
'createForm.addEventListener("submit"',
"finally",
'inputEl.value = selectEl.value || ""',
'inputEl.addEventListener("mousedown", () => {\n open();\n });',