From 44d7fb996afe74fb7420528be91c5adad481e913 Mon Sep 17 00:00:00 2001 From: bmh129 <11478682+bmh129@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:33:46 -0600 Subject: [PATCH] M10: name the web OCR pool's run router `runs` (ocr.ocr-web) page_modules_read_the_pointer_only_through_page_pointer treats any file that mentions `.router.` as a page module, and failed on workflows/ocr_web.rs: its `self.router` is the OCR pool's ocr_route::Router, which hands each page's text to the run that sent it, not the pages' PageRouter. Adding the file to PAGE_MODULES would put the workers under the page-input checks, so the field is renamed `runs` instead. Tests: the page_pointer tests and all 808 pdfcraft-ui-egui lib tests pass, and cargo check for wasm32-unknown-unknown builds. --- crates/ui-egui/src/workflows/ocr_web.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/workflows/ocr_web.rs b/crates/ui-egui/src/workflows/ocr_web.rs index 464d711d09..57f3a8348a 100644 --- a/crates/ui-egui/src/workflows/ocr_web.rs +++ b/crates/ui-egui/src/workflows/ocr_web.rs @@ -144,7 +144,7 @@ struct Pool { /// When a page last went to or came back from a worker: the idle time runs from here. last_used: f64, /// Which run each page sent belongs to: single-file and multiple-file OCR share the workers. - router: Router, String>>, + runs: Router, String>>, } thread_local! { @@ -192,7 +192,7 @@ impl Pool { /// the worker script or the browser refuses it. fn start(ctx: &egui::Context) -> Pool { let t = now(); - let mut pool = Pool { members: Vec::new(), events: Rc::new(RefCell::new(Vec::new())), started: t, last_used: t, router: Router::default() }; + let mut pool = Pool { members: Vec::new(), events: Rc::new(RefCell::new(Vec::new())), started: t, last_used: t, runs: Router::default() }; let url = web_sys::window() .and_then(|w| w.document()) .and_then(|d| d.query_selector(WORKER_META).ok().flatten()) @@ -292,7 +292,7 @@ impl Pool { self.last_used = now(); } for (id, lines) in done { - self.router.deliver(id, lines); + self.runs.deliver(id, lines); } } @@ -300,7 +300,7 @@ impl Pool { /// couldn't be sent. fn send(&mut self, i: usize, image: &OcrImage, inbox: &Inbox, String>>) -> Option { let m = self.members.get_mut(i)?; - let id = self.router.send(inbox, |id| { + let id = self.runs.send(inbox, |id| { let pixels = js_sys::Uint8Array::from(image.rgba()); let msg = message(&[ ("type", &"page".into()),