diff --git a/Plans/01 First build/S001-compile.md b/Plans/01 First build/S001-compile.md index 2b7b3b3..0138a23 100644 --- a/Plans/01 First build/S001-compile.md +++ b/Plans/01 First build/S001-compile.md @@ -12,15 +12,15 @@ Make the never-compiled ~19.5k lines build: `nice cargo build --release -j 2` pr - Only the source files that compile errors point at; for Servo API questions read the crate sources in `~/.cargo/registry/src/*/servo-0.7.0/` and friends rather than guessing. ## Steps -- [ ] Commit the pending work as is (`S001: commit self-test WIP and UI brief`) so fixes start from a clean tree -- [ ] Check toolchain: `rustc --version` ≥ 1.88, `clang --version`; run `nice cargo build --release -j 2 --message-format short 2>&1 | tail -150` and save the full log to the scratchpad -- [ ] Fix name-resolution / import / missing-item errors (`E0432`, `E0433`, `E0425`, `E0412`, `E0599` on wrong paths) across all modules; rebuild -- [ ] Fix type and trait errors (mismatched types, missing trait impls, wrong Servo/egui/winit signatures) module by module; rebuild after each module group -- [ ] Fix borrow-checker and lifetime errors (`E0499`, `E0502`, `E0505`, `E0597`) with the smallest local change (clone, scope, split borrow); rebuild -- [ ] Build is clean of errors; then fix warnings that point at real bugs (unused results, unreachable code); leave style warnings -- [ ] `target/release/nacre --help` (or `--version`) runs and exits 0 without opening a window; if it has no such flag, check `ldd target/release/nacre` resolves everything -- [ ] Update `docs/HANDOFF.md` "State" (compiles now) and add anything surprising about Servo's API to `docs/DESIGN.md` cheat sheet -- [ ] PROGRESS entry, INDEX line, commit `S001: …` and push +- [x] Commit the pending work as is (`S001: commit self-test WIP and UI brief`) so fixes start from a clean tree +- [x] Check toolchain: `rustc --version` ≥ 1.88, `clang --version`; run `nice cargo build --release -j 2 --message-format short 2>&1 | tail -150` and save the full log to the scratchpad +- [x] Fix name-resolution / import / missing-item errors (`E0432`, `E0433`, `E0425`, `E0412`, `E0599` on wrong paths) across all modules; rebuild +- [x] Fix type and trait errors (mismatched types, missing trait impls, wrong Servo/egui/winit signatures) module by module; rebuild after each module group +- [x] Fix borrow-checker and lifetime errors (`E0499`, `E0502`, `E0505`, `E0597`) with the smallest local change (clone, scope, split borrow); rebuild +- [x] Build is clean of errors; then fix warnings that point at real bugs (unused results, unreachable code); leave style warnings +- [x] `target/release/nacre --help` (or `--version`) runs and exits 0 without opening a window; if it has no such flag, check `ldd target/release/nacre` resolves everything +- [x] Update `docs/HANDOFF.md` "State" (compiles now) and add anything surprising about Servo's API to `docs/DESIGN.md` cheat sheet +- [x] PROGRESS entry, INDEX line, commit `S001: …` and push ## End criteria - `nice cargo build --release -j 2` exits 0. diff --git a/Plans/INDEX.md b/Plans/INDEX.md index e62b50f..08dc52c 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -5,7 +5,7 @@ One session = one plan. Plans live in category folders `Plans//SNNN Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h ## 01 First build -- [ ] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium +- [x] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium - [ ] [S002 — Unit tests green](01%20First%20build/S002-unit-tests.md) · Sonnet high - [ ] [S003 — First launch and smoke harness](01%20First%20build/S003-first-launch.md) · Opus medium - [ ] [S004 — Phase 1 review with the user](01%20First%20build/S004-phase1-review.md) · Sonnet medium · 🧑 diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 3763e25..84b587e 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -119,6 +119,10 @@ Prefs worth knowing: user_agent, network_http_proxy_uri, network_https_proxy_uri Opts: config_dir (profile storage: cookies, local storage), temporary_storage, ignore_certificate_errors, multiprocess. ``` +egui 0.37 deprecates `Ui::id` (now `Ui::scope_id`) and `Id::new` (now `Id::unique` / `IdSalt::new`); the code still +uses the old names, which build with warnings. The Servo 0.7 API above matched the crate: the first build had no +Servo signature errors. + Not in Servo 0.7, so Nacre does it itself: downloads, find in page, private mode, SOCKS proxies, spell check, picture-in-picture, extensions, password capture, printing. diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 48cd64c..6cadecb 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -14,8 +14,10 @@ the test suite. - Review passes done without compiling: API signatures checked against the crate sources in ~/.cargo/registry, names cross-checked between modules (commands, UI state, shared fields, crate:: paths), every setting checked to be read by the code. Bugs found and fixed are in git history. -- Never compiled. Expect a round of compile errors at the first build (type inference, borrow checker, small - API mismatches); fix them in place, don't restructure. +- Compiles (S001, 2026-11-11): `nice cargo build --release -j 2` exits 0 and produces `target/release/nacre` + (~144 MB); `--help`/`--version` run headless. Only five errors at the first build (two missing imports, three + borrow errors), fixed in place. 66 warnings left: egui 0.37 deprecations and dead code. Not run with a window + yet, unit tests not run yet. ## First build checklist 1. `nice cargo build --release -j 2` (first build takes hours: Servo, SpiderMonkey, WebRender). diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index d438080..3e0998f 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -2,6 +2,18 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done, later. +## S001 — Compile to a binary (2026-11-11) +- Done: self-test WIP and UI brief committed; first build had 5 errors (missing `Read` import in instance.rs, + missing `Speller` import in actions.rs, borrow errors in app.rs:796, store/scripts.rs:124, + ui/pages/settings.rs:947), fixed in place; removed a no-op `drop(&mut)` in app.rs. No feature degraded. +- Verified: `nice cargo build --release -j 2` exit 0; `target/release/nacre` (144 MB) `--help`/`--version` exit 0 + headless; `ldd` resolves everything. nacre crate alone rebuilds in ~1 min (Servo was already built). +- Not done: unit tests, launching a window (later plans). +- 66 warnings remain: egui 0.37 deprecations (`Ui::id`, `Id::new`) and dead code. Dead code that hints at unwired + features: `History::autocomplete`/`top_sites` (omnibox inline completion, new-tab top sites?), + `keys::conflicts` (shortcut conflict check), `Command::SpellReplace` (duplicate of `MenuAction::SpellReplace`), + `tabs::Page::Error`, `Prompt::Info`. Worth a look in the gaps phase. + ## Later - Reader mode, split view, translate, real gamepad rumble (D-002: not planned for now). - Packaging and first release (D-001: plan when the user asks). diff --git a/src/actions.rs b/src/actions.rs index a29d68c..32817b8 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -15,6 +15,7 @@ use crate::app::{App, Launch, WindowRequest}; use crate::inject::{self, PageMessage}; use crate::keys::Action; use crate::net::download; +use crate::spell::Speller; use crate::store::downloads::State as DlState; use crate::store::permissions::{Decision, Kind as Perm}; use crate::tabs::{Dialog, Page, Prompt, Tab}; diff --git a/src/app.rs b/src/app.rs index ad1973a..6fb752e 100644 --- a/src/app.rs +++ b/src/app.rs @@ -793,7 +793,8 @@ impl App { } } // Mute state survives navigation. - let muted = self.tab_mut(id).map(|t| t.muted || self.shared.settings.borrow().site_muted(&util::host_of_str(&t.url))).unwrap_or(false); + let shared = self.shared.clone(); + let muted = self.tab_mut(id).map(|t| t.muted || shared.settings.borrow().site_muted(&util::host_of_str(&t.url))).unwrap_or(false); if muted && let Some(tab) = self.tab_mut(id) { tab.muted = true; if let Some(web) = &tab.web { @@ -1799,7 +1800,6 @@ impl App { // Back/forward mouse buttons navigate. if *state == ElementState::Pressed && matches!(button, winit::event::MouseButton::Back | winit::event::MouseButton::Forward) { let back = *button == winit::event::MouseButton::Back; - drop(win); self.run_in(window_id, if back { Command::Back } else { Command::Forward }); return; } diff --git a/src/instance.rs b/src/instance.rs index 3bf6e48..3a5b623 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -1,7 +1,7 @@ //! Single instance per profile: a running Nacre listens on a loopback port; a second launch //! hands its links to it and exits. The port and a random token are in the profile's data folder. -use std::io::{BufRead, BufReader, Write}; +use std::io::{BufRead, BufReader, Read, Write}; use std::net::{TcpListener, TcpStream}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::Sender; diff --git a/src/store/scripts.rs b/src/store/scripts.rs index f41d7fe..20cc21c 100644 --- a/src/store/scripts.rs +++ b/src/store/scripts.rs @@ -121,7 +121,7 @@ pub fn pattern_to_regex(pattern: &str) -> String { } let mut out = String::from("^"); let (scheme, rest) = pattern.split_once("://").unwrap_or(("*", pattern)); - out.push_str(if scheme == "*" { "https?" } else { &escape_regex(scheme) }); + out.push_str(&if scheme == "*" { "https?".to_owned() } else { escape_regex(scheme) }); out.push_str(":\\/\\/"); let (host, path) = match rest.find('/') { Some(i) => (&rest[..i], &rest[i..]), diff --git a/src/ui/pages/settings.rs b/src/ui/pages/settings.rs index 97053dd..89276b2 100644 --- a/src/ui/pages/settings.rs +++ b/src/ui/pages/settings.rs @@ -944,7 +944,8 @@ fn newtab(ui: &mut Ui, f: &mut Frame, s: &mut Settings) { } }); switch_row(ui, "Follows the mouse", "", &mut s.ntp.bg_mouse); - row(ui, "Image", if s.ntp.bg_image.is_empty() { "None" } else { &s.ntp.bg_image }, |ui| { + let image = if s.ntp.bg_image.is_empty() { "None".to_owned() } else { s.ntp.bg_image.clone() }; + row(ui, "Image", &image, |ui| { if !s.ntp.bg_image.is_empty() && ui.button("Remove").clicked() { s.ntp.bg_image.clear(); }