8.1 KiB
OT13 simple modal wrappers
This slice owns only Shared/Raw/RawNameDialog.razor, RawDriverTypeDialog.razor, RawStubModal.razor, Shared/Uns/AreaModal.razor, LineModal.razor, new Pages/SimpleModalAccessibilityTests.cs and its own fixture/evidence. It consumes the existing tested ModalFrame and otDialog adapter. Neither shared source, RawTree, GlobalUns, another wrapper, nor an operational service implementation is changed.
Behavior and retained contracts
All five wrappers use ModalFrame's name, safe focus, current-generation native events, single-active overlay, background isolation and disposal. Cancel/Close is marked for initial focus. Input IDs, visible labels and existing help/error descriptions are unique per instance. Numeric/domain choices, RawPaths validation, the complete13-entry driver type table, default Modbus type, every bound model expression, all Area/Line fields and data annotation constraints remain unchanged. source-guard.json records the comparisons and exact served shared-dialog JS hash.
RawName/RawDriver copy the validated typed submission before awaiting the original callback, retain submit-then-self-close order, and capture the rendered callbacks. Local generations reject old queued events and suppress an old completion's close after replacement/disposal. Optional nonconfidential Target supports different underlying targets with identical captions/values. Busy prevents repeated submit, Enter submission, Cancel and header/Escape close; the body fieldset disables actual inputs. A dispatched operation continues independently. The per-component single-flight guard lasts until it returns, including if a new target is presented; the newer draft stays intact and becomes editable afterward. Area/Line also guard an awaiting parent Cancel callback as a pending presentation action, so footer/header/Escape cannot double-dispatch it. Two deterministic delayed-cancel cases first failed, then passed after the local guard.
Area/Line preserve OnValidSubmit and original create/update service argument meaning. Detached scalar form snapshots and copied optimistic row versions are captured before the first await. Success callbacks/errors apply only to the same still-visible generation. Draft initialization occurs on reopen/target change, preserving typing across unrelated option-label/parent renders. Existing DTO identity, IsNew, parent scope and optional Target define that presentation; this does not change cluster/parent scoping, validation, service authorization or persistence. Their submit buttons remain outside the form body in ModalFrame's footer and refer to the unique actual EditForm ID through native form; actual invalid/valid browser submissions exercise this relationship.
RawStub remains the existing shared message surface with the same body/target context and parent-owned close; it receives no submit operation.
Meaningful tests
Initial five name contracts, Area draft retention and RawName busy contract: 7 valid failures before production edits. Initial test-authoring compilation issues (removed bUnit interface, nullable AngleSharp ID) were corrected before that valid red; raw logs remain. No baseline bypass, skip, removed assertion or framework change.
New tests total17: the five wrappers twice in a render for resolved names/unique IDs/safe cancellation; Area unrelated-render draft; delayed RawName target replacement; four delayed Area/Line success/failure cases; typed driver snapshot/callback replacement; actual component disposal during submitted name callback. Delayed cases retain old target/scalars/notes/row-version bytes, reject double save/Cancel, and do not invoke a newer target's callback, show its old error, or close/reset it. Disposal preserves the already dispatched caller action and suppresses stale close. Waits use xUnit v3 cancellation plus bounded entry deadlines.
49/49 aggregate pass, zero skips: SimpleModalAccessibilityTests, existing ModalAccessibilityTests, RawDriverTypeDialog coverage/parity and DeleteConfirmRenderTests.
dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj --artifacts-path /tmp/ot-simple-modal-artifacts --filter 'FullyQualifiedName~SimpleModalAccessibilityTests|FullyQualifiedName~ModalAccessibilityTests|FullyQualifiedName~RawDriverTypeDialog|FullyQualifiedName~DeleteConfirmRenderTests'
logs/green-final.log is final. One added disposal test initially disposed only bUnit's rendered handle; corrected it to DisposeComponentsAsync, which invokes Blazor component disposal (as the existing shared lifecycle tests do). This was a harness correction, not a product lifecycle workaround; its raw failure remains. Full suite belongs to coordinated integration freeze and is not claimed here.
Actual native acceptance
Own loopback fixture58846 compiles the actual five wrappers and shared adapter, with a strict route/type allowlist. It registers Razor plus an operation-refusing synthetic UNS proxy; only fake CreateArea/CreateLine return delayed in-memory results. Raw callbacks only increment a fixture counter. No SQL/driver/gateway/provider/client, operational action endpoint or live credentials exist. HTTP provenance and byte-identical shared script are verified before acceptance. The fixture is not a replacement for a real deployment/identity/provider gate.
15 actual Chromium scenes /186 assertions: five wrappers at1440,390 and real200% zoom (720px layout viewport/DPR2). Each verifies resolved dialog name, Cancel/Close initial focus, outside focus denial, ten scoped Tab steps, every visible label's actual focus and resolved descriptions, idle Escape/trigger return. All four editors also verify invalid submission dispatches nothing, valid submission disables body controls, busy Escape/Cancel/header cannot dismiss the operation, exactly one synthetic callback completes and focus returns. Area/Line additionally await a delayed synthetic Cancel and verify exactly one callback while Escape is pressed during the wait. Message Close dispatches nothing. No document overflow or page errors.
browser.py, browser-results.json and15 modal screenshots retain checks. Script imports ignitionoee's existing loopback-only real zoom helper; this explicit harness dependency does not affect production. First browser harness treated fieldset as a Playwright disabled-matchable control. It has a disabled property but that matcher reported enabled; corrected proof checks native fieldset.disabled AND the effective disabled state of every body input/select/textarea. Raw initial log remains. No production workaround was applied.
Caller integration and limits
RawTree/GlobalUns integration remains the primary agent's scope. RawName/RawDriver still invoke submit before self-close: a follow-up warning/message must be queued until the originating overlay has deactivated. Single-active ModalFrame deliberately rejects simultaneous overlays. RawDriver should receive explicit Target if its caller switches parent/folder context without a hide/reopen; RawName and message also offer Target when displayed values are identical. These sequencing notes were sent directly to the caller owner; this slice does not claim those caller flows accepted from isolated wrappers.
A final two-case regression exposed that an edit without a loaded Existing DTO could otherwise fall back to an empty copied row version. A minimal pre-dispatch guard now refuses that invalid presentation, retaining the prior no-service-dispatch boundary; two valid red cases then pass. No create or loaded-edit payload meaning changes. A fresh final-source fixture build then passed a narrow additional32native assertions on the two affected wrappers at390px (browser-final-target-guard.json); the full15scene matrix remains separately retained. Callback/service exceptions continue to propagate to the existing route error boundary; there is no new generic stale-exception guarantee.
No real operation was performed or cancelled. No shared ledger/gate edit. Parent and primary peer review accepted the bounded wrapper contracts and caller limits; only these five sources, own test and evidence are committed. The owned fixture is stopped after the commit without touching another agent's fixture.