diff --git a/CLAUDE.md b/CLAUDE.md index ce0f3b9..af5bb15 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # Nacre -Nacre is a web browser written from scratch in Rust on the Servo 0.7 engine, with an egui UI, meant to replace the Python/QtWebEngine Nacre as the user's daily browser. Final deliverable: Linux (AppImage, tar.gz) and Windows (Inno Setup installer, portable zip) builds of the browser, published through the `releases/` folder to the user's Forgejo (astar76/Nacre). Vision: [PLAN.md](PLAN.md). +Nacre is a web browser written from scratch in Rust with an egui UI, **switching from the Servo 0.7 engine to a tuned WebKit (D-032; Linux only)**, meant to replace the Python/QtWebEngine Nacre as the user's daily browser. Final deliverable: Linux (AppImage, tar.gz) builds of the browser, published through the `releases/` folder to the user's Forgejo (astar76/Nacre). Vision: [PLAN.md](PLAN.md). ## 0. Session rules — read first @@ -35,6 +35,8 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl ## 2. Facts +- **Engine switch in progress (D-032)**: the Servo facts below describe today's code until the `08 WebKit engine` plans replace it. Engine test and WebKit tuning data: `docs/engine/engine-comparison.md`, `docs/engine/tune/`. + - Cargo package `nacre` 0.4.0, edition 2024, Rust ≥ 1.88. Servo is `=0.7.0` from crates.io, trimmed (no WebXR, WebGPU, multiprocess). Gamepad and Web Bluetooth stay in. - Status: ~19k lines written, **never compiled**. Review passes were done by reading only. Expect a round of compile errors at the first build; fix them in place, don't restructure. - User rules: function first; plain egui UI until everything works; the Material You redesign comes afterwards (see `docs/UI-BRIEF.md`); nothing from the original is dropped silently (Servo limits are shown as unavailable, see DESIGN.md "Engine limits"); never connect to Tor or proxies in tests. diff --git a/Plans/INDEX.md b/Plans/INDEX.md index 937f1dc..df70225 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -4,6 +4,8 @@ One session = one plan. Plans live in category folders `Plans//SNNN 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. + ## 01 First build - [x] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium - [x] [S002 — Unit tests green](01%20First%20build/S002-unit-tests.md) · Sonnet high @@ -19,7 +21,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h - [ ] [S010 — Phase 2 review with the user](02%20Verify/S010-phase2-review.md) · Sonnet medium · 🧑 ## 03 Gaps -- [ ] [S011 — Open REVIEW.md items](03%20Gaps/S011-review-items.md) · Opus medium +- [ ] ~~[S011 — Open REVIEW.md items](03%20Gaps/S011-review-items.md) · Opus medium~~ dropped (D-032) - [ ] [S012 — Fixes from the user's reviews](03%20Gaps/S012-review-fixes.md) · Opus medium - [ ] [S013 — MPRIS media keys](03%20Gaps/S013-mpris.md) · Opus medium - [ ] [S014 — Phase 3 review with the user](03%20Gaps/S014-phase3-review.md) · Sonnet medium · 🧑 @@ -38,8 +40,8 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h - [x] [S026 — Fix gst_mse for split audio/video MSE](05%20Engine/S026-gst-mse-fixes.md) · Opus high - [x] [S027 — MSE DOM to spec](05%20Engine/S027-mse-dom-spec.md) · Opus high - [x] [S028 — MSE player integration and merge to main](05%20Engine/S028-mse-player.md) · Opus high -- [ ] [S029 — YouTube and Reddit video pass](05%20Engine/S029-youtube-reddit-pass.md) · Opus high · 🧑 -- [ ] [S030 — Ship GStreamer with MSE (AppImage and Windows)](05%20Engine/S030-media-packaging.md) · Opus medium +- [ ] ~~[S029 — YouTube and Reddit video pass](05%20Engine/S029-youtube-reddit-pass.md) · Opus high · 🧑~~ dropped (D-032) +- [ ] ~~[S030 — Ship GStreamer with MSE (AppImage and Windows)](05%20Engine/S030-media-packaging.md) · Opus medium~~ dropped (D-032) ## 06 Privacy - [x] [S023 — Request headers and third-party cookies in servo-net](06%20Privacy/S023-net-headers-cookies.md) · Opus medium @@ -48,13 +50,13 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h ## 07 Polish pass - [x] [S031 — Fix the SIGSEGV after an ad-blocked script load](07%20Polish%20pass/S031-adblock-crash.md) · Opus high -- [ ] [S032 — Page load performance pass](07%20Polish%20pass/S032-load-performance.md) · Opus high -- [ ] [S033 — SVG and CSS masks render right](07%20Polish%20pass/S033-svg-masks.md) · Opus high +- [ ] ~~[S032 — Page load performance pass](07%20Polish%20pass/S032-load-performance.md) · Opus high~~ dropped (D-032) +- [ ] ~~[S033 — SVG and CSS masks render right](07%20Polish%20pass/S033-svg-masks.md) · Opus high~~ dropped (D-032) - [ ] [S034 — Spelling underlines, inline autofill, "Settings updated" popup](07%20Polish%20pass/S034-small-fixes.md) · Opus medium - [ ] [S035 — History/passwords/bookmarks flyouts and Nacre's own context menu](07%20Polish%20pass/S035-flyouts-context-menu.md) · Opus medium - [ ] [S036 — Custom download manager endpoint](07%20Polish%20pass/S036-custom-download-manager.md) · Sonnet high -- [ ] [S037 — DevTools window: Servo devtools bridge, Elements and picker](07%20Polish%20pass/S037-devtools-window.md) · Opus high -- [ ] [S038 — DevTools panels: Console, Network, Sources, Storage, Performance](07%20Polish%20pass/S038-devtools-panels.md) · Opus high +- [ ] ~~[S037 — DevTools window: Servo devtools bridge, Elements and picker](07%20Polish%20pass/S037-devtools-window.md) · Opus high~~ dropped (D-032) +- [ ] ~~[S038 — DevTools panels: Console, Network, Sources, Storage, Performance](07%20Polish%20pass/S038-devtools-panels.md) · Opus high~~ dropped (D-032) - [ ] [S039 — Motion rules and animations](07%20Polish%20pass/S039-motion.md) · Opus medium - [ ] [S040 — Little things sweep](07%20Polish%20pass/S040-little-things.md) · Opus medium - [ ] [S041 — Site passes](07%20Polish%20pass/S041-site-passes.md) · Opus high · 🧑 diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 42c5586..29068b2 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -35,3 +35,4 @@ - D-029 — 2026-11-12 — Orchestrator 3 lets the old sessions finish their in-flight plans (S031 in Spare A, S028 in its own session); every later plan runs in a fresh session started and linked from the current orchestrator, never in old prepared sessions (old S029/S030/Spare B waiting sessions are not used). — user, 2026-11-12 — orchestration from S029 on - D-030 — 2026-11-12 — "Looks right" is judged against a reference, not against "no crash". Every site check (S029, S041, S032, S033 and later) shoots the same page at the same size in a Chromium reference (QtWebEngine, `tools/refshot.py`, built by S029 as its first step) and puts Nacre's shot next to it; the session Reads both PNGs and lists every visible difference (layout, missing images/icons, unfilled skeletons, doubled inputs, black areas). A difference is fixed or written down in PROGRESS with the pair of shots; a pass with unlisted differences is not a pass. UI plans (S035, S039, S043) compare their shots with `docs/ui-reference/` and the Damson app the same way. — user, 2026-11-12, YouTube watch page screenshot: doubled search box, grey skeletons never filled, black player — S029 onward - D-031 — 2026-11-12 — Reference browser for D-030: the Claude desktop app's built-in browser pane (Chromium; `mcp__Claude_Browser__*` tools: navigate, resize_window to Nacre's window size, screenshot) is the first reference for live sites; `tools/refshot.py` (S029) is for scripted/offline runs. Nacre's shot and the pane's shot of the same URL at the same width go side by side. — user, 2026-11-12 — S029, S041, S032, S033 and every site check +- D-032 — 2026-11-13 — Engine switch: Nacre drops Servo and moves to a tuned WebKit (WebKitGTK 6.0 or WPE WebKit 2.54, picked by the 08 spike), Linux only (no Windows builds). Widevine comes later as its own plan (user downloads Google's CDM on first use, never bundled). Reason: engine test (docs/engine/engine-comparison.md, docs/engine/tune/): Servo fails heavy sites (YouTube, Discord, icons); WebKit tuned is at or below Chromium's RAM (2.4–2.5 GB vs 3.3 GB at 10 tabs with page cache off / memory limit) and its VRAM drops with a lighter cache model; WebKit has EME, Web Inspector, mature media. Dropped plans: S011, S029, S030, S032, S033, S037, S038 (Servo-specific; site passes/perf get new WebKit plans). The egui UI, stores, net bridge, ad blocker and nacre:// pages stay. Servo glue (hub.rs, window.rs, vendor/servo-*, gst_mse patches) is removed once WebKit glue works. Supersedes D-028/D-029 order. — user, 2026-11-13 — every remaining plan diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 535ac55..16c8017 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -30,115 +30,22 @@ the test suite. ## Not included (candidates after the first build) Reader mode, translate, split view (the per-tab painters make it possible), MPRIS media keys, real gamepad rumble. -## Orchestrator resume (2026-11-12, 02:40) +## Orchestrator resume (2026-11-13) — engine switch to WebKit -For the next `/orchestrate` run. Read this before picking the "first unchecked plan" from INDEX. +Goal: Nacre runs sites about as well as Chromium for the user's daily use (Linux), lighter on RAM, good looking +(Material You, Damson as style reference). D-032: Servo is dropped for a tuned WebKit; Widevine later. -- **Run order is D-007, not INDEX order**: after S005 the redesign S015–S021 runs, then S006–S014. So the next - plan is **S021** (phase 4 review with the user), not S006. -- **Done and validated**: S001–S005, S015–S020 (all pushed; tracker matches). -- **Before S021**, two chrome follow-ups from the user (`docs/review/phase1.md`): - - R1-09 wavy loading address bar: built and pushed (`87299d3`), **not yet validated** by the orchestrator - (run `SMOKE_VISIBLE=1 tools/smoke.sh tests/smoke/chrome.txt` + `launch.txt`, look at the loading/hover shots, - check R1-09 is marked fixed). - - R1-10 cookie loading spinner on tabs: **not started**. Reference: `draw_spinner` in - `~/Documents/Apps/Nacre/nacre/widgets.py` (read only). Commit as `S016: R1-10 …`. - The earlier S016 session (local_9c7f3aab-b727-4b7e-a29e-fbe955c78c74) has the chrome context; a new session - can do R1-10 from the note above too. -- New user reports R1-11 (colours can't be changed after the welcome setup: look at it before S021, it's high), - R1-12 YouTube, R1-13 DuckDuckGo dark-mode icon colours, R1-14 site-compat doctor pass (user agent, JS). The last three - go to S006/S007. R1-19 (encrypted cookies) joins R1-16; R1-20 (per-site settings and permissions persist and work) goes to S008. -- Also before S021 (chrome follow-up, use the `app-taste` + `unslop` skills): R1-15 shield flyout with Ad blocker / - Privacy / VPN sections, R1-17 QR flyout sizing, R1-18 polish every flyout like the old ones, R1-21 jittery controls on nacre:// pages (see the recording it names). R1-16 (real privacy - mode, Cover Your Tracks) goes to S007 or its own plan: ask the user. -- **Then S021**, then S006 (also takes R1-03 YouTube, R1-04 captchas/caching), S007, S008–S014. R1-07 (ad-block - removal animation) goes to S012. -- Sessions prepared by the old orchestrator (S006 local_c0bdda8a-…, S007 local_f85ecbe7-…, S021 - local_64df2b49-…) are not in the new orchestrator's linked list; reuse them by id or start fresh ones. -- The user watches tests: run smoke scripts with `SMOKE_VISIBLE=1` (D-009). - -## Orchestrator resume (2026-11-12, overnight run) - -- Done and validated this run: R1-09/10/11/15/17/18/21 follow-ups, S021 (R4 items in docs/review/phase4.md). - S006 part 1 pushed (3f213cc..076cdaa); part 2 runs in local_faf65910-a6db-475e-9a8a-05cdf1877ea1. -- New plans (D-013): S022 MSE spike (after S006), S023–S025 privacy (after S009, before S010). -- Run order: S006 → S022 → S007 → S008 → S009 → S023 → S024 → S025 → S010 (🧑) → S011–S014. -- Prepared sessions waiting for GO: S022 local_7fddd5dd-8b34-47ac-b474-4713876cdb9a, S007 local_93ad1a64-cb4d-4485-9464-4e0a87e6a1db, - S008 local_fe1e00f2-f8d4-4fa3-aa67-8ab89c772961, S009 local_28f452cc-e97e-478d-9fa4-9342c0dfa28b (has a parked R4-09 patch - in its scratchpad), S023 local_dad7e906-ae79-496f-ac34-c698ec060ed9, S024 local_0abe76a6-d58e-4d83-9904-a4e451ceb829, - S025 local_e5b39177-9b18-4b7a-862d-3f75791478d8; spare for a context-limit takeover: local_373e46d7-2d38-4d5a-94c4-855dae433f88. -- User rules from this run: caveman chat (code/docs full quality); orchestrator makes the recommended calls alone overnight; - fix gaps inside the engine (vendored Servo crates), no yt-dlp-style workarounds. Smoke tap/drag scripts need hidden - SMOKE_SIZE runs (the visible window is ~772 px wide). -- Update: S006, S007, S022 done and validated. D-015 MSE go (option A), plans S026–S030. S008 running - (local_fe1e00f2-…). S026 runs in parallel in worktree ~/Projects/Nacre-s022 (branch s022-mse-proto, own target/) on - the former spare local_373e46d7-2d38-4d5a-94c4-855dae433f88. S027–S030 have no session yet: reuse an idle finished - session (r1-11 local_48b023e1-…, r1-10 local_3487b672-…, r1-flyouts local_fbdfe092-…, r1-21 local_4d846ded-…, - s021 local_3e6a6b37-…, s022 local_7fddd5dd-…) by message, or start fresh ones when the user is back. -- Update (after the usage-limit reset): S008, S026 done and validated (site-memory restart smoke p1/p2 pass; mse.txt - split A/V plays on branch s022-mse-proto). S009 running on main (local_28f452cc-…). S027 running in the worktree - (local_c15ace99-33b1-45b0-8fb6-bfb77cca68ce). Waiting for GO: S028 local_c57574e1-48d8-40b4-9a0c-386b7079f666, - S029 local_b1da3720-150b-45f9-8689-684e25ef97af, S030 local_dea5e96f-16c8-4e0a-a13d-5105f2fa5c98, S023/S024/S025 (ids - above). Spares: spare-a local_373e46d7-… (did S026), spare-b local_4fb2df64-5994-4b0d-a834-cff2859cf94b. - Order: S009 ∥ S027 → S028 (merges the branch to main) → S029 → S030 → S023 → S024 → S025 → S010 (🧑). - -## Orchestrator resume (2026-11-12 evening) — start a NEW orchestrator session - -The old orchestrator session's context is full. Next session: run `/plan-generate` for category `07 Polish pass` from -`docs/review/phase5.md` (R5-01 crash first, then performance, SVG, spelling, flyouts, custom download manager, -DevTools window, animations, little-things sweep, site passes), then `/orchestrate`. -- State: S001–S009, S015–S024, S026 done. S025 (encrypted cookies) in progress on main, uncommitted work in the tree - (session local_e5b39177-9b18-4b7a-862d-3f75791478d8). S027 being finished by spare-b local_4fb2df64-5994-4b0d-a834-cff2859cf94b - in worktree ~/Projects/Nacre-s022 (branch s022-mse-proto, own target/). -- Waiting for GO: S028 local_c57574e1-48d8-40b4-9a0c-386b7079f666 (merges the MSE branch to main), S029 - local_b1da3720-150b-45f9-8689-684e25ef97af, S030 local_dea5e96f-16c8-4e0a-a13d-5105f2fa5c98. Spare: local_373e46d7-2d38-4d5a-94c4-855dae433f88. -- Then: S010 phase 2 review (🧑), 03 Gaps S011–S014 (never started), 07 Polish pass. -- Validation habit: rerun each plan's own smoke (start its local server first: tests/smoke/net/server.py or - `python3 -m http.server 8768 --directory tests/smoke/pages`); tap/drag scripts need hidden SMOKE_SIZE runs. - -## Orchestrator resume (2026-11-12 night) — orchestrator 2 - -Orchestrator 2 = this run (started from the old orchestrator local_f8354413-…). Plans S031–S042 (07 Polish pass) written, tracker seeded; decisions D-020–D-025. -- Validated: S025 (cookie smokes ×4 green), S027 (mse smoke green; WPT 239/407 < 293, gaps moved to S028 by D-025). -- Running: S031 (crash) on main by spare-a local_373e46d7-2d38-4d5a-94c4-855dae433f88; S028 in worktree ~/Projects/Nacre-s022 - (own target/) by local_c57574e1-48d8-40b4-9a0c-386b7079f666 — must message the orchestrator before merging to main (after S031 is validated). -- Waiting for GO: S029 local_b1da3720-150b-45f9-8689-684e25ef97af, S030 local_dea5e96f-16c8-4e0a-a13d-5105f2fa5c98 (both after S028), - S010 (🧑, needs the user) prepared in spare-b local_4fb2df64-5994-4b0d-a834-cff2859cf94b. -- Order after that (D-024): S028 merge → S029/S030 → S010 🧑 → S011–S014 → S032… (one cargo user of main's target/ at a time). -- Sessions report by SendMessage to the orchestrator's id; a new orchestrator must message each running/waiting session its own id. - -### Wrap-up (2026-11-12 late, weekly limit) — start a NEW orchestrator from here -- User priority: D-026 then D-027 (motion S039 and new UI refine plan S043 moved up). Run order is in D-028 (S035 flyouts, S039, S043 moved up; Damson = style reference). -- At wrap-up: S031 (spare-a, main tree) and S028 (worktree ~/Projects/Nacre-s022, branch s022-mse-proto) were told to - commit their state (`WIP` if unfinished) with accurate plan boxes and a PROGRESS note, push, and stop. Check - `git log`, `git status` (main and the worktree) and each plan's first unchecked box before anything else; a plan - with unchecked boxes resumes in its own session (ids above) at that box. -- S028 must not merge to main until S031 is validated (D-024). S029/S030/spare-b (S010) are waiting, untouched. -- Next three steps: (1) validate or resume S031 (`python3 tests/smoke/net/server.py &` then - `SMOKE_VISIBLE=1 tools/smoke.sh tests/smoke/crash-adblock.txt` ×3, heavy-web); (2) resume/validate S028 and let it - merge; (3) GO S029, then S035, S039, S043 (D-028 order). -- Known bugs: R5-01 crash until S031 lands; YouTube stalls / WPT 239/407 (S028); see PROGRESS "Later". -- Build/test: `nice cargo build --release -j 2`, `nice cargo test --release -j 2` (never together, one cargo per target/); - smokes per CLAUDE.md §5. -- Open question for the user: none blocking; S010 needs them when its turn comes. -- Stopped at 98 % weekly limit. At stop, S031's work (spare-a) was still UNCOMMITTED in the main tree - (vendor/servo-script/, tests/smoke/crash-adblock.txt + pages, Cargo.toml/lock, DESIGN, PROGRESS, CLAUDE.md, plan file): - don't discard it; message spare-a local_373e46d7-2d38-4d5a-94c4-855dae433f88 to resume at its first unchecked box. - S028 was mid-work in ~/Projects/Nacre-s022 (check that worktree's `git status` too). -- Update: S031 committed 0ecfd0f (cause: servo-script fire_timer kept due timers unrooted; fix = vendored servo-script - with rooted timers, crash-adblock 3/3). Left: step 7 (heavy-web ×2, net-adblock, launch) + cargo test, then INDEX tick. - S028 merge: the MSE branch also vendors servo-script — take the branch's files, re-apply the 2 `Nacre patch (S031)` - hunks in event_loop/timers.rs. -- Update: S028 stopped, WIP 71ec603 on s022-mse-proto (pushed, NOT merged). main merged into the branch; mse.txt + leak ok; - new `tests/smoke/mse-player.txt` 7/9. Left: two gst_mse C fixes (msesrc EOS after endOfStream → 'ended'; - on_duration_changed shrinking a page-set duration), cargo test, WPT rerun, full smokes, DESIGN/FEATURES, merge. - Details: side-session-notes/local_f8354413-73d5-4c6d-8be6-6a6a12c51e53/S028-notes.md. Resume in S028's own session - local_c57574e1-48d8-40b4-9a0c-386b7079f666. -- Update: S031 DONE (0ecfd0f fix, c379f81 end steps: crash-adblock ×3, net-adblock, launch, heavy-web ×2 no SIGSEGV, - 70 tests; INDEX ticked; checked by git/plan state, smokes not rerun by the orchestrator). S028 kept going: branch at - 24eeaa5 (mse-player 9/9, boxes 2–5 ticked, docs), then started merging main into the branch — told to commit that - merge, push and stop. Next orchestrator: check `git -C ~/Projects/Nacre-s022 status`, then let S028 finish the - remaining boxes and merge to main (re-apply S031 timers.rs hunks), then S029 → S035 → S039 → S043 (D-028). -- Final: S028 stopped; branch merge commit 6709508 pushed (main merged in, NOT built). Pre-merge smokes launch, basics, - input, chrome green; mse.txt fails `reopen` (likely the new gst EOS patch). Next: fix reopen, build, rerun smokes + WPT, - then merge into main (branch PROGRESS has the steps). +- Done on Servo (kept in git history): S001–S009, S015–S028, S031. MSE merged (S028), crash fixed (S031). +- Engine test: `docs/engine/engine-comparison.md` (Servo/WebKit/Chromium, 10 sites) and `docs/engine/tune/` (WebKit + knobs: page cache off → 2.4 GB, memory limit 500 MB → 2.5 GB, cache model DOCUMENT_VIEWER → VRAM 873 MB vs 1566, + hardware acceleration off → VRAM 57 MB; related views didn't help; gsk-gl run partial). Tools: `tools/engine-test/`. +- Installed: `webkitgtk-6.0` 2.54.2. `wpewebkit` 2.54.2 is in extra (not installed) — the spike decides GTK vs WPE. +- Old sessions all archived; worktree ~/Projects/Nacre-s022 removed (branch merged). The engine-test session may + still show in the sidebar (archive it there). +- Plans: Servo-only plans struck in INDEX (D-032). Engine-independent plans stay: S010, S012–S014, S034–S036, + S039–S043 (UI work after the switch). +- Next three steps: (1) the WebKit spike session decides the embedding (WPE exporting frames into egui's GL vs a GTK4 + host for egui) and writes plans `08 WebKit engine` (spike result, glue, Servo removal, tuning defaults, site passes, + Widevine later); (2) orchestrate those plans one cargo user at a time; (3) then the UI block (S035, S039, S043). +- Rules in force: D-030/D-031 (compare shots with the reference browser), D-029 (fresh linked sessions from the + current orchestrator), user watches visible runs (D-009), caveman chat.