diff --git a/ZB.MOM.WW.Theme/Directory.Build.props b/ZB.MOM.WW.Theme/Directory.Build.props index a48aff4..da2e137 100644 --- a/ZB.MOM.WW.Theme/Directory.Build.props +++ b/ZB.MOM.WW.Theme/Directory.Build.props @@ -4,7 +4,7 @@ enable enable latest - 0.5.3 + 1.0.0 true diff --git a/ZB.MOM.WW.Theme/README.md b/ZB.MOM.WW.Theme/README.md index 2d2da36..d1c3dc2 100644 --- a/ZB.MOM.WW.Theme/README.md +++ b/ZB.MOM.WW.Theme/README.md @@ -7,10 +7,61 @@ woff2 fonts, and side-rail layout CSS — all served from `_content/ZB.MOM.WW.Th plus a set of Blazor SSR components that carry no inline colours and reuse the token classes. Bootstrap 5 is **not** vendored; each app keeps its own Bootstrap link. -The kit ships **no JavaScript**: every interactive affordance — the narrow-viewport -side-rail hamburger and the collapsible nav sections — is a native CSS-only -`
`/`` disclosure, so the chrome works unchanged in static Blazor SSR -with only Bootstrap **CSS** present (no Bootstrap collapse JS bundle required). +The mobile rail and collapsible sections use native `
`/``, so +basic chrome works in static SSR with Bootstrap CSS. `ThemeScripts` also ships the +optional shared `nav-state.js` enhancer for persisted section state; include it once +before ``. No Bootstrap collapse bundle is required. + +## Accessible component contracts (1.0.0 candidate) + +`TechField` associates its existing label, help and error with a caller-owned input. +Use stable unique IDs for repeated fields; the component does not inspect or rewrite +arbitrary child content: + +```razor + + + +``` + +Only reference a hint/error ID when that content exists. The form owns error focus and +announcements. Existing callers can omit the new parameters while migrating. + +`TechButton Busy="@Saving" BusyText="Saving changes…"` disables during the operation, +exposes `aria-busy`, and restores its child label afterward. Caller-supplied `disabled` +is still honored, and button type, size and class composition stay intact. Keep a +persistent caller-owned outcome region beside the action: + +```razor +Save changes +

@SaveOutcome

+``` + +Update `SaveOutcome` on completion/failure with recovery information, never a secret +value or every polling tick. The button spinner is decorative; it is not the live region. + +`ThemeShell` accepts the existing `Accent` plus optional `AccentDeep`, `AccentTint`, +`AccentBorder` and `AccentFocus`. Supply the complete authored family for matching +hover, selected, border and keyboard states. Omitted values inherit; supplying none +emits no inline style. Semantic info remains blue and status meanings stay shared. + +```razor + + + ... + +``` + +Use `--ok-ink`, `--warn-ink`, `--bad-ink`, `--idle-ink` for small status text; +retain `--ok`, `--warn`, `--bad`, `--idle` for dots/stripes/charts. Primary and ghost +Bootstrap buttons consume the scoped accent family while preserving shared sizing. +Interaction recipes: [`INTERACTION-RECIPES.md`](../components/ui-theme/spec/INTERACTION-RECIPES.md). +These are candidate contracts; release/package/browser acceptance remains recorded +in the parent Theme release evidence. ## Adopt @@ -115,6 +166,7 @@ the rail, because the width resolves against the containing block and the inline | `fonts/ibm-plex-sans-400.woff2` | IBM Plex Sans Regular | | `fonts/ibm-plex-sans-600.woff2` | IBM Plex Sans SemiBold | | `fonts/ibm-plex-mono-500.woff2` | IBM Plex Mono Medium | +| `js/nav-state.js` | Optional shared section persistence via `ThemeScripts` | `theme.css` declares `@font-face` with `url('../fonts/…')` — correct relative path from `css/` to `fonts/`. (OtOpcUa's original `url('fonts/…')` was a latent 404; the kit fixes it.) @@ -129,8 +181,8 @@ so a token-block edit re-themes the whole kit. ```bash # from ZB.MOM.WW.Theme/ dotnet build -c Release # TreatWarningsAsErrors — expect 0 warnings -dotnet test # 60 tests verified for 0.5.0 -./build/pack.sh # → ./artifacts/ZB.MOM.WW.Theme.0.5.0.nupkg +dotnet test # run the current component and static-asset suite +./build/pack.sh # exact version from Directory.Build.props ``` ## 0.5.0 migration (published 2026-11-04) diff --git a/ZB.MOM.WW.Theme/build/export-web-assets.py b/ZB.MOM.WW.Theme/build/export-web-assets.py new file mode 100644 index 0000000..2419ff0 --- /dev/null +++ b/ZB.MOM.WW.Theme/build/export-web-assets.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python3 +"""Export immutable Technical-Light web assets from a reviewed Theme nupkg. + +The CSS reader handles the canonical, top-level :root declaration block, not an +arbitrary CSS cascade. Token values (including var() references) remain raw; +consumers own platform-specific resolution. Source revision/tag are explicit +caller-supplied provenance; the release workflow must establish their truth. +""" +from __future__ import annotations + +import argparse +import hashlib +import io +import json +import os +from pathlib import Path +import re +import tempfile +import xml.etree.ElementTree as ET +import zipfile + +PACKAGE_ID = "ZB.MOM.WW.Theme" +ASSET_PATHS = ( + "css/theme.css", "css/layout.css", + "fonts/ibm-plex-sans-400.woff2", "fonts/ibm-plex-sans-600.woff2", + "fonts/ibm-plex-mono-500.woff2", +) +REQUIRED_TOKENS = frozenset({ + "--paper", "--card", "--ink", "--ink-soft", "--ink-faint", "--rule", + "--accent", "--accent-deep", "--accent-tint", "--accent-border", "--accent-focus", "--on-accent", + "--ok-ink", "--warn-ink", "--bad-ink", "--idle-ink", + "--ok-bg", "--warn-bg", "--bad-bg", "--idle-bg", + "--info-ink", "--info-bg", "--info-border", "--active-bg", "--sans", "--mono", +}) + + +def _without_comments(css: str) -> str: + """Remove real comments without interpreting quoted text as CSS syntax.""" + result = [] + quote = None + index = 0 + while index < len(css): + char = css[index] + if char == "\\": + if index + 1 == len(css): + raise ValueError("Malformed CSS: dangling escape") + result.extend(css[index:index + 2]) + index += 2 + continue + if quote: + result.append(char) + if char == quote: + quote = None + elif char in "\"'": + quote = char + result.append(char) + elif css.startswith("/*", index): + end = css.find("*/", index + 2) + if end < 0: + raise ValueError("Malformed CSS: unterminated comment") + result.append(" ") + index = end + 2 + continue + else: + result.append(char) + index += 1 + if quote: + raise ValueError("Malformed CSS: unterminated quoted value") + return "".join(result) + + +def _canonical_root(css: str) -> str: + """Locate exactly one top-level :root, rejecting unbalanced CSS structure.""" + stack = [] + quote = None + escaped = False + header_start = 0 + root_start = None + blocks = [] + pairs = {"}": "{", ")": "(", "]": "["} + for index, char in enumerate(css): + if escaped: + escaped = False + continue + if char == "\\": + escaped = True + continue + if quote: + if char == quote: + quote = None + continue + if char in "\"'": + quote = char + elif char in "{([": + if char == "{" and not stack and css[header_start:index].strip() == ":root": + root_start = index + 1 + stack.append(char) + elif char in "})]": + if not stack or stack.pop() != pairs[char]: + raise ValueError("Malformed CSS: mismatched delimiters") + if char == "}" and not stack: + if root_start is not None: + blocks.append(css[root_start:index]) + root_start = None + header_start = index + 1 + elif char == ";" and not stack: + header_start = index + 1 + if stack or quote or escaped: + raise ValueError("Malformed CSS: unfinished structure") + if len(blocks) != 1: + raise ValueError("Expected exactly one canonical top-level :root block") + return blocks[0] + + +def parse_tokens(css_bytes: bytes) -> dict[str, str]: + """Read every custom property in canonical :root, preserving raw values.""" + try: + body = _canonical_root(_without_comments(css_bytes.decode("utf-8-sig"))) + except UnicodeDecodeError as exc: + raise ValueError("Theme CSS must be UTF-8") from exc + pieces = [] + start = 0 + quote = None + escaped = False + stack = [] + for index, char in enumerate(body): + if escaped: + escaped = False + continue + if char == "\\": + escaped = True + continue + if quote: + if char == quote: + quote = None + continue + if char in "\"'": + quote = char + elif char in "{}": + raise ValueError("Canonical :root may contain declarations only") + elif char in "([": + stack.append(char) + elif char in ")]": + if not stack or stack.pop() != {")": "(", "]": "["}[char]: + raise ValueError("Malformed token value") + elif char == ";" and not stack: + pieces.append(body[start:index]) + start = index + 1 + if stack or quote or escaped: + raise ValueError("Malformed token value") + pieces.append(body[start:]) # A final declaration may omit its semicolon in valid CSS. + tokens = {} + for declaration in pieces: + if not declaration.strip(): + continue + name, colon, value = declaration.partition(":") + name, value = name.strip(), value.strip() + if not colon or not re.fullmatch(r"--[A-Za-z_][A-Za-z0-9_-]*", name) or not value: + raise ValueError("Malformed canonical custom-property declaration") + if name in tokens: + raise ValueError(f"Duplicate canonical token: {name}") + tokens[name] = value + missing = sorted(REQUIRED_TOKENS - tokens.keys()) + if missing: + raise ValueError("Missing required semantic tokens: " + ", ".join(missing)) + return tokens + + +def _safe_entries(archive: zipfile.ZipFile) -> list[str]: + names = [] + seen = set() + for entry in archive.infolist(): + name = entry.filename + parts = name.rstrip("/").split("/") + if (not name or name.startswith("/") or "\\" in name or "\x00" in name + or re.match(r"^[A-Za-z]:", name) + or any(part in ("", ".", "..") for part in parts)): + raise ValueError(f"Unsafe package entry: {name!r}") + if name in seen: + raise ValueError(f"Duplicate package entry: {name}") + seen.add(name) + names.append(name) + return names + + +def _metadata(archive: zipfile.ZipFile, names: list[str]) -> str: + nuspecs = [name for name in names if name.lower().endswith(".nuspec")] + if len(nuspecs) != 1: + raise ValueError("Package must contain exactly one nuspec") + try: + document = ET.fromstring(archive.read(nuspecs[0])) + except ET.ParseError as exc: + raise ValueError("Malformed nuspec XML") from exc + metadata = [node for node in document if node.tag.split("}")[-1] == "metadata"] + if document.tag.split("}")[-1] != "package" or len(metadata) != 1: + raise ValueError("Missing or ambiguous nuspec metadata") + def field(name: str) -> str: + nodes = [node for node in metadata[0] if node.tag.split("}")[-1] == name] + if len(nodes) != 1 or not (nodes[0].text or "").strip(): + raise ValueError(f"Missing or ambiguous package {name}") + return nodes[0].text.strip() + if field("id") != PACKAGE_ID: + raise ValueError(f"Expected package ID {PACKAGE_ID}") + version = field("version") + if not re.fullmatch(r"[0-9]+(?:\.[0-9]+){1,3}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?", version): + raise ValueError("Malformed package version") + return version + + +def _json_bytes(value: dict) -> bytes: + return (json.dumps(value, sort_keys=True, ensure_ascii=False, indent=2) + "\n").encode("utf-8") + + +def export_package(package: Path, output: Path, *, source_revision: str, source_tag: str) -> Path: + """Validate the complete input before atomically replacing a deterministic export.""" + package, output = Path(package), Path(output) + # resolve() does not canonicalize case on case-insensitive APFS. Check the + # actual existing file identity as well, including hard-link aliases. + if package.resolve() == output.resolve() or (output.exists() and output.samefile(package)): + raise ValueError("Output must not replace the input package or an existing alias") + if not re.fullmatch(r"(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})", source_revision): + raise ValueError("Source revision must be a full Git commit hash") + if not source_tag.strip() or any(char in source_tag for char in "\r\n\x00"): + raise ValueError("Source tag must be explicit (use an untagged marker where appropriate)") + package_bytes = package.read_bytes() + try: + with zipfile.ZipFile(io.BytesIO(package_bytes)) as archive: + names = _safe_entries(archive) + version = _metadata(archive, names) + payloads = {} + for name in ASSET_PATHS: + source = "staticwebassets/" + name + if source not in names: + raise ValueError(f"Missing required static asset: {source}") + payloads[name] = archive.read(source) + except zipfile.BadZipFile as exc: + raise ValueError("Input is not a valid nupkg ZIP") from exc + tokens = parse_tokens(payloads["css/theme.css"]) + payloads["tokens.json"] = _json_bytes({"schemaVersion": 1, "themeVersion": version, "tokens": tokens}) + manifest = { + "schemaVersion": 1, "themeVersion": version, "sourcePackage": PACKAGE_ID, + "sourcePackageSha256": hashlib.sha256(package_bytes).hexdigest(), + "sourceRevision": source_revision, "sourceTag": source_tag, + "files": {name: hashlib.sha256(data).hexdigest() for name, data in sorted(payloads.items())}, + } + payloads["manifest.json"] = _json_bytes(manifest) + output.parent.mkdir(parents=True, exist_ok=True) + temporary = None + try: + with tempfile.NamedTemporaryFile(dir=output.parent, prefix=".theme-export-", suffix=".tmp", delete=False) as handle: + temporary = Path(handle.name) + with zipfile.ZipFile(temporary, "w", compression=zipfile.ZIP_STORED) as archive: + for name, data in sorted(payloads.items()): + info = zipfile.ZipInfo(name, date_time=(1980, 1, 1, 0, 0, 0)) + info.create_system = 3 + info.external_attr = 0o100644 << 16 + archive.writestr(info, data) + os.replace(temporary, output) + finally: + if temporary is not None: + temporary.unlink(missing_ok=True) + return output + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--package", required=True, type=Path) + parser.add_argument("--source-revision", required=True) + parser.add_argument("--source-tag", required=True) + parser.add_argument("--output", required=True, type=Path) + args = parser.parse_args() + try: + result = export_package(args.package, args.output, source_revision=args.source_revision, source_tag=args.source_tag) + except (ValueError, OSError) as exc: + parser.error(str(exc)) + print(result) + + +if __name__ == "__main__": + main() diff --git a/ZB.MOM.WW.Theme/build/test_export_web_assets.py b/ZB.MOM.WW.Theme/build/test_export_web_assets.py new file mode 100644 index 0000000..4d51420 --- /dev/null +++ b/ZB.MOM.WW.Theme/build/test_export_web_assets.py @@ -0,0 +1,244 @@ +"""Offline integrity tests for the canonical package-to-web-assets export.""" +from __future__ import annotations + +import importlib.util +import json +from pathlib import Path +import subprocess +import sys +import tempfile +import unittest +import warnings +import zipfile +import hashlib + +_SPEC = importlib.util.spec_from_file_location( + "export_web_assets", Path(__file__).with_name("export-web-assets.py") +) +exporter = importlib.util.module_from_spec(_SPEC) +_SPEC.loader.exec_module(exporter) + +# Independent fixture contract: do not populate it from the implementation's constants. +TOKENS = { + "--paper": "#f4f4f1", "--card": "#ffffff", "--ink": "#1b1d21", + "--ink-soft": "#5a6066", "--ink-faint": "#626970", "--rule": "#e4e4df", + "--accent": "#2f5fd0", "--accent-deep": "#1e3f99", "--on-accent": "#ffffff", + "--accent-tint": "#eef2fc", "--accent-border": "#cdd9f7", "--accent-focus": "#2f5fd0", + "--ok-ink": "#236f34", "--warn-ink": "#855000", "--bad-ink": "#b42121", + "--idle-ink": "#535d66", "--ok-bg": "#e9f6ec", "--warn-bg": "#fdf1dd", + "--bad-bg": "#fceaea", "--idle-bg": "#eef0f2", "--info-ink": "#1e3f99", + "--info-bg": "#e7ecfb", "--info-border": "#cdd9f7", + "--active-bg": "var(--accent-tint)", "--bs-primary": "var(--accent)", + "--sans": "'IBM Plex Sans', system-ui, sans-serif", "--mono": "'IBM Plex Mono', monospace", + "--future-token": "var(--paper)", +} +ASSETS = { + "css/theme.css": b"", "css/layout.css": b"/* layout bytes preserved */\r\n.page { min-width: 0; }\r\n", + "fonts/ibm-plex-sans-400.woff2": b"wOF2\x00regular\xff", + "fonts/ibm-plex-sans-600.woff2": b"wOF2\x00semibold\xfe", + "fonts/ibm-plex-mono-500.woff2": b"wOF2\x00mono\xfd", +} +REVISION = "a" * 40 + + +def css_for(tokens=None): + tokens = TOKENS if tokens is None else tokens + declarations = "\n".join(f" {key}: {value};" for key, value in tokens.items()) + return ("/* discarded from token parsing, retained in output */\n" + "@font-face { font-family: 'Fixture'; src: url('../fonts/fixture.woff2'); }\n" + ":root {\n" + declarations + "\n}\nbody { color: var(--ink); }\n").encode() + + +class ExportWebAssetsTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory() + self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name) + self.package = self.root / "input.nupkg" + self.output = self.root / "export.zip" + + def make_package(self, *, package_id="ZB.MOM.WW.Theme", version="1.0.0", css=None, + missing=None, extras=(), nuspec_override=None): + payloads = dict(ASSETS) + payloads["css/theme.css"] = css_for() if css is None else css + nuspec = (f'' + f'{package_id}{version}') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", UserWarning) + with zipfile.ZipFile(self.package, "w") as archive: + archive.writestr("ZB.MOM.WW.Theme.nuspec", nuspec if nuspec_override is None else nuspec_override) + for name, data in payloads.items(): + if name != missing: + archive.writestr("staticwebassets/" + name, data) + archive.writestr("lib/net10.0/fixture.dll", b"not exported") + for name, data in extras: + archive.writestr(name, data) + return payloads + + def export(self, output=None): + return exporter.export_package(self.package, output or self.output, + source_revision=REVISION, source_tag="untagged") + + def test_exact_asset_bytes_and_complete_token_references_are_preserved(self): + expected = self.make_package() + self.export() + with zipfile.ZipFile(self.output) as archive: + self.assertEqual(set(expected) | {"tokens.json", "manifest.json"}, set(archive.namelist())) + for name, data in expected.items(): + self.assertEqual(data, archive.read(name), name) + tokens = json.loads(archive.read("tokens.json")) + self.assertEqual({"schemaVersion": 1, "themeVersion": "1.0.0", "tokens": TOKENS}, tokens) + + def test_manifest_identifies_exact_package_and_hashes_every_payload_once(self): + self.make_package(version="1.2.3-preview.4") + self.export(self.root / "not-a-version-name.zip") + with zipfile.ZipFile(self.root / "not-a-version-name.zip") as archive: + manifest = json.loads(archive.read("manifest.json")) + self.assertEqual(1, manifest["schemaVersion"]) + self.assertEqual("1.2.3-preview.4", manifest["themeVersion"]) + self.assertEqual("ZB.MOM.WW.Theme", manifest["sourcePackage"]) + self.assertEqual(hashlib.sha256(self.package.read_bytes()).hexdigest(), manifest["sourcePackageSha256"]) + self.assertEqual(REVISION, manifest["sourceRevision"]) + self.assertEqual("untagged", manifest["sourceTag"]) + self.assertEqual(set(archive.namelist()) - {"manifest.json"}, set(manifest["files"])) + for name, digest in manifest["files"].items(): + self.assertEqual(hashlib.sha256(archive.read(name)).hexdigest(), digest) + + def test_identical_inputs_produce_identical_zip_bytes_with_stable_entries(self): + self.make_package() + self.export() + second = self.root / "second.zip" + self.export(second) + self.assertEqual(self.output.read_bytes(), second.read_bytes()) + with zipfile.ZipFile(second) as archive: + self.assertEqual(sorted(archive.namelist()), archive.namelist()) + self.assertTrue(all(i.date_time == (1980, 1, 1, 0, 0, 0) for i in archive.infolist())) + + def test_changed_css_byte_changes_asset_and_package_hash(self): + self.make_package() + self.export() + with zipfile.ZipFile(self.output) as archive: + first = json.loads(archive.read("manifest.json")) + self.make_package(css=css_for() + b"\n") + self.export() + with zipfile.ZipFile(self.output) as archive: + second = json.loads(archive.read("manifest.json")) + self.assertNotEqual(first["files"]["css/theme.css"], second["files"]["css/theme.css"]) + self.assertNotEqual(first["sourcePackageSha256"], second["sourcePackageSha256"]) + + def test_each_required_asset_is_required_without_partial_output(self): + for name in ASSETS: + with self.subTest(asset=name): + self.make_package(missing=name) + with self.assertRaises(ValueError): + self.export() + self.assertFalse(self.output.exists()) + + def test_required_semantic_token_cannot_be_missing_or_empty(self): + for name in ("--paper", "--ok-ink", "--warn-ink", "--bad-ink", "--idle-ink", "--info-ink", "--on-accent"): + for empty in (False, True): + with self.subTest(token=name, empty=empty): + tokens = dict(TOKENS) + if empty: + tokens[name] = "" + else: + del tokens[name] + self.make_package(css=css_for(tokens)) + with self.assertRaises(ValueError): + self.export() + self.assertFalse(self.output.exists()) + + def test_comments_quotes_and_function_values_do_not_create_phantom_tokens(self): + tokens = dict(TOKENS, **{"--text": "'literal ; :root { /* text */ }'", "--complex": "var(--paper, rgb(1, 2, 3))"}) + css = css_for(tokens).replace(b":root {\n", b":root { /* --phantom: #000; */\n") + self.make_package(css=css) + self.export() + with zipfile.ZipFile(self.output) as archive: + self.assertEqual(tokens, json.loads(archive.read("tokens.json"))["tokens"]) + + def test_malformed_or_ambiguous_canonical_css_is_refused(self): + good = css_for() + bad_cases = [good + b"/* unclosed", good + b"}", good.replace(b":root {", b":root"), + good.replace(b"--paper: #f4f4f1;", b"--paper #f4f4f1;"), + good.replace(b"--paper: #f4f4f1;", b"--paper: var(--card;"), + good.replace(b"--paper: #f4f4f1;", b"--paper: 'unclosed;"), + good + b":root { --paper: #fff; }", good.replace(b"--paper: #f4f4f1;", b"--paper: #fff; --paper: #000;"), + good.replace(b"--paper: #f4f4f1;", b"body { color: red; }")] + for css in bad_cases: + with self.subTest(css=css[-80:]): + self.make_package(css=css) + with self.assertRaises(ValueError): + self.export() + self.assertFalse(self.output.exists()) + + def test_wrong_package_id_and_malformed_metadata_are_refused(self): + for kwargs in ({"package_id": "Other.Theme"}, {"version": ""}, + {"nuspec_override": ""}, + {"extras": [("other.nuspec", b"")]}): + with self.subTest(kwargs=kwargs): + self.make_package(**kwargs) + with self.assertRaises(ValueError): + self.export() + + def test_duplicate_package_entries_are_refused(self): + for name in ("staticwebassets/css/theme.css", "ZB.MOM.WW.Theme.nuspec"): + with self.subTest(name=name): + self.make_package(extras=[(name, b"duplicate")]) + with self.assertRaises(ValueError): + self.export() + + def test_unsafe_package_entries_are_refused_even_when_not_exported(self): + for name in ("../escape", "/absolute", "staticwebassets/../escape", "C:/escape", r"..\escape", "./alias"): + with self.subTest(name=name): + self.make_package(extras=[(name, b"unsafe")]) + with self.assertRaises(ValueError): + self.export() + self.assertFalse((self.root.parent / "escape").exists()) + + def test_rejection_preserves_existing_output_and_cannot_replace_input_package(self): + self.output.write_bytes(b"old export") + self.make_package(missing="css/layout.css") + with self.assertRaises(ValueError): + self.export() + self.assertEqual(b"old export", self.output.read_bytes()) + self.make_package() + original = self.package.read_bytes() + with self.assertRaises(ValueError): + self.export(self.package) + self.assertEqual(original, self.package.read_bytes()) + + def test_existing_hardlink_alias_cannot_replace_package_inode(self): + self.make_package() + original = self.package.read_bytes() + alias = self.root / "linked-input.zip" + alias.hardlink_to(self.package) + with self.assertRaises(ValueError): + self.export(alias) + self.assertEqual(original, self.package.read_bytes()) + self.assertEqual(original, alias.read_bytes()) + + def test_existing_case_alias_cannot_overwrite_package_on_case_insensitive_filesystems(self): + self.make_package() + original = self.package.read_bytes() + alias = self.root / self.package.name.upper() + if not alias.exists() or not alias.samefile(self.package): + self.skipTest("Case alias requires a case-insensitive filesystem") + with self.assertRaises(ValueError): + self.export(alias) + self.assertEqual(original, self.package.read_bytes()) + self.assertEqual(original, alias.read_bytes()) + + def test_cli_requires_explicit_provenance_and_builds_verified_output(self): + self.make_package() + cli = Path(__file__).with_name("export-web-assets.py") + args = [sys.executable, str(cli), "--package", str(self.package), "--output", str(self.output)] + missing = subprocess.run(args, capture_output=True) + self.assertNotEqual(0, missing.returncode) + self.assertFalse(self.output.exists()) + ok = subprocess.run(args + ["--source-revision", REVISION, "--source-tag", "untagged"], capture_output=True) + self.assertEqual(0, ok.returncode, ok.stderr.decode()) + self.assertTrue(zipfile.is_zipfile(self.output)) + + +if __name__ == "__main__": + unittest.main() diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechButton.razor b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechButton.razor index cad9d46..4b27352 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechButton.razor +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechButton.razor @@ -1,8 +1,15 @@ @namespace ZB.MOM.WW.Theme @* Components/TechButton.razor *@ - @code { @@ -27,6 +34,9 @@ ///
[Parameter] public bool Busy { get; set; } + /// Optional label shown while busy; otherwise the existing child content is preserved. + [Parameter] public string? BusyText { get; set; } + /// Button label content. [Parameter] public RenderFragment? ChildContent { get; set; } diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechField.razor b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechField.razor index 5da4c29..7c0658a 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechField.razor +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/TechField.razor @@ -1,24 +1,33 @@ @namespace ZB.MOM.WW.Theme @* Components/TechField.razor *@
- + @ChildContent - @if (!string.IsNullOrEmpty(Hint)) {
@Hint
} - @if (!string.IsNullOrEmpty(Error)) {
@Error
} + @if (!string.IsNullOrEmpty(Hint)) {
@Hint
} + @if (!string.IsNullOrEmpty(Error)) {
@Error
}
@code { /// Field label text. Required. [Parameter, EditorRequired] public string Label { get; set; } = string.Empty; + /// The id of the caller's control, associated with the field label. + [Parameter] public string? For { get; set; } + /// Optional hint text rendered as .form-text below the input. [Parameter] public string? Hint { get; set; } + /// Optional id for the rendered hint, referenced by the caller's control. + [Parameter] public string? HintId { get; set; } + /// /// Optional inline error message rendered as .field-error.s-bad below the input. /// [Parameter] public string? Error { get; set; } + /// Optional id for the rendered error, referenced by the caller's control. + [Parameter] public string? ErrorId { get; set; } + /// The control itself — an <input>, <select>, etc. [Parameter] public RenderFragment? ChildContent { get; set; } } diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/ThemeShell.razor b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/ThemeShell.razor index 06d78df..a757e36 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/ThemeShell.razor +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/Components/ThemeShell.razor @@ -38,10 +38,27 @@ /// /// Optional per-app accent colour. When set, emitted as style="--accent: <value>" /// on the shell root, overriding the --accent design token for this subtree only. - /// This is the single per-app token override the kit allows (e.g. "#2f855a"). + /// Existing callers may supply only this value; optional companion parameters carry the + /// matching hover, selected, border and focus states without overriding global tokens. + /// Accent-family values are trusted application configuration, not remote user input. /// [Parameter] public string? Accent { get; set; } + /// + /// Optional deep accent for hover and pressed states, scoped to this shell subtree. + /// Omitted values inherit the stylesheet or enclosing shell's token. + /// + [Parameter] public string? AccentDeep { get; set; } + + /// Optional accent surface tint for selected states in this shell subtree. + [Parameter] public string? AccentTint { get; set; } + + /// Optional accent border color for interactive controls in this shell subtree. + [Parameter] public string? AccentBorder { get; set; } + + /// Optional visible focus color for interactive controls in this shell subtree. + [Parameter] public string? AccentFocus { get; set; } + /// /// Optional custom logo rendered in the rail header. When omitted, the default /// brand glyph is shown. @@ -71,5 +88,22 @@ /// [Parameter] public RenderFragment? ChildContent { get; set; } - private string? AccentStyle => Accent is null ? null : $"--accent: {Accent}"; + private string? AccentStyle + { + get + { + var declarations = new (string Token, string? Value)[] + { + ("--accent", Accent), + ("--accent-deep", AccentDeep), + ("--accent-tint", AccentTint), + ("--accent-border", AccentBorder), + ("--accent-focus", AccentFocus), + }.Where(declaration => declaration.Value is not null) + .Select(declaration => $"{declaration.Token}: {declaration.Value}") + .ToArray(); + + return declarations.Length == 0 ? null : string.Join("; ", declarations); + } + } } diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css index 9706982..2a78e3f 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/layout.css @@ -52,6 +52,29 @@ --bs-btn-padding-x: 1rem; } +/* Bootstrap sets button colors on the component, so bind tokens here rather + than only changing --bs-primary at :root. Keep sizing and group seams above. */ +.btn-primary { + --bs-btn-color: var(--on-accent); + --bs-btn-bg: var(--accent); + --bs-btn-border-color: var(--accent); + --bs-btn-hover-color: var(--on-accent); + --bs-btn-hover-bg: var(--accent-deep); + --bs-btn-hover-border-color: var(--accent-deep); + --bs-btn-active-color: var(--on-accent); + --bs-btn-active-bg: var(--accent-deep); + --bs-btn-active-border-color: var(--accent-deep); + --bs-btn-disabled-color: var(--on-accent); + --bs-btn-disabled-bg: var(--accent); + --bs-btn-disabled-border-color: var(--accent); +} +.btn-link { + --bs-btn-color: var(--accent-deep); + --bs-btn-hover-color: var(--accent-deep); + --bs-btn-active-color: var(--accent-deep); + --bs-btn-disabled-color: var(--ink-soft); +} + /* ── App shell: side rail + page ─────────────────────────────────────────── */ /* The shell is a native
disclosure so the narrow-viewport hamburger toggle works with NO JavaScript (no Bootstrap collapse bundle): below lg the @@ -68,6 +91,9 @@ and `.app-shell .page { flex: 1 }` lets the page take the remaining height (scadaproj#10). */ .app-shell { + /* Rebind the compatibility alias where product parameters are applied. + An alias computed on :root cannot see a child's --accent-tint override. */ + --active-bg: var(--accent-tint); align-items: stretch; min-height: 100vh; min-height: 100dvh; @@ -231,7 +257,7 @@ text-decoration: none; } .rail-link.active { - background: var(--active-bg); + background: var(--accent-tint); border-left-color: var(--accent); color: var(--accent-deep); font-weight: 600; @@ -283,7 +309,7 @@ cursor: pointer; } .rail-btn:hover { - border-color: var(--accent); + border-color: var(--accent-border); color: var(--accent); text-decoration: none; } @@ -440,3 +466,28 @@ td.row-actions { text-align: right; } .tt-twist:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } /* A hidden leaf control preserves the width of its siblings' toggles. */ .tt-leaf { visibility: hidden; } + +/* Visible keyboard context across native/shared controls. More specific host + treatments may remain stronger; selected fills are not focus indicators. */ +a:focus-visible, +button:focus-visible, +input:focus-visible, +select:focus-visible, +textarea:focus-visible, +summary:focus-visible, +[tabindex]:focus-visible, +.btn:focus-visible, +.form-control:focus-visible, +.form-select:focus-visible { + outline: 2px solid var(--accent-focus); + outline-offset: 3px; +} +.btn:focus-visible, +.form-control:focus-visible, +.form-select:focus-visible { + box-shadow: none; +} +.form-control:focus-visible, +.form-select:focus-visible { + border-color: var(--accent-focus); +} diff --git a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css index 2934ffd..40d48ab 100644 --- a/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css +++ b/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/wwwroot/css/theme.css @@ -49,6 +49,10 @@ /* Accent */ --accent: #2f5fd0; /* links, sort arrows, primary actions */ --accent-deep: #1e3f99; /* hover / pressed accent, raw-value emphasis */ + --accent-tint: #eef2fc; /* selected surface in the product accent family */ + --accent-border: #cdd9f7; /* subtle interactive border */ + --accent-focus: #1e3f99; /* keyboard focus, separate from selected fill */ + --on-accent: #ffffff; /* primary action label */ /* Status — signals (dots, stripes and charts; use semantic inks for text) */ --ok: #2f9e44; @@ -89,7 +93,7 @@ /* Neutral surface washes — derived from --paper/--accent, no own foreground */ --zebra-bg: #fbfbf9; /* even-row / sticky-head fill — barely-there */ --hover-bg: #f3f6fd; /* row / rail-link hover — faint cool wash */ - --active-bg: #eef2fc; /* active rail-link fill */ + --active-bg: var(--accent-tint); /* active rail-link fill */ /* Type stacks — Plex first, graceful system fallback */ --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace; @@ -122,7 +126,7 @@ body { .numeric, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; } -a { color: var(--accent); text-decoration: none; } +a { color: var(--accent-deep); text-decoration: none; } a:hover { color: var(--accent-deep); text-decoration: underline; } /* ── App chrome: top bar ───────────────────────────────────────────────────── @@ -406,3 +410,16 @@ a:hover { color: var(--accent-deep); text-decoration: underline; } background: var(--warn-bg); border-color: var(--warn-border); } + +/* Reduced motion preserves immediately readable content and a stable signal. */ +@media (prefers-reduced-motion: reduce) { + .rise { + animation: none; + opacity: 1; + transform: none; + } + .conn-pill[data-state="connecting"] .dot { + animation: none; + opacity: 1; + } +} diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs index 97eb8a9..8b1a988 100644 --- a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs @@ -2,6 +2,67 @@ namespace ZB.MOM.WW.Theme.Tests; public sealed class TechButtonExtensionsTests : BunitContext { + [Fact] + public void Busy_text_replaces_the_label_then_restores_it_without_changing_click_behavior() + { + var clicks = 0; + var cut = Render(p => p + .Add(x => x.Busy, true) + .Add(x => x.BusyText, "Saving changes…") + .AddUnmatched("onclick", EventCallback.Factory.Create(this, () => clicks++)) + .AddChildContent("Save changes")); + + var button = cut.Find("button"); + Assert.True(button.HasAttribute("disabled")); + Assert.Equal("true", button.GetAttribute("aria-busy")); + Assert.Equal("Saving changes…", button.TextContent.Trim()); + Assert.Empty(cut.FindAll(".original-label")); + Assert.Equal("true", cut.Find(".spinner-border").GetAttribute("aria-hidden")); + + cut.Render(p => p.Add(x => x.Busy, false)); + + button = cut.Find("button"); + Assert.False(button.HasAttribute("disabled")); + Assert.Equal("false", button.GetAttribute("aria-busy")); + Assert.Equal("Save changes", cut.Find(".original-label").TextContent); + Assert.Empty(cut.FindAll(".spinner-border")); + button.Click(); + Assert.Equal(1, clicks); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + public void Busy_without_replacement_text_preserves_existing_child_content(string? busyText) + { + var cut = Render(p => p + .Add(x => x.Busy, true) + .Add(x => x.BusyText, busyText) + .AddChildContent("Save")); + + Assert.Equal("Save", cut.Find(".original-label").TextContent); + Assert.Equal("true", cut.Find("button").GetAttribute("aria-busy")); + Assert.True(cut.Find("button").HasAttribute("disabled")); + } + + [Fact] + public void Completion_does_not_enable_a_caller_disabled_action_or_accept_a_stale_busy_attribute() + { + var cut = Render(p => p + .Add(x => x.Busy, true) + .Add(x => x.BusyText, "Saving…") + .AddUnmatched("disabled", true) + .AddUnmatched("aria-busy", "true") + .AddChildContent("Save")); + + cut.Render(p => p.Add(x => x.Busy, false)); + + Assert.True(cut.Find("button").HasAttribute("disabled")); + Assert.Equal("false", cut.Find("button").GetAttribute("aria-busy")); + Assert.Equal("Save", cut.Find("button").TextContent.Trim()); + Assert.Empty(cut.FindAll("[role=status], [role=alert]")); + } + [Theory] [InlineData(ButtonSize.Default, null)] [InlineData(ButtonSize.Small, "btn-sm")] diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs new file mode 100644 index 0000000..89bacba --- /dev/null +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs @@ -0,0 +1,98 @@ +namespace ZB.MOM.WW.Theme.Tests; + +public sealed class TechFieldAssociationTests : BunitContext +{ + [Fact] + public void Field_connects_label_hint_and_error_to_the_callers_input() + { + var cut = Render(p => p + .Add(x => x.Label, "Name").Add(x => x.For, "secret-name") + .Add(x => x.Hint, "Use a stable name").Add(x => x.HintId, "name-hint") + .Add(x => x.Error, "Name is required").Add(x => x.ErrorId, "name-error") + .AddChildContent("")); + + Assert.Equal("secret-name", cut.Find("label").GetAttribute("for")); + Assert.Equal("Use a stable name", cut.Find("#name-hint").TextContent); + Assert.Equal("Name is required", cut.Find("#name-error").TextContent); + Assert.Equal("name-hint name-error", cut.Find("input").GetAttribute("aria-describedby")); + Assert.Equal("true", cut.Find("input").GetAttribute("aria-invalid")); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + public void Absent_hint_and_error_do_not_create_described_nodes(string? absent) + { + var cut = Render(p => p + .Add(x => x.Label, "Name").Add(x => x.For, "name") + .Add(x => x.Hint, absent).Add(x => x.HintId, "name-hint") + .Add(x => x.Error, absent).Add(x => x.ErrorId, "name-error") + .AddChildContent("")); + + Assert.Empty(cut.FindAll(".form-text, .field-error, #name-hint, #name-error")); + Assert.False(cut.Find("input").HasAttribute("aria-describedby")); + Assert.False(cut.Find("input").HasAttribute("aria-invalid")); + } + + [Fact] + public void Repeated_fields_keep_the_callers_distinct_associations() + { + var cut = Render(builder => + { + foreach (var id in new[] { "first", "second" }) + { + builder.OpenComponent(0); + builder.AddAttribute(1, nameof(TechField.Label), "Name"); + builder.AddAttribute(2, nameof(TechField.For), id); + builder.AddAttribute(3, nameof(TechField.Hint), "Use a stable name"); + builder.AddAttribute(4, nameof(TechField.HintId), id + "-hint"); + builder.AddAttribute(5, nameof(TechField.ChildContent), + (RenderFragment)(content => content.AddMarkupContent(0, + $""))); + builder.CloseComponent(); + } + }); + + foreach (var id in new[] { "first", "second" }) + { + var input = cut.Find("#" + id); + Assert.Single(cut.FindAll($"label[for='{id}']")); + Assert.Equal(id + "-hint", input.GetAttribute("aria-describedby")); + Assert.Single(cut.FindAll("#" + id + "-hint")); + } + } + + [Fact] + public void Removing_error_removes_only_its_node_and_preserves_control_content() + { + var cut = Render(p => p + .Add(x => x.Label, "Name").Add(x => x.For, "name") + .Add(x => x.Hint, "Stable name").Add(x => x.HintId, "name-hint") + .Add(x => x.Error, "Required").Add(x => x.ErrorId, "name-error") + .AddChildContent("")); + + cut.Render(p => p.Add(x => x.Error, null) + .AddChildContent("")); + + Assert.Empty(cut.FindAll("#name-error")); + Assert.Equal("Stable name", cut.Find("#name-hint").TextContent); + Assert.Equal("draft", cut.Find("input").GetAttribute("value")); + Assert.Equal("name-hint", cut.Find("input").GetAttribute("aria-describedby")); + Assert.False(cut.Find("input").HasAttribute("aria-invalid")); + } + + [Fact] + public void Existing_callers_without_association_parameters_keep_their_markup_contract() + { + var cut = Render(p => p + .Add(x => x.Label, "Name") + .Add(x => x.Hint, "Stable name") + .Add(x => x.Error, "Required") + .AddChildContent("")); + + Assert.False(cut.Find("label").HasAttribute("for")); + Assert.False(cut.Find(".form-text").HasAttribute("id")); + Assert.False(cut.Find(".field-error").HasAttribute("id")); + Assert.Equal("Existing control", cut.Find("select").GetAttribute("aria-label")); + } +} diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs index f4b5720..4d8207e 100644 --- a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs @@ -60,6 +60,105 @@ public class ThemeShellTests : BunitContext Assert.False(cut.Find(".app-shell").HasAttribute("style")); } + [Fact] + public void Accent_family_emits_each_supplied_variable_on_the_shell_only() + { + var cut = Render(p => p + .Add(x => x.Product, "Historian") + .Add(x => x.Accent, "#2f855a") + .Add(x => x.AccentDeep, "#1c6540") + .Add(x => x.AccentTint, "#edf5f0") + .Add(x => x.AccentBorder, "#bddbc9") + .Add(x => x.AccentFocus, "#1c6540") + .AddChildContent("")); + + Assert.Equal("--accent: #2f855a; --accent-deep: #1c6540; --accent-tint: #edf5f0; " + + "--accent-border: #bddbc9; --accent-focus: #1c6540", + cut.Find("details.app-shell").GetAttribute("style")); + Assert.Empty(cut.FindAll("details.app-shell [style]")); + } + + [Fact] + public void Accent_only_does_not_emit_unsupplied_companion_overrides() + { + var cut = Render(p => p + .Add(x => x.Product, "Historian") + .Add(x => x.Accent, "#2f855a")); + + Assert.Equal("--accent: #2f855a", cut.Find("details.app-shell").GetAttribute("style")); + } + + [Fact] + public void Companion_overrides_do_not_require_or_manufacture_an_accent() + { + var cut = Render(p => p + .Add(x => x.Product, "Overview") + .Add(x => x.AccentFocus, "#4c1d95")); + + Assert.Equal("--accent-focus: #4c1d95", cut.Find("details.app-shell").GetAttribute("style")); + } + + [Fact] + public void Removing_all_accent_parameters_on_rerender_removes_the_style() + { + var cut = Render(p => p + .Add(x => x.Product, "Overview") + .Add(x => x.Accent, "#6d28d9") + .Add(x => x.AccentDeep, "#4c1d95") + .Add(x => x.AccentTint, "#f3eefe") + .Add(x => x.AccentBorder, "#d8c9ef") + .Add(x => x.AccentFocus, "#4c1d95")); + + cut.Render(p => p + .Add(x => x.Accent, (string?)null) + .Add(x => x.AccentDeep, (string?)null) + .Add(x => x.AccentTint, (string?)null) + .Add(x => x.AccentBorder, (string?)null) + .Add(x => x.AccentFocus, (string?)null)); + + Assert.False(cut.Find("details.app-shell").HasAttribute("style")); + } + + [Fact] + public void Nested_shells_keep_their_accent_declarations_on_their_own_roots() + { + RenderFragment nested = builder => + { + builder.OpenElement(0, "span"); + builder.AddAttribute(1, "class", "outer-content"); + builder.AddContent(2, "Outer"); + builder.CloseElement(); + builder.OpenComponent(3); + builder.AddAttribute(4, nameof(ThemeShell.Product), "Nested Overview"); + builder.AddAttribute(5, nameof(ThemeShell.Accent), "#6d28d9"); + builder.AddAttribute(6, nameof(ThemeShell.AccentDeep), "#4c1d95"); + builder.AddAttribute(7, nameof(ThemeShell.AccentTint), "#f3eefe"); + builder.AddAttribute(8, nameof(ThemeShell.AccentBorder), "#d8c9ef"); + builder.AddAttribute(9, nameof(ThemeShell.AccentFocus), "#4c1d95"); + builder.AddAttribute(10, nameof(ThemeShell.ChildContent), (RenderFragment)(child => + child.AddMarkupContent(0, "Inner"))); + builder.CloseComponent(); + }; + var cut = Render(p => p + .Add(x => x.Product, "Outer Historian") + .Add(x => x.Accent, "#2f855a") + .Add(x => x.AccentDeep, "#1c6540") + .Add(x => x.AccentTint, "#edf5f0") + .Add(x => x.AccentBorder, "#bddbc9") + .Add(x => x.AccentFocus, "#1c6540") + .Add(x => x.ChildContent, nested)); + + var outer = cut.Find("details.app-shell"); + var inner = cut.Find("details.app-shell > main.page > details.app-shell"); + Assert.Contains("--accent: #2f855a", outer.GetAttribute("style")); + Assert.DoesNotContain("#6d28d9", outer.GetAttribute("style")); + Assert.Contains("--accent: #6d28d9", inner.GetAttribute("style")); + Assert.DoesNotContain("#2f855a", inner.GetAttribute("style")); + Assert.Equal(2, cut.FindAll("[style]").Count); + Assert.False(cut.Find(".outer-content").HasAttribute("style")); + Assert.False(cut.Find(".inner-content").HasAttribute("style")); + } + [Fact] public void RailFooter_renders_when_supplied() { diff --git a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs index 3bb959a..32a269c 100644 --- a/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs +++ b/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeTokenContrastTests.cs @@ -56,6 +56,19 @@ public sealed class ThemeTokenContrastTests Assert.True(ratio >= 4.5, $"{foreground} on {background}: {ratio:F2}:1, requires 4.5:1"); } + [Theory] + [InlineData("#2f5fd0", "#1e3f99", "#eef2fc")] + [InlineData("#2f855a", "#1c6540", "#edf5f0")] + [InlineData("#1b7f8e", "#125764", "#eaf5f6")] + [InlineData("#6d28d9", "#4c1d95", "#f2ecfc")] + public void Product_families_support_white_actions_and_deep_text( + string accent, string deep, string tint) + { + Assert.True(Ratio(accent, "#ffffff") >= 4.5, "Primary label contrast"); + foreach (var surface in new[] { Token("--paper"), Token("--card"), tint }) + Assert.True(Ratio(deep, surface) >= 4.5, $"Deep text on {surface}"); + } + [Fact] public void Contrast_reference_is_black_on_white() => Assert.Equal(21d, Ratio("#000000", "#ffffff"), 6); diff --git a/components/ui-theme/GAPS.md b/components/ui-theme/GAPS.md index d1b740b..c40ce9d 100644 --- a/components/ui-theme/GAPS.md +++ b/components/ui-theme/GAPS.md @@ -5,6 +5,14 @@ > (label `migrated`, 2026-11-06). This file is a historical/design record — do not track status > here; file new work as an issue. +> **November 13, 2026 execution context:** published Theme is 0.5.3; the accessible +> 1.0.0 candidate is being validated after all-seven-project GB acceptance. Current +> baseline pins and compatibility decision: [RELEASE-DECISION.md](RELEASE-DECISION.md). +> Evidence and rollout task status belong to the execution ledger, not the historical +> tables below. Existing nav persistence, stateless TreeTable, button sizing and +> viewport fixes are implemented; old “not started” statements describe earlier snapshots. +> Candidate package/static export and two-host browser acceptance remain release gates. + Divergence of each project from [`spec/SPEC.md`](spec/SPEC.md), and the ordered backlog to reach adoption of the `ZB.MOM.WW.Theme` shared RCL. Status legend: ⛔ gap · 🟡 partial · ✅ matches. diff --git a/components/ui-theme/README.md b/components/ui-theme/README.md index c257220..f559842 100644 --- a/components/ui-theme/README.md +++ b/components/ui-theme/README.md @@ -1,45 +1,42 @@ -# UI Theme (layout / tokens / components) +# Shared Technical-Light UI theme -Second normalized component. **Goal: path to shared code** — converge the three sister -projects onto a common "Technical-Light" design system, realized as the `ZB.MOM.WW.Theme` -Razor Class Library. +`ZB.MOM.WW.Theme` is the implemented .NET 10 Razor Class Library for the SCADA +family. It owns canonical tokens, IBM Plex fonts, shell, common controls, shared CSS +and optional nav-state persistence. Applications retain domain pages and behavior. -- The one target: [`spec/SPEC.md`](spec/SPEC.md) -- Design tokens reference: [`spec/DESIGN-TOKENS.md`](spec/DESIGN-TOKENS.md) -- The shared library: [`shared-contract/ZB.MOM.WW.Theme.md`](shared-contract/ZB.MOM.WW.Theme.md) -- Divergences + backlog: [`GAPS.md`](GAPS.md) -- Current state, per project: [`current-state/`](current-state/) +Current published release: **0.5.3**. Accessible coordinated candidate: **1.0.0**, not +published yet. [Release decision](RELEASE-DECISION.md) records version policy, actual +consumer pins and accent families. [GB acceptance](validation/bunit-2.7.2/ACCEPTANCE.md) +records all seven bUnit migrations. Historical current-state reports describe their +original snapshots; they are not current rollout records. -## Why UI theme is a strong candidate +- [Specification](spec/SPEC.md) +- [Canonical tokens](spec/DESIGN-TOKENS.md) +- [Interaction recipes](spec/INTERACTION-RECIPES.md) +- [Component contract](shared-contract/ZB.MOM.WW.Theme.md) +- [Library usage](../../ZB.MOM.WW.Theme/README.md) +- [Execution ledger](../../docs/plans/2026-11-12-scada-ui-consistency/EXECUTION.md) +- [Historical adoption notes](GAPS.md) -All three sister apps share a Blazor SSR + Bootstrap 5 UI stack and each ships a -hand-copied **379-line `theme.css`** (the "Technical-Light" design system: IBM Plex -`@font-face`, `:root` design tokens, status palette, typography helpers). **The three -copies are byte-for-byte identical except for three lines** — the `@font-face` `src:` -URL prefix differs per app deployment convention. IBM Plex `.woff2` fonts are likewise -vendored three times into each app's `wwwroot/fonts/`. This is the textbook drift -situation: a shared design system already beginning to diverge, with a latent font-path -bug in one app (OtOpcUa) that goes unnoticed because browsers fall back to system fonts. +| Consumer | Baseline Theme | Accessible adoption | +|---|---|---| +| ScadaBridge Host/CentralUI | 0.5.3 | Pending exact candidate canary/release | +| OtOpcUa AdminUI | 0.5.0 | Pending G1 | +| MxAccessGateway Server | 0.5.0 | Pending G1 | +| HistorianGateway Server | 0.5.0 | Pending G1 | +| BTDB Manager | 0.4.1 | Pending G1 | +| Overview | 0.5.0 | Pending exact candidate canary/release | +| ignitionoee router | 0.5.0 | Pending G1 | +| ignitionoee registry/Perspective | Native/public-feed graph | Package-derived export/native mapping pending | -## Status by project +Keep one CSS/font authority per application. Use ThemeHead after host Bootstrap and +ThemeScripts once near the end of the body. Preserve compact sizing, rail behavior +and current brand accents; use semantic inks for readable state text. Complete accent +families, labeled field IDs and persistent operation outcomes are documented in the +contracts. Status/info meaning is shared across products. Explicit supported dark +schemes require their own readable aliases and verification. -| Project | Surface | Layout today | Adoption status | -|---|---|---|---| -| **OtOpcUa** | `ZB.MOM.WW.OtOpcUa.AdminUI` | Side rail (`NavSidebar.razor`) + `theme.css` + IBM Plex | Not started | -| **MxAccessGateway** | `ZB.MOM.WW.MxGateway.Server` Dashboard | Sidebar (`nav.sidebar`) + `theme.css` + IBM Plex | Not started | -| **ScadaBridge** | `ZB.MOM.WW.ScadaBridge.Host` + `.CentralUI` (RCL) | Own `MainLayout` + `NavMenu` (`nav.sidebar`) + `theme.css` + IBM Plex | Not started | - -See each project's [`current-state//CURRENT-STATE.md`](current-state/) for the -code-verified detail and its adoption plan. - -## Normalized vs. left per-project - -**Normalized (extracted into the RCL `ZB.MOM.WW.Theme`):** design tokens + IBM Plex -fonts, the canonical side-rail shell (`ThemeShell` + `BrandBar` + `NavRailItem` + -`NavRailSection`), and the four widgets (`StatusPill`, `LoginCard`, `TechButton`, -`TechCard`, `TechField`). One RCL, one package, one version. - -**Left per-project (NOT extracted):** each app's `site.css` residual page layout, its -page/route content, and app-specific scoped `.razor.css` (e.g. ScadaBridge's -`MultiSelectDropdown`, `TreeView`, `Audit/*`). The kit owns the *chrome and tokens*, not -the app's domain screens. +The 1.0.0 static exporter takes exact validated package bytes and produces CSS/fonts, +raw tokens and provenance hashes for hosts that cannot use a private RCL package. +No registry private-feed dependency is introduced. Domain editors, authentication, +authorization, data loading and protocols remain host responsibilities. diff --git a/components/ui-theme/RELEASE-DECISION.md b/components/ui-theme/RELEASE-DECISION.md index 3495fff..d0c520b 100644 --- a/components/ui-theme/RELEASE-DECISION.md +++ b/components/ui-theme/RELEASE-DECISION.md @@ -36,3 +36,16 @@ Light is the shared supported scheme. Preserve ScadaBridge's existing supported ## Release gates Implement and verify token, field, accent, busy, focus/motion and interaction contracts before packing. Commit reviewed source/version first; record exact revision, package and export hashes. Run Overview and ScadaBridge local canaries from that package. Publication and independent feed verification remain TH-09; this decision does not claim a package was built, published or deployed. Rollback is the exact prior per-consumer package/artifact, not an overwritten feed version. + +## Accent text contrast refinement + +Token math found the existing green `#2f855a` and teal `#1b7f8e` readable with white primary-button labels (4.54:1 and 4.69:1), but insufficient as small link text on paper (4.12:1 and 4.26:1). Preserve those product colors for primary surfaces/signals and use the authored deep accent for links/ghost text. This refines TH-04's minimum mapping to satisfy the shared contrast requirement without changing the existing brand colors. Actual browser selector/opacity verification remains required. + +| Family | Accent | Deep / focus | Tint | Border | +|---|---|---|---|---| +| Default | `#2f5fd0` | `#1e3f99` | `#eef2fc` | `#cdd9f7` | +| Historian | `#2f855a` | `#1c6540` | `#edf5f0` | `#bddbc9` | +| BTDB | `#1b7f8e` | `#125764` | `#eaf5f6` | `#b7d9dd` | +| Overview | `#6d28d9` | `#4c1d95` | `#f2ecfc` | `#d7c5f2` | + +These complete authored families are the candidate adoption values, pending canary computed-style acceptance. Focus uses the deep value in each family. Do not substitute branded color into semantic info. diff --git a/components/ui-theme/shared-contract/ZB.MOM.WW.Theme.md b/components/ui-theme/shared-contract/ZB.MOM.WW.Theme.md index bd77b20..5a51244 100644 --- a/components/ui-theme/shared-contract/ZB.MOM.WW.Theme.md +++ b/components/ui-theme/shared-contract/ZB.MOM.WW.Theme.md @@ -1,12 +1,13 @@ # Shared library: `ZB.MOM.WW.Theme` -**Status: Built + Published + Adopted (`0.2.0`).** The RCL lives at -[`scadaproj/ZB.MOM.WW.Theme/`](../../../ZB.MOM.WW.Theme/) — built, tested (44 bUnit tests), and -**published to the Gitea NuGet feed**. **Adopted across all three apps on 2026-06-03** — merged to each repo's -local default and **pushed to origin (gitea)**, in sync (see [`../GAPS.md`](../GAPS.md)). -Realizes [`../spec/SPEC.md`](../spec/SPEC.md). +**Current published release: 0.5.3; accessible candidate: 1.0.0 (not yet published).** +The .NET 10 RCL lives at [`ZB.MOM.WW.Theme`](../../../ZB.MOM.WW.Theme/). +The integrated candidate suite currently passes 105 tests, zero failures/skips; +package canaries and release acceptance remain pending. See [release decision](../RELEASE-DECISION.md) +for exact consumer pins, version policy and scope, and [interaction recipes](../spec/INTERACTION-RECIPES.md) +for host-owned behavior. Realizes [the shared specification](../spec/SPEC.md). -`0.2.0` adds **shared nav-expand persistence**: `NavRailSection` gained a `Key` parameter (emitted as +Historical extraction: `0.2.0` adds **shared nav-expand persistence**: `NavRailSection` gained a `Key` parameter (emitted as `data-nav-key`, defaulting to a slug of `Title`), a vendored `wwwroot/js/nav-state.js` localStorage enhancer (keyed by `data-nav-key`, prefix `zbnav:`, idempotent), and a new **`ThemeScripts`** component (sibling to `ThemeHead`) that emits the enhancer ` + + + + + diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/App.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/App.razor new file mode 100644 index 0000000..27109e4 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/App.razor @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/AccentCanary.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/AccentCanary.razor new file mode 100644 index 0000000..d71eebe --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/AccentCanary.razor @@ -0,0 +1,41 @@ +@page "/accent" +Four-family accent component canary +

Four-family accent component canary

+

Fixture-only shared components under the actual CentralUI stylesheet. These four cases use the release-decision table and validate the shared light scheme, not a full sister application.

+ + + + +

@Selected.Label

+

An actual theme-styled link

+
+ Local primary action + Local ghost action + Disabled primary action +
+ Independent semantic information +

Synthetic local clicks: @_clicks

+
+
+@code { + [SupplyParameterFromQuery(Name = "family")] public string? Family { get; set; } + private int _clicks; + private void CountClick() => _clicks++; + private AccentCase Selected => Family?.ToLowerInvariant() switch + { + "historian" => new("Historian green", "#2f855a", "#1c6540", "#edf5f0", "#bddbc9"), + "btdb" => new("BTDB teal", "#1b7f8e", "#125764", "#eaf5f6", "#b7d9dd"), + "overview" => new("Overview purple", "#6d28d9", "#4c1d95", "#f2ecfc", "#d7c5f2"), + _ => new("Default blue", "#2f5fd0", "#1e3f99", "#eef2fc", "#cdd9f7") + }; + private sealed record AccentCase(string Label, string Accent, string Deep, string Tint, string Border); +} diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.before.razor.txt b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.before.razor.txt new file mode 100644 index 0000000..f9eecfc --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.before.razor.txt @@ -0,0 +1,20 @@ +@page "/" +@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout +@inject IDialogService Dialogs +ScadaBridge local component canary +

ScadaBridge local component canary

+

Actual CentralUI MainLayout, DateTimeRangeFilter, LoadingSpinner and DialogHost with synthetic local content. This is not the complete application.

+

Actual CentralUI login · Fixture provenance

+
+
Synthetic local filter
+
+ + +

These controls have no fleet service behind them.

+ Open local confirmation +
+
+@code { + private async Task ShowDialog() => await Dialogs.ConfirmAsync( + "Local fixture confirmation", "Synthetic dialog. Confirm and Cancel only dismiss this local fixture."); +} diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.razor new file mode 100644 index 0000000..849660b --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/Canary.razor @@ -0,0 +1,54 @@ +@page "/" +@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout +@inject IDialogService Dialogs +ScadaBridge local component canary +

ScadaBridge local component canary

+

Actual CentralUI MainLayout, DateTimeRangeFilter, LoadingSpinner and DialogHost with synthetic local content. This is not the complete application.

+

Actual CentralUI login · Fixture provenance

+
+
Synthetic local filter
+
+ + +

These controls have no fleet service behind them.

+ + + +
+ Save local sample + Simulate local failure + Caller-disabled local action + Open local confirmation +
+
@_outcome
+

Dark-mode candidate tokens below are fixture-only proposed adoption aliases, not current ScadaBridge production styling.

+
+
+@code { + private string _sample = ""; + private string? _fieldError = "Synthetic validation error. Enter a label to clear it."; + private string? _workingAction; + private string _outcome = "No local operation has run."; + private bool IsWorking => _workingAction is not null; + private bool SuccessBusy => _workingAction == "success"; + private bool FailureBusy => _workingAction == "failure"; + private string FieldDescription => _fieldError is null + ? "canary-field-hint" : "canary-field-hint canary-field-error"; + private void ValidateSample() => _fieldError = string.IsNullOrWhiteSpace(_sample) + ? "Synthetic validation error. Enter a label to clear it." : null; + private async Task WorkAsync(bool failure) + { + if (IsWorking) return; + _workingAction = failure ? "failure" : "success"; + _outcome = "Local sample pending."; + await Task.Delay(800); + _outcome = failure ? "Local sample failed. Try again." : "Local sample saved."; + _workingAction = null; + } + private async Task ShowDialog() => await Dialogs.ConfirmAsync( + "Local fixture confirmation", "Synthetic dialog. Confirm and Cancel only dismiss this local fixture."); +} diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/LoginCanary.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/LoginCanary.razor new file mode 100644 index 0000000..f5ee6d2 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Pages/LoginCanary.razor @@ -0,0 +1,3 @@ +@page "/login" +ScadaBridge actual login component canary + diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Routes.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Routes.razor new file mode 100644 index 0000000..dcc99d4 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/Routes.razor @@ -0,0 +1,4 @@ + + +

Canary route not found

+
diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/_Imports.razor b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/_Imports.razor new file mode 100644 index 0000000..872dde9 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Components/_Imports.razor @@ -0,0 +1,6 @@ +@using Microsoft.AspNetCore.Components +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using ZB.MOM.WW.Theme +@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Program.cs b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Program.cs new file mode 100644 index 0000000..d9a3dde --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/Program.cs @@ -0,0 +1,45 @@ +using System.Security.Claims; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.Extensions.FileProviders; +using ScadaBridgeUiCanary.Components; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.Theme; + +var builder = WebApplication.CreateBuilder(args); +builder.WebHost.UseStaticWebAssets(); +builder.Services.AddRazorComponents().AddInteractiveServerComponents(); +builder.Services.AddDataProtection().UseEphemeralDataProtectionProvider(); +builder.Services.AddAuthorizationCore(); +builder.Services.AddCascadingAuthenticationState(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +var app = builder.Build(); +app.UseStaticFiles(new StaticFileOptions +{ + FileProvider = new PhysicalFileProvider(Path.Combine( + builder.Configuration["Canary:ScadaBridgeRoot"] ?? "/Users/dohertj2/Desktop/ScadaBridge", + "src/ZB.MOM.WW.ScadaBridge.Host/wwwroot")) +}); +app.UseStaticFiles(); +app.UseAntiforgery(); +app.MapGet("/canary-provenance", () => new +{ + purpose = "Disposable local component canary; not the complete ScadaBridge application", + themeAssembly = typeof(ThemeShell).Assembly.GetName().Version?.ToString(), + centralUiAssembly = typeof(DialogHost).Assembly.GetName().Version?.ToString(), + data = "Synthetic local only; no SQL, Akka, LDAP or fleet services registered", + source = "Authorized ScadaBridge checkout via project reference" +}); +app.MapGet("/auth/ping", () => Results.Ok()); +app.MapPost("/auth/activity", () => Results.NoContent()); +app.MapPost("/auth/login", () => Results.StatusCode(405)); +app.MapPost("/auth/logout", () => Results.StatusCode(405)); +app.MapRazorComponents().AddInteractiveServerRenderMode(); +app.Run(); + +internal sealed class LocalAnonymousState : AuthenticationStateProvider +{ + public override Task GetAuthenticationStateAsync() => + Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()))); +} diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/ScadaBridgeUiCanary.csproj b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/ScadaBridgeUiCanary.csproj new file mode 100644 index 0000000..1f35290 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/ScadaBridgeUiCanary.csproj @@ -0,0 +1,13 @@ + + + net10.0 + enable + enable + /Users/dohertj2/Desktop/ScadaBridge + 0.5.3 + + + + + + diff --git a/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/wwwroot/canary-adoption.css b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/wwwroot/canary-adoption.css new file mode 100644 index 0000000..2ffbe98 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/canary/scadabridge/wwwroot/canary-adoption.css @@ -0,0 +1,26 @@ +/* Fixture-only proposed ScadaBridge dark adoption aliases. This stylesheet is never + copied into the production app. Load after the actual CentralUI stylesheet. */ +html[data-canary="scadabridge"] .canary-action-row { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: .75rem; + margin-block: 1rem; +} +html[data-canary="scadabridge"][data-bs-theme="dark"] { + /* Existing dark accent #4d7fe8 is only 3.88:1 as link text on --card. + The same blue hue is lightened here for body-sized links. */ + --accent: #7aa0ef; + --accent-deep: #9dbaf6; + --accent-tint: #1e2640; + --accent-border: #566d9c; + --accent-focus: #a7c1ff; + --on-accent: #111827; + --ok-ink: #8ada96; + --warn-ink: #efbd63; + --warn-ink-deep: #efbd63; + --bad-ink: #ff9d9d; + --idle-ink: #c3cad5; + --info-ink: #b4c6ff; + --ink-faint: #a8b0bc; +} diff --git a/components/ui-theme/validation/theme-1.0.0/exporter.md b/components/ui-theme/validation/theme-1.0.0/exporter.md new file mode 100644 index 0000000..8eae201 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/exporter.md @@ -0,0 +1,52 @@ +# TH-08 offline exporter validation + +Recorded 2026-11-13 in the managed `scada-ui-consistency/scadaproj` worktree. This record covers the offline implementation only; it does not claim a release-package export, registry import, publication or G1 completion. + +## Files + +- `ZB.MOM.WW.Theme/build/export-web-assets.py` +- `ZB.MOM.WW.Theme/build/test_export_web_assets.py` + +No release version, README, shared ledger, production UI or package artifact was changed by this slice. + +## Red → green checks actually executed + +Cwd: `ZB.MOM.WW.Theme` in the managed worktree. + +```bash +python3 -m unittest discover -s build -p 'test_export_web_assets.py' -v +``` + +Initial red: unittest failed import with `FileNotFoundError` for the absent `build/export-web-assets.py`. The test file was written before the exporter. + +After implementation: **13 unittest methods passed**, with independent synthetic nupkg fixtures and additional negative-case subtests. Following a formatting-only cleanup, the same command passed all 13 again. Runtime: Python 3.14.3. `git diff --check -- build/export-web-assets.py build/test_export_web_assets.py` also passed. + +## Behaviors covered + +- Byte-for-byte parity for the five specified CSS/font payloads; no DLL or unrelated package payload is exported. +- Exact nuspec package ID, nuspec-derived version, explicit caller-supplied source revision/tag, original nupkg SHA256 and every exported payload SHA256. Manifest excludes a self-hash. +- Complete canonical top-level root tokens including future/custom tokens, raw `var(...)` references, quoted strings and function values. Comments do not create phantom tokens or alter the copied CSS bytes. +- Deterministic zip bytes for identical inputs: sorted paths, fixed timestamps, fixed Unix file metadata, stored compression and stable JSON serialization. +- Changed input CSS bytes change their payload hash and the package provenance hash. +- Refusal of each missing required CSS/font asset; missing/empty required semantic tokens; malformed delimiters, comments/strings/declarations, nested canonical declarations, duplicate root tokens or multiple canonical root blocks. +- Refusal of wrong ID, empty version, malformed/ambiguous nuspec XML; duplicate zip paths; absolute, parent-traversal, Windows-drive/backslash and alias paths, including entries outside the exported allowlist. +- Invalid input leaves existing output intact. Output cannot replace the input nupkg. Successful output uses atomic replacement after complete validation. +- CLI requires all four explicit arguments and creates a valid output archive with valid provenance inputs. + +## Parser and provenance boundaries + +The parser supports the canonical top-level `:root` custom-property declaration block; it is not a CSS cascade implementation or arbitrary CSS validator. Raw values and references are preserved, not resolved for native consumers. Required semantic tokens include the shared ink/surface/status/accent-family/font contract, so the old pre-1.0.0 package is intentionally not a substitute for the forthcoming reviewed release. + +`--source-revision` requires a full Git hash; `--source-tag` requires explicit text such as the actual release tag or an untagged marker. The exporter validates metadata shape but cannot establish that a caller-supplied commit/tag produced the nupkg. The release workflow must supply the reviewed clean package revision and independently verify the exact artifact. + +## Remaining TH-08 release checks + +Wait for the parent-owned reviewed 1.0.0 nupkg and exact source revision/tag. Then generate `technical-light-web-assets.1.0.0.zip` from those package bytes, independently recompute all payload/source hashes and record both immutable artifact hashes. Registry pilot/import and native mapping belong to their consumer chapters. No real package export was generated in this offline slice. + +## Independent-review alias correction + +The initial resolved-path equality check missed existing filesystem aliases. Two added regression tests reproduced the defect before the fix: a case alias on this case-insensitive APFS filesystem and a hard link both failed to raise ValueError. The exporter now additionally rejects an existing output whose `Path.samefile(package)` identity matches the input, before reading/writing payloads. + +After correction, the same offline unittest command passed **15/15 methods, zero skips** on this host, including both alias regressions and all original integrity cases. Input bytes and aliases remain intact on rejection. The case-alias regression is conditional on filesystem behavior for portability; it actually executed and passed here. Narrow exporter/tests/README `git diff --check` passed. Real-package export/source-revision validation remains deferred to the parent release gate. + +Parent integration also made on-accent a required semantic token. Its missing-token subcase reproduced failure before enforcement; all15 artifact tests pass after enforcement. Final source includes this additional release-boundary protection. diff --git a/components/ui-theme/validation/theme-1.0.0/field-busy.md b/components/ui-theme/validation/theme-1.0.0/field-busy.md new file mode 100644 index 0000000..746876b --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/field-busy.md @@ -0,0 +1,80 @@ +# TH-03 / TH-05 — field associations and busy actions + +Implementation checkpoint for the Theme 1.0.0 candidate. Source is in the managed scadaproj worktree on `codex/scada-ui-consistency`; this checkpoint does not publish the package or migrate consumers. + +## Additive component contracts + +`TechField` now accepts optional nullable strings: + +- `For`: renders on the existing label as `for`; the caller assigns that id to its actual input/select/editor. +- `HintId`: renders on the existing hint node when nonempty Hint content exists. +- `ErrorId`: renders on the existing error node when nonempty Error content exists. + +The wrapper does not inspect or modify arbitrary ChildContent. It does not generate ids, choose a control, synthesize invalid state, manage focus, or announce errors globally. Existing callers without the new parameters still render without `for`/description ids. Null or empty Hint/Error does not create a description node, even when an id parameter was supplied. + +A caller with both help and a conditional validation error should wire its own control explicitly: + +```razor + + + +``` + +Keep ids stable and unique per form instance/row, including concurrently rendered or hidden forms. When the error clears, remove the error id from `aria-describedby` and clear `aria-invalid`; never reference absent description nodes. Existing custom control aria-labels and behavior remain caller-owned. The field-name example is synthetic and contains no secret value. + +`TechButton` now accepts optional `BusyText` and explicitly renders `aria-busy="true"` or `"false"` from Busy. While Busy is true, nonempty BusyText replaces ChildContent; null/empty BusyText preserves the existing child content. When Busy becomes false, the original ChildContent returns. The spinner remains decorative (`aria-hidden=true`). + +Busy continues to disable the control, combined with the existing caller-disabled semantics. Completing work does not enable an action that the caller independently disabled. Explicit Busy controls aria-busy even if an unmatched caller attribute contains stale busy text/state; existing Type, variant, size, class composition and click callback behavior remain intact. + +An interactive caller can supply operation-specific pending text and its own persistent outcome region: + +```razor + + Save changes + +

@saveOutcome

+``` + +The owning form/operation still prevents duplicate submission, handles failures/cancellation and writes a concise success/failure outcome once. The button adds no global live region, no automatic success text and no retry. Do not put secret values or every polling update in an outcome region. Keep actionable validation/recovery inline; do not depend solely on expiring toasts. Static SSR login POST and antiforgery behavior are unchanged. + +## Actual verification + +Working directory: + +```text +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj +``` + +Command executed before the component parameters existed, then again after implementation: + +```sh +dotnet test ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj \ + -c Release --artifacts-path /tmp/theme-fields-artifacts \ + --filter 'FullyQualifiedName~TechFieldAssociationTests|FullyQualifiedName~TechButtonExtensionsTests|FullyQualifiedName~CommonControlsTests' \ + --logger 'trx;LogFileName=green.trx' \ + --results-directory components/ui-theme/validation/theme-1.0.0/fields-busy +``` + +The first run used `red.trx` and `red.log`: exit 1, with missing For/HintId/ErrorId/BusyText compile errors as expected. Concurrent TH-04 red tests also produced missing ThemeShell-parameter errors in that same compile; the log is retained honestly rather than attributing all compile errors to this task. + +After both assigned components were implemented and TH-04 parameters existed, the focused run passed **28 tests, 0 failed, 0 skipped** (exit 0): + +- Six new field cases: associations; null/empty descriptions; independent repeated fields; clearing an error without changing caller control content; backward-compatible callers without associations. +- Four new busy cases: replacement/restoration plus click behavior; null/empty fallback; caller-disabled remains disabled and stale unmatched aria-busy cannot override component state. +- Eighteen existing extension/common-control cases, including variants, size/class composition, Type, caller-disabled toggling and existing field/card behavior. + +Evidence: [red log](fields-busy/red.log), [green log](fields-busy/green.log), [green TRX](fields-busy/green.trx). Output was isolated under `/tmp/theme-fields-artifacts` to avoid racing another agent's normal-output test run. + +Impeccable detector ran once over the two changed Razor components: [detector.json](fields-busy/detector.json), empty findings, exit 0. `git diff --check` passed for the assigned existing files. No CSS, ThemeShell, README, task ledger or package version file was edited in this task. No commit was created. + +## Remaining acceptance boundaries + +The parent integration pass owns the full Theme suite in its standard output layout. Existing static-asset tests resolve source files relative to standard test output, so this isolated filtered run does not claim full-suite acceptance. + +No real consumer browser/session has been exercised for this checkpoint. bUnit proves the emitted relationships, pending-state text and existing component behavior; it does not prove actual label-click focus, screen-reader announcement quality, keyboard focus after slow success/failure, host style contrast or mobile composition. Those checks remain part of the two-host candidate pilots/G1. No package publication, deployment or consumer migration is claimed. diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.exit b/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.exit @@ -0,0 +1 @@ +0 diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.json b/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/detector.json @@ -0,0 +1 @@ +[] diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/green.exit b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.exit @@ -0,0 +1 @@ +0 diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/green.log b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.log new file mode 100644 index 0000000..7735373 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.log @@ -0,0 +1,9 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.Theme -> /tmp/theme-fields-artifacts/bin/ZB.MOM.WW.Theme/release/ZB.MOM.WW.Theme.dll + ZB.MOM.WW.Theme.Tests -> /tmp/theme-fields-artifacts/bin/ZB.MOM.WW.Theme.Tests/release/ZB.MOM.WW.Theme.Tests.dll +Test run for /tmp/theme-fields-artifacts/bin/ZB.MOM.WW.Theme.Tests/release/ZB.MOM.WW.Theme.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +Results File: /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/theme-1.0.0/fields-busy/green.trx + +Passed! - Failed: 0, Passed: 28, Skipped: 0, Total: 28, Duration: 232 ms - ZB.MOM.WW.Theme.Tests.dll (net10.0) diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/green.trx b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.trx new file mode 100644 index 0000000..273d247 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/green.trx @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.4+50e68bbb8b (64-bit .NET 10.0.14) +[xUnit.net 00:00:00.03] Discovering: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.06] Discovered: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.07] Starting: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.31] Finished: ZB.MOM.WW.Theme.Tests + + + + \ No newline at end of file diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/red.exit b/components/ui-theme/validation/theme-1.0.0/fields-busy/red.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/red.exit @@ -0,0 +1 @@ +1 diff --git a/components/ui-theme/validation/theme-1.0.0/fields-busy/red.log b/components/ui-theme/validation/theme-1.0.0/fields-busy/red.log new file mode 100644 index 0000000..98f67ce --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/fields-busy/red.log @@ -0,0 +1,30 @@ + Determining projects to restore... + Restored /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/ZB.MOM.WW.Theme.csproj (in 30 ms). + Restored /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj (in 121 ms). + ZB.MOM.WW.Theme -> /tmp/theme-fields-artifacts/bin/ZB.MOM.WW.Theme/release/ZB.MOM.WW.Theme.dll +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(9,51): error CS1061: 'TechField' does not contain a definition for 'For' and no accessible extension method 'For' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(10,63): error CS1061: 'TechField' does not contain a definition for 'HintId' and no accessible extension method 'HintId' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs(11,25): error CS1061: 'TechButton' does not contain a definition for 'BusyText' and no accessible extension method 'BusyText' accepting a first argument of type 'TechButton' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs(40,25): error CS1061: 'TechButton' does not contain a definition for 'BusyText' and no accessible extension method 'BusyText' accepting a first argument of type 'TechButton' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(27,51): error CS1061: 'TechField' does not contain a definition for 'For' and no accessible extension method 'For' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(28,50): error CS1061: 'TechField' does not contain a definition for 'HintId' and no accessible extension method 'HintId' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(46,58): error CS0117: 'TechField' does not contain a definition for 'For' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(48,58): error CS0117: 'TechField' does not contain a definition for 'HintId' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechButtonExtensionsTests.cs(53,25): error CS1061: 'TechButton' does not contain a definition for 'BusyText' and no accessible extension method 'BusyText' accepting a first argument of type 'TechButton' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(70,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentTint' and no accessible extension method 'AccentTint' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(71,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentBorder' and no accessible extension method 'AccentBorder' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(96,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentFocus' and no accessible extension method 'AccentFocus' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(69,51): error CS1061: 'TechField' does not contain a definition for 'For' and no accessible extension method 'For' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/TechFieldAssociationTests.cs(70,57): error CS1061: 'TechField' does not contain a definition for 'HintId' and no accessible extension method 'HintId' accepting a first argument of type 'TechField' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(108,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentTint' and no accessible extension method 'AccentTint' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(109,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentBorder' and no accessible extension method 'AccentBorder' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(114,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentDeep' and no accessible extension method 'AccentDeep' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(115,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentTint' and no accessible extension method 'AccentTint' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(116,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentBorder' and no accessible extension method 'AccentBorder' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(117,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentFocus' and no accessible extension method 'AccentFocus' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(134,55): error CS0117: 'ThemeShell' does not contain a definition for 'AccentDeep' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(135,55): error CS0117: 'ThemeShell' does not contain a definition for 'AccentTint' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(136,55): error CS0117: 'ThemeShell' does not contain a definition for 'AccentBorder' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(137,55): error CS0117: 'ThemeShell' does not contain a definition for 'AccentFocus' [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(146,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentTint' and no accessible extension method 'AccentTint' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] +/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ThemeShellTests.cs(147,25): error CS1061: 'ThemeShell' does not contain a definition for 'AccentBorder' and no accessible extension method 'AccentBorder' accepting a first argument of type 'ThemeShell' could be found (are you missing a using directive or an assembly reference?) [/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj] diff --git a/components/ui-theme/validation/theme-1.0.0/motion-before.md b/components/ui-theme/validation/theme-1.0.0/motion-before.md new file mode 100644 index 0000000..ac923c9 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/motion-before.md @@ -0,0 +1,17 @@ +# Real-host reduced-motion baseline + +Before shared focus/motion edits, Chromium on the actual Overview host at localhost:5198 +with the released Theme 0.5.0 and reducedMotion=reduce still computed `.rise` animation +`rise`, duration 0.4s, opacity 0 immediately after load at 1440×900, 1024×768 and390×844. +The local registry points only at its own loopback health endpoints. No production data +or services are used. Raw observation is `overview-before.json`. + +The disposable actual ScadaBridge CentralUI component host at localhost:5199 resolves +released Theme 0.5.3. It reproduced rise 0.4s with opacity0/0.0105 immediately on component +and Login routes under reduced motion. Existing native/Bootstrap input focus was visible +as a blue shadow; this is an accent consistency improvement, not a claim of invisible +baseline focus. Exact evidence, source/adapters and fixture limits are under `canary/`. + +Both observations precede shared focus/motion implementation. They establish the failing +motion preference behavior in two real Razor host modes, not a static mockup. Candidate +package after checks remain pending. Production deployment is outside these observations. diff --git a/components/ui-theme/validation/theme-1.0.0/overview-before.json b/components/ui-theme/validation/theme-1.0.0/overview-before.json new file mode 100644 index 0000000..9dd0cf9 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/overview-before.json @@ -0,0 +1,8 @@ +{ + "content": [ + { + "type": "text", + "text": "### Result\n[{\"url\":\"http://127.0.0.1:5198/\",\"width\":1440,\"scrollWidth\":1440,\"reducedMotion\":true,\"rise\":[{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"}],\"shellVisible\":true,\"themeCss\":[\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/theme.css\",\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/layout.css\"]},{\"url\":\"http://127.0.0.1:5198/\",\"width\":1024,\"scrollWidth\":1024,\"reducedMotion\":true,\"rise\":[{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"}],\"shellVisible\":true,\"themeCss\":[\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/theme.css\",\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/layout.css\"]},{\"url\":\"http://127.0.0.1:5198/\",\"width\":390,\"scrollWidth\":390,\"reducedMotion\":true,\"rise\":[{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"},{\"name\":\"rise\",\"duration\":\"0.4s\",\"opacity\":\"0\"}],\"shellVisible\":true,\"themeCss\":[\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/theme.css\",\"http://127.0.0.1:5198/_content/ZB.MOM.WW.Theme/css/layout.css\"]}]\n### Ran Playwright code\n```js\nawait (async (page) => { const results=[]; await page.emulateMedia({reducedMotion:'reduce'}); for (const [width,height] of [[1440,900],[1024,768],[390,844]]) { await page.setViewportSize({width,height}); await page.reload(); const state=await page.evaluate(()=>({url:location.href,width:innerWidth,scrollWidth:document.documentElement.scrollWidth,reducedMotion:matchMedia('(prefers-reduced-motion: reduce)').matches,rise:[...document.querySelectorAll('.rise')].slice(0,3).map(e=>({name:getComputedStyle(e).animationName,duration:getComputedStyle(e).animationDuration,opacity:getComputedStyle(e).opacity})),shellVisible:document.querySelector('main')?.getBoundingClientRect().height>0,themeCss:[...document.styleSheets].map(s=>s.href).filter(s=>s?.includes('ZB.MOM.WW.Theme'))})); results.push(state); } return results; })(page);\n```\n### Events\n- New console entries: .playwright-mcp/console-2026-11-13T20-38-49-574Z.log#L6-L11" + } + ] +} diff --git a/components/ui-theme/validation/theme-1.0.0/prepack-build.log b/components/ui-theme/validation/theme-1.0.0/prepack-build.log new file mode 100644 index 0000000..c5f2f45 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/prepack-build.log @@ -0,0 +1,11 @@ + Determining projects to restore... + Restored /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/ZB.MOM.WW.Theme.csproj (in 41 ms). + Restored /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/ZB.MOM.WW.Theme.Tests.csproj (in 117 ms). + ZB.MOM.WW.Theme -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/src/ZB.MOM.WW.Theme/bin/Release/net10.0/ZB.MOM.WW.Theme.dll + ZB.MOM.WW.Theme.Tests -> /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:01.24 diff --git a/components/ui-theme/validation/theme-1.0.0/prepack-test.log b/components/ui-theme/validation/theme-1.0.0/prepack-test.log new file mode 100644 index 0000000..443ff36 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/prepack-test.log @@ -0,0 +1,5 @@ +Test run for /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/ZB.MOM.WW.Theme/tests/ZB.MOM.WW.Theme.Tests/bin/Release/net10.0/ZB.MOM.WW.Theme.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +Results File: /Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/theme-1.0.0/tests/prepack.trx + +Passed! - Failed: 0, Passed: 105, Skipped: 0, Total: 105, Duration: 207 ms - ZB.MOM.WW.Theme.Tests.dll (net10.0) diff --git a/components/ui-theme/validation/theme-1.0.0/review-components.md b/components/ui-theme/validation/theme-1.0.0/review-components.md new file mode 100644 index 0000000..c8d7e0c --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/review-components.md @@ -0,0 +1,18 @@ +# Independent component/source review — 1.0.0 candidate + +Reviewed 2026-11-13 in the managed worktree. Scope: current TechField, TechButton and ThemeShell diffs; their new/retained tests; semantic/accent CSS and README contracts. This is source review, not a browser acceptance run or G1/TH-07 completion. Parent reports 105 full tests passing; this reviewer did not repeat that run or treat the old 0.5.0 localhost canary as evidence for the candidate. + +## Concrete finding + +**P2 — README field recipe treated an empty error as present (resolved).** The example used null-only checks while TechField intentionally omits its error node for both null and empty string. With `NameError = ""`, the example would set `aria-invalid=true` and reference missing `name-error`. Reported promptly; parent authorized the narrow correction. Both conditional attributes now use `!string.IsNullOrEmpty(NameError)`, matching the component/test contract. No component behavior changed for this fix. + +## Review conclusions + +- **Field associations:** additive nullable For/HintId/ErrorId emit only caller-selected associations. ChildContent remains untouched; caller owns input IDs, describedby/invalid cleanup, focus and announcements. Tests cover repeated fields, absent content, error removal and compatibility without new parameters. No guessed child-control rewriting or hidden live regions introduced. +- **Busy/action behavior:** explicit Busy state overrides splatted aria-busy, ORs with CallerDisabled, and retains existing type/size/class/callback behavior. BusyText replaces visible child label only when supplied and busy; original content returns afterward. Spinner remains decorative and caller-owned outcome text remains outside the component. Existing disabled string/boolean handling and class composition code are unchanged; new tests retain those contracts. +- **Accent scoping:** optional companion values are emitted on the shell only; omitted values inherit. The compatibility alias is rebound at `.app-shell`, and active rail background directly uses `--accent-tint`, avoiding root-computed blue alias leakage into a green/purple shell. Component tests prove emission/rerender boundaries, not computed inheritance. +- **Bootstrap states:** `.btn-primary` explicitly maps normal/hover/active/disabled color/background/border variables at component scope, rather than relying on root `--bs-primary`. Ghost/link button states map to scoped deep accent, with disabled text muted. Existing sizing/group seam rules remain. Browser computed-state verification remains required. +- **Semantic colors:** Info notice/pill/read-tag ink uses dedicated `--info-ink`, independent of product brand. Status text uses semantic ink; signal colors remain for dots/chart marks. Contrast tests include paper/card/tint pairs and authored family action/deep text combinations. +- **Security/scope:** new accent strings are documented trusted application configuration, extending the existing trusted Accent contract; they are not a remote theme editor. Razor still performs attribute encoding. No auth/domain behavior, routes, protocol, storage, or JavaScript lifecycle changes in these component API diffs. + +No further concrete component implementation regression was found in this source pass. Shared focus/reduced-motion work and actual candidate browser checks were still pending at review time; do not infer their completion from this review. Verify focus-visible/disabled/busy states, label focus, mobile disclosure, zoom and reduced motion against the newly built candidate assets. diff --git a/components/ui-theme/validation/theme-1.0.0/review-exporter.md b/components/ui-theme/validation/theme-1.0.0/review-exporter.md new file mode 100644 index 0000000..81e481b --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/review-exporter.md @@ -0,0 +1,38 @@ +# Independent exporter and release-candidate source review + +Reviewed 2026-11-13 in the managed `scada-ui-consistency/scadaproj` worktree. Scope: TH-08 exporter/tests after the alias fix; candidate component/usage documentation, token/accent rules and interaction recipes. No production source, CSS, test or release-ledger edits were made during this review. + +## Confirmed correction + +The earlier input-alias defect is resolved. `export_package` now rejects either resolved-path equality or an existing output whose `samefile(package)` identity matches the input. The latter is necessary on this actual case-insensitive APFS filesystem: case aliases can have unequal `resolve()` paths while identifying the same file. + +The case-alias and hardlink regressions verify rejection before replacement and preservation of both original/alias bytes. They are meaningful negative tests rather than just checking the guard's source text. + +## Independently executed verification + +Cwd: `ZB.MOM.WW.Theme` in the managed worktree. + +```sh +PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s build -p 'test_export_web_assets.py' -v +``` + +Result: **15 tests passed, zero failures, zero skips**, exit 0. Both APFS case-alias and hardlink cases actually executed on this host. Synthetic input/output files were confined to temporary directories. Bytecode output was disabled to keep the source tree untouched. + +## Review conclusions + +- ZIP paths are validated before payload selection: absolute/traversal/backslash/drive/alias paths and duplicate names are rejected, including unrelated entries outside the export allowlist. No arbitrary package member is extracted to the filesystem. +- Exactly one nuspec with the intended package id and a nonempty valid-shaped version is required. The exported version comes from that nuspec, not an output filename. +- Required CSS/font assets are copied without modification. Comment removal applies only to token parsing, not emitted CSS bytes. The canonical root parser preserves raw references and future custom properties while rejecting malformed/ambiguous supported structures; it is explicitly not an arbitrary CSS/cascade validator. +- Manifest provenance includes the exact package SHA256 and all payload hashes, with no self-hash. Source revision/tag are explicitly caller-supplied; the exporter checks their shape, while the release workflow must establish that they identify the reviewed clean build. +- Output creation follows validation and uses atomic replacement. Stable JSON, sorted ZIP entries, fixed timestamps and fixed metadata support deterministic repeated exports; byte parity/determinism/hash-change tests all pass. +- Real cached Theme 0.5.3 nupkg entry names were inspected independently: both CSS paths and all three font paths match the exporter allowlist. That confirms path assumptions only, not acceptance of an old package as the new semantic release. +- The current candidate CSS parses successfully into 47 canonical tokens. Product active-state color reads the shell-scoped accent tint directly and the compatibility alias is rebound on the shell. Semantic info remains separate blue; small status text uses semantic ink while signal colors remain available for decoration. +- Field documentation now uses null-or-empty error checks consistent with component behavior. Busy state/caller-disabled ownership and outcome-region guidance remain accurate. Interaction recipes document real DOM keydown handling, safe focus/inertness and caller-owned state without introducing an untested generic modal component. + +No further concrete exporter/source implementation blocker was found after the alias correction. The parent owns source freeze, full-suite/package integration and real-host acceptance. + +## Release checks still required + +This review does not claim G1 or publication. Freeze and commit reviewed source/version before packing the exact 1.0.0 artifact, then export from those bytes and independently recompute source/package/payload/export hashes using the matching source revision/tag. Test actual registry import paths and the exact candidate host graph; synthetic package tests cannot substitute for those checks. + +The earlier ScadaBridge dark-mode risk remains an explicit candidate-host acceptance item: its pre-adoption `--accent:#4d7fe8` against a white primary label is approximately 3.81:1 under the new primary-button mapping. The parent-assigned dark canary must verify a safe scheme-specific foreground/background before that consumer adopts. This reviewer did not run or claim that dark probe, label-click/screen-reader checks, reduced-motion browser checks or new-package canaries. diff --git a/components/ui-theme/validation/theme-1.0.0/source-detector.json b/components/ui-theme/validation/theme-1.0.0/source-detector.json new file mode 100644 index 0000000..e69de29 diff --git a/components/ui-theme/validation/theme-1.0.0/tests/prepack.trx b/components/ui-theme/validation/theme-1.0.0/tests/prepack.trx new file mode 100644 index 0000000..124cb7f --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/tests/prepack.trx @@ -0,0 +1,658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.4+50e68bbb8b (64-bit .NET 10.0.14) +[xUnit.net 00:00:00.03] Discovering: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.06] Discovered: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.07] Starting: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.30] Finished: ZB.MOM.WW.Theme.Tests + + + + \ No newline at end of file diff --git a/components/ui-theme/validation/theme-1.0.0/tests/theme-accent.trx b/components/ui-theme/validation/theme-1.0.0/tests/theme-accent.trx new file mode 100644 index 0000000..7dbc835 --- /dev/null +++ b/components/ui-theme/validation/theme-1.0.0/tests/theme-accent.trx @@ -0,0 +1,658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.4+50e68bbb8b (64-bit .NET 10.0.14) +[xUnit.net 00:00:00.03] Discovering: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.08] Discovered: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.11] Starting: ZB.MOM.WW.Theme.Tests +[xUnit.net 00:00:00.45] Finished: ZB.MOM.WW.Theme.Tests + + + + \ No newline at end of file diff --git a/docs/plans/2026-11-12-scada-ui-consistency/EXECUTION.md b/docs/plans/2026-11-12-scada-ui-consistency/EXECUTION.md index b9b69c4..7022696 100644 --- a/docs/plans/2026-11-12-scada-ui-consistency/EXECUTION.md +++ b/docs/plans/2026-11-12-scada-ui-consistency/EXECUTION.md @@ -37,3 +37,9 @@ Proceed in clean existing sister checkouts on new `codex/scada-ui-consistency` b ## GB accepted — November 13, 2026 Independent audit closed all seven migrations: 5,879 passed, zero failures, 75 unchanged external integration skips. All runtime package hashes and identities verified. See `components/ui-theme/validation/bunit-2.7.2/ACCEPTANCE.md`. BU-01–BU-10 completed. Shared Theme/UI work starts only after this acceptance. The user-authorized existing-checkout workflow remains in effect. + +## Shared Theme source batch — November 13, 2026 + +TH-01 selects 1.0.0; published version remains 0.5.3 until G1. Semantic text suite reproduced 15 failing pairs before implementation and now passes16. Full integrated suite including field/busy/shell contracts and four light accent families passes105 tests, zero failures/skips. Field associations and busytext are additive; source domain behavior is unchanged. Real Overview and disposable actual CentralUI hosts reproduced reduced-motion rise animation before focus/motion changes. Source and docs now implement focus/reduced-motion recipes. Offline exporter initially passed13tests; independent review caught filesystemaliases permitting input overwrite, fixed with samefile guard and two regressions (15green). Another review caught README emptyerror handling; corrected to the component's absence semantics. + +Actual package/static export, computed styles, slow action/focus flows, supported dark aliases and canary browser matrix remain open. No consumer adoption, feed publication or deployment is claimed. Candidate-source version is1.0.0; exact immutable artifact/source revision will be recorded only after clean source commit and canaries. diff --git a/docs/plans/2026-11-12-scada-ui-consistency/tasks.json b/docs/plans/2026-11-12-scada-ui-consistency/tasks.json index 3fc9c25..5d0c730 100644 --- a/docs/plans/2026-11-12-scada-ui-consistency/tasks.json +++ b/docs/plans/2026-11-12-scada-ui-consistency/tasks.json @@ -184,88 +184,103 @@ "title": "Capture post-GB baseline and Theme compatibility decisions (DS-06)", "chapter": "Theme.md", "line": 44, - "status": "planned", + "status": "completed", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/RELEASE-DECISION.md" }, { "id": "TH-02", "title": "Introduce readable semantic text inks (DS-01)", "chapter": "Theme.md", "line": 67, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-03", "title": "Associate TechField labels and descriptions (DS-02)", "chapter": "Theme.md", "line": 137, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-04", "title": "Carry the whole product accent through interaction states (DS-03)", "chapter": "Theme.md", "line": 178, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-05", "title": "Complete busy feedback without changing disabled semantics (DS-04)", "chapter": "Theme.md", "line": 216, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-06", "title": "Focus, reduced motion and responsive recipes (DS-04/05)", "chapter": "Theme.md", "line": 229, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-07", "title": "Documentation, package contents and local canary (DS-06)", "chapter": "Theme.md", "line": 255, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-08", "title": "Export canonical static assets for public-feed-only and native consumers (DS-05/06)", "chapter": "Theme.md", "line": 278, - "status": "planned", + "status": "in_progress", "prerequisiteGates": [ "GB" ], - "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task." + "dependencies": "GB is mandatory before every UI task; additional G1/G2/chapter dependencies remain in the master and named task.", + "evidence": "components/ui-theme/validation/theme-1.0.0", + "remaining": "Source/unit contracts implemented; actual package canaries and relevant browser/artifact acceptance remain open." }, { "id": "TH-09",