Files
lmxopcua/docs/ui-consistency/evidence/ot13-uns-modals/verification.md
T

40 lines
9.7 KiB
Markdown

# OT13 — four UNS modal wrappers
Scope: `AddReferenceModal`, `ImportEquipmentModal`, `ScriptedAlarmModal`, and `VirtualTagModal`. Production scope is exactly these four Razor files. Shared ModalFrame, dialog JavaScript, Monaco component/JavaScript, callers, services, schemas and domain models are outside this checkpoint.
## Result
All four use the accepted single-active ModalFrame with the original `modal-lg` width and canonical Bootstrap scrollable body, a named dialog, initial footer Cancel, busy close protection, scoped field/form/error IDs and visible contextual field names. Body fieldsets freeze controls during pending operations. Field validation first exposes the relevant error container, then focuses the associated input with preventScroll and a generation/Pending recheck, without changing validation rules; parser and service outcomes stay visible in fixed modal footer chrome. Error targets remain in the DOM and are linked to their controls/form.
Presentation identities include the optional nonconfidential Target and existing owning identity/DTO. Render callbacks capture their generation and public callback. Dispatched writes capture scalar payloads, selected reference IDs and copied rowversions; they are never cancelled or replayed. Retired completions cannot install results, invoke a replacement callback or surface obsolete service exceptions. Actual retained rendered-event regressions additionally prove CSV oninput cannot rewrite a replacement/pending draft and the script selection setter cannot change downstream identity while a script write is pending. Script ValueExpression and valid idle changes remain; the next write stays on S1 until an idle S2 selection loads S2. Current exceptions retain the existing route-boundary behavior. A service success may invoke a captured parent callback whose own awaited internals are caller-owned; this checkpoint does not certify those internals.
- **References:** retain structural equipment-cluster scope and real RawTree picker. Each presentation owns a fresh ordinal selected-ID set and keyed child; a retired descendant selection cannot mutate B's set. Pending reads and results are generation guarded.
- **CSV import:** preserve RFC 4180 parser, ordered required/optional columns and additive-only import boundary. The summary remains in-place; OnImported occurs only when the user closes after a service outcome. A per-presentation outcome sentinel fixes the documented refresh obligation after an earlier import followed by a malformed retry. It does not invent a completion callback for a retired import.
- **Scripted alarm:** original defaults, annotations, nine-field payload, candidate scripts and create/update semantics are unchanged. No alarm/provider action is performed by the fixture.
- **Virtual tag:** original data types, defaults, annotations and eight-field payload are unchanged. Script creation, shared-script save and virtual-tag save remain separate persistence actions. New script options are appended before selection without mutating the host list. Source/name/usage reads install atomically under a presentation + script-read epoch. Authoritative GetValueAsync, oversize/read-error refusal, diagnostics and reveal remain. Editor identity is stable through Busy/read-only changes and keyed per presented script, so retired blur/marker callbacks cannot rewrite a new document. Shared Monaco support is the accepted `b4f7672d`/`50942b4a` component/JS; runtime byte parity is recorded.
## Verification
`red.log` contains four valid pre-migration dialog-name failures. `contracts-script-first.trx` retains the intermediate script checks (one erroneous submit-button test dispatch and one real missing-Razor-expression defect), both corrected before acceptance. `identity-red.trx`/`identity-red.log` retain both valid queued-event failures before the setter fixes; `identity-first.log` also retains the first untyped-render-callback harness correction. The final `contracts.trx` / `contracts.log` records **50/50**, zero skipped: **24 new** contracts plus **26 existing** stale-open, RFC 4180 CSV, dropdown ordering and Monaco source/analysis contracts. All discovery/execution used the owned private-SQL environment runner; these tests dispatch no SQL collection cases. The runner injects the private owned loopback SQL endpoint and credentials without logging them. No default LAN SQL discovery was used in this checkpoint.
From repository root:
```sh
python3 infra/tools/ui-consistency/with_private_sql.py --state "$OWNED_SQL_STATE" -- dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj --artifacts-path "$PWD/artifacts/ui-theme-uns-modal-tests" --filter 'FullyQualifiedName~UnsModalAccessibilityTests|FullyQualifiedName~ModalStaleOpenGuardTests|FullyQualifiedName~EquipmentCsvParserTests|FullyQualifiedName~VirtualTagScriptDropdownTests|FullyQualifiedName~MonacoInteropSourceTests' --logger 'trx;LogFileName=contracts.trx' --results-directory docs/ui-consistency/evidence/ot13-uns-modals
python3 docs/ui-consistency/evidence/ot13-uns-modals/check-boundaries.py
```
`OWNED_SQL_STATE` must identify the active authorized disposable fixture; do not substitute a shared/default server. Exact executed command is reflected in `contracts.log`; the credential state file is not included. Repo-anchored ignored build artifacts preserve existing legacy source lookup assumptions.
`source-boundaries.json` verifies exact original form-model/default/annotation bodies, payload field order, virtual data types, parser delegation, independent script ordering/read/diagnostic hooks and large-dialog width plus canonical scrollable-body modifier against baseline `a47ffb91`. Source checks supplement actual rendered tests; they do not establish runtime by themselves.
The source-linked owned fixture builds with zero warnings/errors (`canary-build.log`) and exposes only loopback synthetic providers. `browser-results.json` records **12 scenes /284 checks**: all four wrappers at 1440px, 390px and actual browser 200% (720 CSS px, DPR2). The actual RawTree picker is rendered; synthetic selection/write arguments are recorded. It checks dialog names, native label focus, descriptions, Tab scope/outside focus denial, idle Escape/trigger return, busy Escape/close denial, exactly one fake dispatch, A→B replacement, import retry/summary callback timing and no page errors/external network/forbidden operations. Actual Monaco verifies authoritative text, script-only write boundary, readOnly false→true→false with unchanged model URI/draft, keyed document retirement and zero models/editors after close.
`errors-browser.json` adds four phone/real-200% scenes with eight required/numeric invalid states: zero writes, actual focus and error rectangles inside the scrolled body/viewport with one CSS pixel tolerance for fractional scroll/line-box rounding. The original Severity error was 6.70px below the body; exposing its error before returning input focus reduces that to a 0.195px line-box rounding difference, within tolerance. `errors-scroll-before-observation.json` is explicitly a transcribed earlier actual trace because the scratch raw file was overwritten; `errors-scroll-subpixel.json` retains the later exact geometry. `failure-browser.json` adds six scenes proving current service/CSV failures remain visible in footer chrome with Retry/Cancel reachable. Whole viewport `real200-*-viewport.png` screenshots avoid Playwright element clipping coordinates under real tab zoom; earlier element crops and `browser-first-narrow.json` are retained as intermediate observations. The initial narrow default frame was corrected to preserve original modal-lg sizing, and the final matrix was rerun. Whole-viewport review then found the original whole-dialog vertical scrolling could push the title offscreen at real 200%; canonical `modal-dialog-scrollable` now keeps both chrome regions visible while the body scrolls. The before screenshot/matrix are retained and final geometry asserts both header/footer bounds. `runtime-assets.json` proves served dialog/Monaco JS exactly matches current source, including final shared focus commit `071148e9` / SHA256 `7f63bd6c5181d0b70edc2e87e086fab4dfba96adabd7a19737f9b3b4f18296d5`. The main matrix explicitly verifies busy and busy-replacement focus containment. Failure-only probes now await initial modal activation before interacting; an early return-focus observation is summarized separately with limited evidence, and its cause is not certified. The matrix does not claim behavior before adapter activation.
Reproduce with the dedicated `canary/ConfigModalCanary.csproj`, separate ignored `artifacts/ui-uns-canary`, dynamic loopback `--urls http://127.0.0.1:0`, and the observed origin passed to `browser.py`, `errors-browser.py`, `failure-browser.py`, and `capture-real200.py`. Browser zoom uses the existing isolated Chromium extension helper, never CSS zoom or a user browser profile. Fixture-only POST routes release fake completions/replace targets; they are not application APIs. Diagnostics return synthetic empty markers. No real database, fleet, PLC, alarm or script persistence occurs.
## Limits and ownership
This is a bounded Chromium wrapper checkpoint, not full application/authorization/Designer/cross-browser acceptance. Public callback signatures and service authorization ownership remain unchanged. Caller optional Target wiring, GlobalUns/Equipment inner-await refresh/close sequencing and other wrappers remain primary-agent scope. Root owns shared picker disposal guards. The actual renderer does not establish real script analysis correctness; existing analysis/source tests and shared Monaco lifecycle evidence remain separate. The full OT13 task stays open until those independent caller/common gates and final integration checks are accepted. Fixture cleanup is recorded separately after review.