63 lines
12 KiB
Markdown
63 lines
12 KiB
Markdown
# Script Edit page checkpoint
|
|
|
|
Scope: actual `Components/Pages/ScriptEdit.razor`, new `Pages/ScriptEditLifecycleTests.cs`, and this synthetic fixture/evidence. The Script editor source-wiring method in `Uns/DeleteConfirmationWiringTests.cs` changes only its two captured-callback expectations; the Equipment method is another worker's change. The shared file is reserved for the coordinator's integration commit. No Scripts list, shared Monaco/JS, schema, package, endpoint, policy or production-host change is included.
|
|
|
|
## Behavior
|
|
|
|
- Name and disabled ScriptId labels have unique per-instance associations. Monaco receives `Script source code` as its actual internal editor name.
|
|
- Parameters are loaded by captured route identity, rather than only on first initialization. New/existing/not-found/loading/current-error states remain distinct. Retired load success/failure cannot replace the new route. Each presentation owns a keyed EditForm/editor and generation-bound source, name, markers and diagnostic-selection callbacks.
|
|
- Save admits one operation, captures originating identity, Name, editor and cloned RowVersion before its first await, obtains authoritative current Monaco text before validation, then keeps that detached payload through database context/query/save awaits. Read failure or required-field failure prevents a write. Input fieldset/Monaco are busy read-only. Queued field callbacks cannot change reviewed payload. A replacement route/disposal retires pre-dispatch work; already-dispatched work completes without navigating or changing its successor's state.
|
|
- Delete captures identity/RowVersion/message when review opens. Captured visibility/confirm callbacks include presentation and confirmation epoch, including Cancel/reopen of the same script. Busy save/delete is single-flight. An already-dispatched A delete can commit, but cannot close B's review or display A's outcome there.
|
|
- The existing `ConfigEditor` attribute, both routes, system-generated `SC-` +12 hex identifier, `CSharp` language, SHA-256 UTF-8 SourceHash, Required validation model, optimistic-concurrency OriginalValue assignments and current failure wording are retained. `source-guard.json` verifies the original hash/form-model suffix is byte-identical. No query order/schema/foreign-key policy changes were made.
|
|
|
|
## Managed tests
|
|
|
|
Final checkpoint: **153 passed, zero failed/skipped** (`acceptance-checkpoint.trx`), comprising **19 new cases and 134 existing cases** covering compiler diagnostics/completions/formatting/cancellation/catalog, Monaco naming/read-only/creation/disposal/sync/bounds/problems, script source/list queries, and the Script editor delete wiring method.
|
|
|
|
New behavior checks cover associated fields/editor name; reused route/new route; pending authoritative read retarget/dispose; single-flight queued Save and captured Name despite an actual retained InputText ValueChanged callback; SourceHash/current source; required source validation; old delete confirmation/reopen/current delete; deferred initial load success/failure; already-dispatched Save success/failure into B; generated identity/language/hash; editor read failure; retained editor blur into B; Save/Delete concurrency exceptions with captured OriginalValue; and actual rendered delete footer click with deferred commit success/failure into a new B confirmation.
|
|
|
|
All test commands used the private SQL wrapper even though these new fixtures use EF InMemory. The wrapper's private state was not read or printed. The relevant invocation was run from the repository root:
|
|
|
|
```text
|
|
python3 infra/tools/ui-consistency/with_private_sql.py --state [coordinator-owned private SQL state path] -- dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj -c Debug --artifacts-path artifacts/ot13-script-edit --filter 'FullyQualifiedName~ScriptEditLifecycleTests|FullyQualifiedName~Script_editor_delete_confirms|FullyQualifiedName~ScriptAnalysis|FullyQualifiedName~ScriptSourceServiceTests|FullyQualifiedName~ScriptListQueriesTests' --logger 'trx;LogFileName=acceptance-checkpoint.trx' --results-directory docs/ui-consistency/evidence/ot13-script-edit
|
|
```
|
|
|
|
The new InMemory tests exercise real EF entity changes and an interceptor holds/throws at actual SaveChangesAsync boundaries. They do not certify SQL Server rowversion generation, foreign-key enforcement or production data. No real backend/actor write occurs.
|
|
|
|
### Retained red and harness evidence
|
|
|
|
- `red.log`: initial test compilation used removed bUnit `SetParametersAndRender` and a blocking callback call; corrected to the already pinned `Render` API/await without package upgrades or analyzer suppression. Not a behavioral red.
|
|
- `red-valid.trx`: six meaningful ScriptEdit behavior/API reds and one selector harness failure; all 71 previously approved Driver panel cases passed in the same combined invocation. Failures showed unassociated labels, stale route model, A authoritative read writing B, duplicate Save reads, post-disposal Save, and ambient stale delete action deleting B.
|
|
- The seventh initial failure expected a default ValidationSummary CSS class despite the existing explicit class override. Corrected to `.alert`; `validation-baseline.trx` passed on unchanged production source, proving Required authoritative source validation already worked.
|
|
- `green-first.trx`: 6/7 passed; delete test used loose JS's false default for `otDialog.activate`, which correctly rejected/closed the synthetic dialog. `delete-debug*` retained that investigation; explicitly accepting activation fixed the fixture. Temporary diagnostic code was removed; no product change resulted from this harness correction.
|
|
- `green-contracts.trx`: 17/17 (14 new +3 then-current shared wiring tests). `acceptance.trx`: 149/150, sole failure was the independently migrating Equipment source-wiring literal. The final filter isolates Script editor's wiring method; it does not skip or weaken that test. `acceptance-final.trx` 151 and `acceptance-checkpoint.trx`153 are subsequent expanded green coverage.
|
|
|
|
## Actual browser
|
|
|
|
Owned hosts were OS-assigned loopback `http://127.0.0.1:58699`, then `:59629`, then final `:59746`; earlier instances were stopped before replacement. `canary/Program.cs` registers the actual ScriptEdit component, vendored Monaco and **real Roslyn ScriptAnalysisService**, with synthetic Designer claims and actual ConfigEditor policy, EF InMemory rows and gated synthetic writes. The fixture subscribes to NavigationManager.LocationChanged so a successful `/scripts` navigation renders the destination and disposes the editor, as production routing does. Tag-catalog equipment completion is intentionally absent; no runtime, rig, live SQL, LDAP, secret or deployment connection is registered. `canary-build-fixed.log` records zero warnings/errors; initial fixture quote escaping compiler failures are separately retained in `canary-build.log`.
|
|
|
|
Final `native-acceptance.json`: **six functional scenes, 72 assertions passed** across 1440px, 390px and real Chrome 200% (`chrome.tabs.setZoom`, not CSS scaling). Each width exercises failure→explicit recovery and pending A Save→B retarget. Checks cover actual internal named editor, disabled ID association, safe initial Delete Cancel focus, Escape/trigger restoration, captured script review, no delete on cancellation, same editor model across busy transitions, native keyboard repeats/no duplicate dispatch, fresh keyed B model, detached A Name/source/hash, B unaffected by late completion, no document horizontal overflow and reachable Save by ordinary vertical page scroll. Screenshots use viewport capture; narrow/zoom pages remain vertically scrollable. Default Monaco hidden IME textarea is not its accessible textbox; the browser readiness/locator follows the actual `role=textbox` element and waits for vendored CSS before actions.
|
|
|
|
Served bytes match the existing frozen modules:
|
|
|
|
- `dialog-focus.js`: `7f63bd6c5181d0b70edc2e87e086fab4dfba96adabd7a19737f9b3b4f18296d5`
|
|
- `monaco-init.js`: `5255c44ea485249318da7c28b09923333ae133cb55a9a9d2dc53f5d681881d49`
|
|
|
|
Initial native harness failures remain in `browser-harness-aria.json` (looked for the hidden IME textarea's label, instead of Monaco's real contenteditable textbox) and `browser-harness-alerts.json` (unscoped alert locator also matched Monaco's empty live regions). These are not product defects. `browser-five-of-six.json` retains the subsequent actual runtime issue before its documented disposition.
|
|
|
|
### Explicit Monaco runtime limitation
|
|
|
|
Four final accepted scene records have zero page errors. Two retarget scenes (phone and real 200%) pass every product/functional check but emit a vendored **`Canceled` page error** during old editor teardown. `browser-cancellation-probe.json` reproduces it and retains the full stack: `pr.cancel → pr.dispose → fN.clear/dispose → Yu.dispose/_m.dispose` within `editor.api-CalNCsUg.js`. Read-only source inspection identifies the pending `editor.contrib.wordHighlighter` delayer being rejected during disposal. This is separate from authoritatively persisted text, database results, Blazor callbacks and our diagnostics fetch handling.
|
|
|
|
The coordinator explicitly accepted documenting this bounded upstream/runtime limitation. No global error suppression, vendored patch, dependency upgrade or feature disabling was applied. The final browser assertion distinguishes **no unclassified errors** from **zero errors**; raw error objects/stacks and per-scene `zeroPageErrors` are retained. Six passing functional scenes must not be described as six error-free scenes. The earlier complete checkpoint had five error-free scenes; the final bounded retarget evidence observed the same known cancellation at real 200% as well as phone.
|
|
|
|
### Destination fidelity correction
|
|
|
|
Initial screenshots after successful Save exposed the direct-mounted fixture keeping ScriptEdit alive at `/scripts` while enhanced navigation reconciled away loader-injected editor CSS. This was a synthetic host/router mismatch, not a production change: production goes to the Scripts list. The fixture now observes LocationChanged and renders an explicit returned-to-Scripts destination, retiring ScriptEdit. Initial destination probe (`browser-navigation-final.json`) retained 3/6 because the first correction did not subscribe to location changes. `browser-navigation-confirmation.json`/`browser-navigation-confirmed.json` then used an overbroad `.monaco-editor` count that also found Monaco's process-level measuring/helper DOM. Final `browser-destination-final.json` verifies the actual owning `.monaco-editor-host` is removed **and `monaco.editor.getEditors().length === 0`**, with 3/3 affected destination scenes passing and no page errors. The unchanged non-navigation retarget scenes were already 3/3 in `browser-navigation-final.json`, with stylesheet retention explicitly verified. `native-acceptance.json` combines these exact six scene records/origins and does not imply a fresh full single-origin run. Intermediate records are retained; no application source changed for these harness corrections.
|
|
|
|
No VoiceOver/speech-output testing is claimed or required; the user explicitly excluded it. Automated accessibility, native keyboard and visual/reflow checks remain in scope.
|
|
|
|
## Review and cleanup
|
|
|
|
Coordinator approved the source/unit/native checkpoint: 153 managed passes and all six functional scenes/72 assertions, with the two documented vendored cancellation records explicitly retained. The shared wiring file must be committed by the coordinator. All three owned loopback origins (58699,59629,59746) are confirmed stopped in shutdown.json; SIGINT was sent only to each verified owned ScriptEditCanary process. No production process was involved.
|