feat(gtk): fx-canvas WebKitWebView sandboxé + protocole postMessage (#27 #41 #44) #161

Merged
charles merged 1 commit from feat/27-41-44-canvas-webview into main 2026-04-06 02:28:39 +00:00
Owner

Résumé

  • #27 / #41CanvasWebViewModel : gestion du cycle de vie d'un WebKitWebView sandboxé pour le widget fx-canvas
  • #44 — Protocole postMessage hôte↔canvas : CanvasMessage, CanvasMessageKind, helpers build_post_message_js() et parse_canvas_message()
  • CanvasSandboxPolicy : politique sandbox configurable (scripts, same-origin, réseau, pointer-lock)

Changements

  • crates/fractal-gtk/src/canvas_webview.rsCanvasWebViewModel, CanvasViewState, CanvasMessage, CanvasSandboxPolicy

Plan de test

  • cargo check -p fractal-gtk passe sans erreur
  • CanvasWebViewModel::load_html(…) → state Loading
  • on_load_finished() → state Ready
  • build_post_message_js(&msg) génère du JS valide appelable dans le WebView
  • parse_canvas_message(raw_json) retourne Some(CanvasMessage) pour un JSON valide

Closes #27, closes #41, closes #44

## Résumé - **#27 / #41** — `CanvasWebViewModel` : gestion du cycle de vie d'un WebKitWebView sandboxé pour le widget `fx-canvas` - **#44** — Protocole postMessage hôte↔canvas : `CanvasMessage`, `CanvasMessageKind`, helpers `build_post_message_js()` et `parse_canvas_message()` - `CanvasSandboxPolicy` : politique sandbox configurable (scripts, same-origin, réseau, pointer-lock) ## Changements - `crates/fractal-gtk/src/canvas_webview.rs` — `CanvasWebViewModel`, `CanvasViewState`, `CanvasMessage`, `CanvasSandboxPolicy` ## Plan de test - [ ] `cargo check -p fractal-gtk` passe sans erreur - [ ] `CanvasWebViewModel::load_html(…)` → state `Loading` - [ ] `on_load_finished()` → state `Ready` - [ ] `build_post_message_js(&msg)` génère du JS valide appelable dans le WebView - [ ] `parse_canvas_message(raw_json)` retourne `Some(CanvasMessage)` pour un JSON valide Closes #27, closes #41, closes #44
feat(gtk): fx-canvas WebKitWebView sandboxé + protocole postMessage (#27 #41 #44)
Some checks failed
CI / cargo check (pull_request) Has been cancelled
CI / cargo test (pull_request) Has been cancelled
CI / clippy + rustfmt (pull_request) Has been cancelled
7c2c52fc58
Sign in to join this conversation.
No description provided.