Repository navigation
Extract generic DevFlow WebView tooling with a clean context contract - #655
mattleibow wants to merge 3 commits into
Conversation
Align WebView HTTP, streaming envelopes, and serialized DTOs with the recorded main baseline. Documentation and schemas only; no runtime or behavior changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8f1567da-8dcb-471a-a4e9-b5d96ead549c
Layer functional Blazor readiness and routing over the shared WebView/HybridWebView engine. Remove WebView compatibility aliases, singleton helpers and duplicated readiness/layout surfaces; migrate Client, CLI, MCP, Inspector, samples, tests and feature-specific specs together. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3577cd69-761e-4db5-b2d6-6640a1c3b783
Expert Code Review — PR #655Methodology: 2 independent reviewers (1 failed — reduced coverage, no tiebreaker) with adversarial consensus. Because this PR changes 79 files, reviewers received disjoint batches; surviving batch-local findings were downgraded and marked low confidence. Findings: 2 findings posted as inline comments (2 minor). CI status: 17 checks passed, 1 failed ( Test coverage: The PR includes substantial focused unit, integration, protocol, CLI, Inspector, lifecycle, registry, and WebView contract coverage for the changed surfaces. Native Windows/GTK/WPF runtime and physical-device coverage are not included, as disclosed in the PR description.
|
There was a problem hiding this comment.
Expert Code Review: 2 low-confidence batch-split findings were posted inline. See the lean summary comment for methodology, CI status, and test coverage.
Generated by Expert Code Review (auto) for #655 · copilot · gpt56 · 193.7 AIC · ⌖ 12.6 AIC · ⊞ 37.6K
| var autoId = wv.TryGetProperty("automationId", out var aid) ? aid.GetString() ?? "-" : "-"; | ||
| var elemId = wv.TryGetProperty("elementId", out var eid) ? eid.GetString() ?? "-" : "-"; | ||
| var ready = wv.TryGetProperty("isReady", out var rdy) && rdy.GetBoolean() ? "Yes" : "No"; | ||
| var ready = wv.TryGetProperty("ready", out var rdy) && rdy.GetBoolean() ? "Yes" : "No"; |
There was a problem hiding this comment.
🟢 MINOR — low confidence, single reviewer (batch split)
The updated contract only accepts canonical IDs such as webview-2, but the non-JSON webview webviews table still displays only the numeric registry index. A user who copies the displayed 2 into --context-id gets a rejected selector.
Please expose the response id as a ContextId column (instead of, or alongside, Index) and cover the human-readable output in a CLI test.
|
|
||
| var readyWebViews = webViews | ||
| .Where(webView => webView.IsReady) | ||
| .Where(webView => webView.IsReady && IsActiveCdpWebView(webView, activeWebViews) && blazorHosts.Any(host => |
There was a problem hiding this comment.
🟢 MINOR — low confidence, single reviewer (batch split)
readyWebViews is now restricted to active hosts mapped to captured nodes, but the later unavailable-host branch still compares against all registrations and iterates every unready registration. After navigation leaves an inactive registration behind, it can mark the active host opaque—especially when duplicate AutomationId values correlate the stale registration—so an otherwise complete layout scan is reported incomplete.
Apply the same active/captured-host filter to unavailable registrations, and only use AutomationId fallback when Owner is null, matching the ready-host mapping.
Include context IDs in human-readable CLI listings. Validate only the Inspector CDP source/evaluate target input, reject malformed or removed selectors without downstream dispatch, and preserve omitted/null active-host selection. Cover CLI output and proxy selection boundaries with focused regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3577cd69-761e-4db5-b2d6-6640a1c3b783
|
Although it was a stack... This now still has conflicts 🤷 @mattleibow |
Summary
Implementation layer above schema-only #652, carved from the audited implementation in #651. This PR targets
mattleibow-devflow-schema-corrections; it does not replace or rewrite the schema baseline. Native stack registration and superseding #651 are handled separately by the coordinator.Microsoft.Maui.DevFlow.WebViewpackage: one serialized embedded-JavaScript CDP engine with standard MAUI WebView and HybridWebView native adapters. Blazor references it and adds actual handler capture, rendered#appreadiness andBlazor.navigateTorouting.AddMauiBlazorDevFlowToolsremains a functional adapter registration including generic tools.MauiLabs.slnxand the exact officialDevFlow.slnf. The existing official publish glob already includes it. No new CI workflow or npm dependency/lockfile changes.Breaking changes
Update the agent, CLI, Client, WebView and Blazor packages together, and rebuild older consumers. No WebView-facing compatibility is retained.
webview-<index>IDs throughcontextId(CLI:--context-id). Remove the oldwebviewquery/CLI option and numeric, AutomationId and elementId resolver aliases. Explicit blank selectors are not normalized to the active host.ready, notisReady.hostKinddescribes the hosting context; it is not a native backend or behavior-dispatch switch.includeWebViewElements; removeIncludeBlazorElementsand its fallback. Layout capabilities usewebview/webview-dom, without the former Blazor-only duplicates. DOM element metadata is generic WebView metadata.CdpCommandHandler/CdpReadyCheck, compatibility registration overloads and unguarded unregister,Microsoft.Maui.DevFlow.Blazor.ChobitsuDebugScript, the compatibility-onlyBlazorWebViewDebugServiceBase, base-service DI aliases,ConfigureHandlerwrappers and first-bridge CDP convenience APIs (including the GTK singleton shim). Keep the actual shared engine and functional adapter APIs.netstandard2.0Client support, Driver namespaces/type forwards and native Driver responsibilities remain intact.Fresh verification
The initial expanded live selection passed 52/53: the untouched
UiInspectionTests.HitTest_Response_MatchesDocumentedEnvelopeAddButton-coordinate assertion failed and was reproduced alone. The focused rerun excludes that unrelated assertion. No full-suite-green claim: the original investigation also disclosed two unrelated broad CLI gesture failures (UiGesture_ReportsWhichTierHandledIt,UiGesture_Pinch_SendsScaleToGestureRoute), and the broad CLI suite was not rerun here. No Windows/GTK/WPF native-runtime or physical-device coverage claimed. Mac Catalyst used per-process Xcode 26.6, without global Xcode/lifecycle changes. All owned validation app/Inspector/MCP helpers have been stopped.Spec boundaries
Exactly four feature-specific spec files change above #652:
docs/DevFlow/spec/README.md,openapi.yaml,schemas/webview.json, andexamples/webview-contexts-response.json. Preserve the parent's profiler PascalCase, sensor X/Y/Z, compact log keys, header arrays, HTTP/WS envelopes/events/filters and timestamp-free UI subscriptions. No broad agent-status/UI-tree/device/RFC7807 schema overhaul.