2026 02 17_egl_embedder_extension_plan - mark-ik/graphshell GitHub Wiki
Rationale for deferral: The Cross-Platform Sync and Extension Plan (2026-02-20) prioritizes thin mobile clients and browser extensions over native EGL enhancements. Single-window EGL model is adequate for sync client use cases. This plan remains referenceable if Android native support is desired later, particularly for semantic event convergence (Phase 2) and host/vsync contract clarification (Phase 3).
ports/graphshell/egl/app.rsports/graphshell/window.rsports/graphshell/running_app_state.rs- any EGL host bindings that consume the
AppAPI
Out of scope for this phase:
- true multi-window EGL runtime,
- webview accessibility bridge (blocked on Servo API surface),
- platform-specific rendering backend rewrites.
- EGL is single-window by design.
- EGL navigation commands already target explicit webviews directly (
load_uri,reload,go_back,go_forward). - Vsync ownership is platform-host driven, forwarded into
VsyncRefreshDriver.
- Preserve single-window runtime initially; design APIs to become multi-window capable later.
- Keep semantic mutation in
GraphIntentapplication boundary. - Keep webview create/destroy in reconciliation/effect layers.
- Prefer incremental convergence with desktop runtime behavior over large embedder rewrites.
- Introduce explicit window handle abstraction in EGL
Appinternals even if only one instance exists. - Remove single-window assumptions from helper naming (
window()style APIs) where practical. - Ensure all navigation methods resolve via explicit webview identity, not implicit globals.
Acceptance:
- no new global-targeting command queue paths are introduced,
- EGL still compiles/runs unchanged for one-window hosts.
- Ensure EGL consumes the same delegate semantic events as desktop (
UrlChanged,HistoryChanged,TitleChanged,CreateNewWebView,WebViewCrashed). - Keep event ordering semantics consistent with desktop reducer assumptions.
- Add EGL-specific tests for semantic event to intent conversion and lifecycle transitions.
Acceptance:
- traversal semantics rely on
history_changedindex/list callbacks, - crash handling follows the same demote/unmap/reopen model as desktop.
- Define a host-facing contract for vsync delivery cadence and repaint guarantees.
- Keep current host-driven vsync mechanism unless instrumentation shows correctness/perf issues.
- If migration is needed, move vsync notification ownership behind a single interface boundary first, then switch implementation.
Acceptance:
- no frame starvation under normal host cadence,
- no duplicate repaint loops introduced by embedder glue.
- Add window collection semantics in EGL state (
id -> EmbeddedPlatformWindow) without changing host behavior by default. - Gate multi-window via explicit capability/feature flag.
- Validate focus, input routing, and close semantics per window.
Acceptance:
- single-window hosts remain unaffected,
- multi-window mode does not regress navigation targeting.
-
Risk: divergence between desktop and EGL control-plane behavior.
Mitigation: share event/intents invariants and reducer tests. -
Risk: premature multi-window expansion increases embedder instability.
Mitigation: defer multi-window until Phase 1-3 are stable. -
Risk: vsync ownership churn introduces jitter/regressions.
Mitigation: keep current mechanism as baseline; migrate only with testable win.
- Navigation: direct load/back/forward/reload target correctness.
- Delegate ordering: redirect, SPA pushState, hash change, back/forward burst.
- Lifecycle: node promote/demote with reconciliation.
- Crash behavior: callback handling, node remains, reopen succeeds.
- Repaint cadence: host-driven vsync under steady interaction.
- EGL extension work is tracked as phased tasks rather than TODO stubs.
- No contradiction with architecture-and-navigation control-plane rules.
- Single-window behavior remains stable while multi-window path is clearly prepared.