Testing and troubleshooting
Recorded implementation verification
The preceding implementation delivery recorded the following evidence in TESTING.md and tests/native-smoke-result.json. Documentation generation does not imply that every runtime acceptance test was rerun during this documentation-only update.
| Check | Recorded result | Scope |
|---|---|---|
| Node model/controller suites | 100/100 pass | Model, history, structures/policy, clipboard codecs, source formatting, preview mapping |
| Browser interaction suite | 13/13 pass | Chromium; shortcuts, scroll/caret sync, divider, narrow layout, preview hooks/CSS/isolation and stale results |
| Embedded find UI | Exercised | Ctrl+F, matching, replacement, Escape; no demo chrome |
| .NET build | Zero warnings/errors with configured restore/cache environment | net10.0-windows library and sample; a newer installed SDK compiled the .NET 10 target |
| Native smoke suite | 18 pass | Unicode/CRLF, formatting/history, options queue, search, stale saves, HTML fonts, custom/async preview, cancellation, SQL, read-only |
| NuGet-only consumer | Same 18 native checks pass | Local package restored without loose web assets |
The older browser-checks.html and feature-browser-checks.html fixtures are retained but are not included in the 13 count. This evidence does not cover every exported method or language spelling; the documentation audit identified additional bridge issues listed below.
Run checks
From either project's test-bearing root:
node --test tests/*.test.cjs
From the full project root, serve browser fixtures:
node tools/serve.cjs
Open http://127.0.0.1:8091/tests/interaction-browser-checks.html. The browser fixtures must run in a browser, not just Node; DOM selection, iframe layout and pointer behavior are essential to their purpose.
From the standalone root:
dotnet build CODE.Editor.Standalone.sln
dotnet pack CODE.Editor.WinForms/CODE.Editor.WinForms.csproj -c Release -o packages
After building the sample, pass an absolute, writable JSON output path to run its native smoke mode and close:
dotnet bin/Debug/net10.0-windows/CODE.Editor.Standalone.dll C:/Temp/editor-smoke.json
Create the target directory first if necessary. Native tests require Windows, WebView2 Runtime and the target desktop runtime. Do not infer native functionality from a successful cross-platform model test. Check actual result JSON rather than assuming the process launch means the checks passed.
Acceptance scenarios still needed
- Real IME composition: CJK input, accents/dead keys, mobile prediction, undo after composition, switching focus mid-composition.
- Accessibility: screen-reader reading order and editing; headings/lists/tables; high contrast; focus escape; divider labels.
- Mobile: iOS Safari and Android Chrome with real on-screen keyboards, touch selection, scrolling and viewport changes.
- Cross-application clipboard: Word, Outlook, browsers and spreadsheet tables; mixed HTML/text/image items; real paste/drop gestures.
- Photino: actual bridge callbacks, lifecycle, image transport, native web engines and platform differences.
- Document corpus: real Olympus notes, long SQL lines, nested lists, table escaping, unsupported HTML, malformed Markdown, mixed line endings and Unicode boundaries.
- Deployment: clean Windows machine, package-only consumer, chosen architecture/runtime, writable profile/assets, offline startup and controlled failure recovery.
Troubleshooting
| Symptom | Likely cause / action |
|---|---|
| Blank or noneditable browser area | Check script order, load advanced.js, verify element dimensions and browser console |
| Surface exists but no preview | Provide iframe, call setPreviewVisible(true), and size sibling panes correctly |
| Images not visible though URL is saved | Check image origins/CSP and whether the URL is reachable in this host |
| Paste/drop image reports missing handler | Supply onImageImport or ImageImportRequested Result task |
| Save blocked by images | Inspect pending/failed items; retry or remove before snapshot |
| Save blocked after Preserve import | Preserve retains unsupported source but diagnostics still prevent validated save |
| “Finish composition” error | Wait for native text composition to commit; do not force a view/load during it |
| EditorText differs from very recent editing | It is a synchronous cache; await committed retrieval/snapshot and handle unresolved content |
| Setting a property did not take effect | Await queue/error handling; invalid browser-side configuration can leave desired and accepted state different |
| Source SQL/JS edits are being parsed as Markdown | Choose PlainText storage as well as source language |
| Native JavaScript comment toggle is a no-op | Known JavaScript enum wire-casing mismatch in this preview version |
| ReplaceRangeAsync rejects even without edits | Pass snapshot.Revision explicitly; current optional null is forwarded as an invalid guard |
| Preview hook changes are missing | Assign async Result synchronously, or return a Promise in JS; call RefreshPreview when only external data/hook changed |
| Old async preview appears to finish late | Obsolete results are ignored; ensure host cancellation is honored to avoid wasted work |
| Preview CSS cannot load a font/stylesheet | CSP intentionally blocks arbitrary remote resources; use stylesheet text and available fonts |
| Custom preview does not align line-for-line | Changed/custom output has proportional following, not a source map |
| Font selection changes the wrong thing | Distinguish DisplayFontFamily from SetContentFontAsync |
| Ctrl+F does nothing in custom web host | Bare component emits shortcut; host must provide find UI |
| Ctrl+G has no native popup | Implement host dialog and call GoToLineAsync |
| Search Replace All unavailable in Visual | Current implementation is Source-only |
| Selection/bookmark fails after load | Loads invalidate history/bookmarks; obtain new state |
| WebView2 initialization fails | Verify runtime/dependencies/profile directory and capture EditorError |
| WindowsBase reference-conflict build warning in a WinForms-only consumer | WebView2's transitive package also adds its WPF assembly; use the targeted unused-WPF-reference removal shown in the WinForms quick start |
| Unexpected native browser failure | Save/recover from application state and recreate control; automatic crash recovery is not implemented |
Reporting a reproducible problem
Capture the package/source revision, host/browser/runtime, format/view/language, effective policy, minimal input string, exact keystrokes/commands, and expected versus actual result. Include revision/session and diagnostics where relevant. Remove private document contents from shared logs.
Use the smallest fixture that exercises the real boundary. A pure model problem belongs in Node tests; selection/IME/scroll bugs need browser interaction; .NET queue/enum/event bugs need bridge/native coverage. Do not replace real input acceptance with tests that merely restate a helper's implementation.
Documentation checks
The manual is split into a main index and 18 topic files. Its publication check validates local links, code fences, expected files, and coverage of public C# API names. Representative executable code examples are checked separately from signature-only reference blocks. Runtime results above remain labeled as recorded implementation evidence, not inflated by documentation lint checks.