diff --git a/Plans/08 WebKit engine/S044-engine-seam.md b/Plans/08 WebKit engine/S044-engine-seam.md index 5474fa3..d655594 100644 --- a/Plans/08 WebKit engine/S044-engine-seam.md +++ b/Plans/08 WebKit engine/S044-engine-seam.md @@ -15,12 +15,12 @@ The app still builds and runs on Servo at the end of this plan. ## Steps - [x] Move `privacy_headers`, `strip_tracking`, the Firefox-style language list and third-party matching (from `hub.rs` / `net::nacre` callers) into `src/net/privacy.rs` with their unit tests (`privacy_language_list_is_firefox_style`, `privacy_headers_follow_the_settings_and_reach_requests`, `third_party_matching_keeps_same_site_subdomains`); Servo code calls the new module. - [x] Move `HubConfig` and the request decision (HTTPS-only upgrade, tracking strip, image permission, ad-block verdict → `Decision` enum with Block/Replace/Redirect/Allow) out of `Hub::decide` into an engine-neutral `fn decide(cfg, req) -> Decision` (pure, unit-tested); `load_web_resource` becomes a thin adapter. -- [ ] Give tabs a Nacre-owned view id (`ViewId(u64)`, reuse `new_tab_id`) and make `hub::Event` carry it instead of `WebViewId`; one map `WebViewId → ViewId` lives in the Servo glue only. -- [ ] Replace Servo payload types in `Event` and `tabs.rs` (`LoadStatus`, `JSValue`, `ContextMenu`, `EmbedderControl`, `PermissionRequest`, `ConsoleLogLevel`, …) by small Nacre enums/structs (`LoadState`, `JsValue` = `serde_json::Value`, `PageMenuRequest`, `Control`, `PermissionAsk`, …) holding a glue-side handle (boxed responder closure) where Servo needs an answer object. -- [ ] Port `selftest.rs` JS-result matches and `fakeload` to the neutral types. -- [ ] `nice cargo build --release -j 2` green; `nice cargo test --release -j 2` green (new tests counted). -- [ ] Smoke on Servo still green: `tools/smoke.sh tests/smoke/launch.txt`, `basics.txt`, `input.txt` (hidden). -- [ ] PROGRESS entry, INDEX line, tracker, commit `S044: …`, push. +- [ ] Give tabs a Nacre-owned view id (`ViewId(u64)`, reuse `new_tab_id`) and make `hub::Event` carry it instead of `WebViewId`; one map `WebViewId → ViewId` lives in the Servo glue only. — moved to S045 (orchestrator, 2026-11-13, D-041) +- [ ] Replace Servo payload types in `Event` and `tabs.rs` (`LoadStatus`, `JSValue`, `ContextMenu`, `EmbedderControl`, `PermissionRequest`, `ConsoleLogLevel`, …) by small Nacre enums/structs (`LoadState`, `JsValue` = `serde_json::Value`, `PageMenuRequest`, `Control`, `PermissionAsk`, …) holding a glue-side handle (boxed responder closure) where Servo needs an answer object. — moved to S045 (orchestrator, 2026-11-13, D-041) +- [ ] Port `selftest.rs` JS-result matches and `fakeload` to the neutral types. — moved to S045 (orchestrator, 2026-11-13, D-041) +- [x] `nice cargo build --release -j 2` green; `nice cargo test --release -j 2` green (new tests counted). +- [x] Smoke on Servo still green: `tools/smoke.sh tests/smoke/launch.txt`, `basics.txt`, `input.txt` (hidden). +- [x] PROGRESS entry, INDEX line, tracker, commit `S044: …`, push. ## WIP — stopped here (2026-11-13, context limit of the spike session) - Done (boxes 1–2): `src/net/privacy.rs` (privacy headers, tracking strip, language list + tests), `src/net/policy.rs` diff --git a/Plans/08 WebKit engine/S045-gtk-host.md b/Plans/08 WebKit engine/S045-gtk-host.md index 7e58409..05735bc 100644 --- a/Plans/08 WebKit engine/S045-gtk-host.md +++ b/Plans/08 WebKit engine/S045-gtk-host.md @@ -1,6 +1,6 @@ # S045 — GTK 4 host with the egui overlay; WebKitGTK views; Servo out of the build -> Category 08 WebKit engine · Model: Opus · Effort: high · Depends on: S044 · Size: L · Human: no · **cargo** (main target/) +> Category 08 WebKit engine · Model: Opus · Effort: high · Depends on: S044 · Size: L (+ S044 boxes 3–5) · Human: no · **cargo** (main target/) > Files touched: Cargo.toml, build.rs, src/main.rs, src/app.rs, src/window.rs, src/hub.rs → src/engine/{mod,view,host}.rs, src/egui_area.rs (new, from the spike), src/keys.rs, src/tabs.rs, src/ui/mod.rs, src/actions.rs (load/back/forward/reload/stop/close) ## Goal @@ -14,6 +14,8 @@ egui's page rect }, EguiArea }`, today's egui Material You chrome drawn unchange - `src/app.rs` (event loop parts: `App::new`, `spin`, `start_servo`, `open_window`, `draw`, `ApplicationHandler` impl, `window_input`), `src/window.rs`, `src/keys.rs` header. ## Steps +- [ ] (from S044, D-041) Nacre-owned view id: `ViewId(u64)` (reuse `new_tab_id`) on every tab; the engine `Event` enum carries it; the `WebView ↔ ViewId` map lives only in `src/engine/`. +- [ ] (from S044, D-041) Engine-neutral payloads in `Event`/`tabs.rs` defined on WebKit: `LoadState`, `JsValue` = `serde_json::Value`, `PageMenuRequest`, `Control`, `PermissionAsk`, console level, each holding the WebKit request object (or a boxed responder) the answer needs; port `selftest.rs` JS-result matches and `fakeload` to them. - [ ] Cargo: drop `servo`, `servo-net`, `content-security-policy`, the `media` feature, `[patch.crates-io]` Servo entries, `winit`, `egui-winit`, `gilrs` (WebKit reads gamepads), the gst-mse rpath in `build.rs`; add `gtk4 =0.11.5` (v4_20), `webkit6 =0.6.1` (v2_52) as in the spike. Keep `vendor/` on disk (S053 deletes it). Keep `vendor/epaint` patch until S053 re-checks text. - [ ] `src/egui_area.rs` from the spike (GLArea, `contains()` pick rule, input controllers, IME with `set_client_widget`, repaint timer); add clipboard (gdk clipboard ↔ egui copy/cut/paste), cursor icon from egui output, HiDPI scale, window focus/theme events. - [ ] `src/engine/`: per-profile `NetworkSession` + `WebContext` (persistent dirs from `paths.rs`, ephemeral for incognito), `Settings`, one `WebView` per tab, signals → the S044 `Event` surface (uri, title, mouse-target → status, load-changed + estimated progress, favicon, back-forward list, close, web-process-terminated → crash page). diff --git a/Plans/INDEX.md b/Plans/INDEX.md index a6110ba..0fff2c8 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -7,7 +7,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h Engine switch to WebKit (D-032): new category `08 WebKit engine` comes first; Servo-only plans are struck out. ## 08 WebKit engine -- [ ] [S044 — Engine seam: pure logic out of the Servo files](08%20WebKit%20engine/S044-engine-seam.md) · Opus medium +- [x] [S044 — Engine seam: pure logic out of the Servo files](08%20WebKit%20engine/S044-engine-seam.md) · Opus medium - [ ] [S045 — GTK 4 host with the egui overlay; WebKitGTK views; Servo out of the build](08%20WebKit%20engine/S045-gtk-host.md) · Opus high - [ ] [S046 — Smoke harness and selftest on the GTK host (hidden nested niri)](08%20WebKit%20engine/S046-smoke-harness.md) · Opus medium - [ ] [S047 — Page scripts, page messages, find and JS on WebKit](08%20WebKit%20engine/S047-page-channel.md) · Opus medium diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index ea7b5f2..dcbd7d4 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -44,3 +44,4 @@ - D-038 — 2026-11-13 — Profile folder `nacre-servo` → `nacre-browser` (config, data, cache): on first start, if `nacre-browser` is missing and `nacre-servo` exists, it is renamed (one move, logged); Servo-only engine files inside are deleted after the move. `~/.config/nacre` belongs to the Python Nacre and is never touched (the importer reads it). — engine name out of the path; `nacre` is taken by the original — S051 - D-039 — 2026-11-13 — Media on WebKit: Nacre's page-script media probe (`inject.rs` `media.*`, mediaSession hook) stays the one source for the new tab card, Discord and MPRIS; WebKit's `is-playing-audio` and `set_is_muted` replace the mute script. If WebKitGTK publishes its own MPRIS player it is not left as a second player (turned off or Nacre's skipped, whichever the plan finds possible; one player only). — one engine-neutral source already feeds three features — S051, S013 - D-040 — 2026-11-13 — WebKit tuning defaults (D-032 data, `docs/engine/tune/`): page cache off, memory pressure limit 500 MB per web process, cache model `DocumentViewer`, hardware acceleration policy default (on demand; `never` broke JS checks), related views only for pop-ups. Env overrides for tests (`NACRE_WK_PAGE_CACHE`, `NACRE_WK_MEM_LIMIT`, `NACRE_WK_CACHE_MODEL`, `NACRE_WK_HW`). — lowest PSS/VRAM in the tune runs without failed sites — S052 +- D-041 — 2026-11-13 — S044 boxes 3–5 (Nacre `ViewId`, engine-neutral `Event` payload types, selftest on them) move to S045 and are defined directly on WebKit; S044 closes with the privacy/policy move. — converting 56 Servo payload uses and 14 `WebViewId` sites now would only add Servo adapters that S045/S048 delete — orchestrator, 2026-11-13 — S044, S045 diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 9786cbb..21e0b66 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -350,6 +350,12 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor - Plans `08 WebKit engine` S044–S055 written, in INDEX before the other open plans, tracker seeded. - Not proven: GPU/dmabuf path and 60 fps under the overlay (needs a visible run), Web Inspector, full screen, file chooser, HiDPI. +## S044 — Engine seam: privacy rules and request policy out of hub.rs (2026-11-13) +- Done: `src/net/privacy.rs` (privacy headers, tracking strip, Firefox-style language list + tests), `src/net/policy.rs` (`HubConfig`, `Request`, `Outcome`, pure `decide()` + 4 tests); `Hub::decide` is a thin Servo adapter (`Outcome`, since `Decision` is taken by `store::permissions`). +- Kept in `hub.rs`: the third-party/site test and header-append test (they test vendored servo-net; WebKit's cookie policy replaces them). +- Verified: release build green, `cargo test` 74 green (was 70), smokes launch, basics, input, net-adblock, net-privacy exit 0 (hidden, Servo). +- Not done here: boxes 3–5 (ViewId, neutral payload types, selftest) moved to S045 (D-041). + ## Later - Turnstile widget paints as a black half-disc (Servo painting of its iframe/shadow DOM, S006 site doctor). - Google sign-in past the email step: press Next with a real account, by the user (S006).