diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 20883985..1d55ddee 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -17,7 +17,7 @@ Implementation history (the sync-hardening work + the modularization arc) lives ## Large-file map (decomposition status) -Current first-party line counts (`wc -l`, 2026-10-14 — the **numbers and this +Current first-party line counts (`wc -l`, 2026-10-15 — the **numbers and this date are GENERATED** by `npm run build:filemap` ([scripts/build-filemap.js](scripts/build-filemap.js)); `npm run check` fails when they drift, so don't edit counts by hand. Which files are listed and every @@ -39,7 +39,7 @@ off — and where it doesn't. | [undo-stack.js](undo-stack.js) | 218 | Done (2026-07-30) — `createUndoStack(ctx)` split out of annotation-model.js: the model is pure-ish data transformation, the stack is a command-history controller with UI side-effect hooks in its ctx. Covered by the undo tests in [annotation-model.test.js](annotation-model.test.js) (interleaved with model tests, dual-require). | | [icons.js](icons.js) | 531 | Bundled icon data, mostly literals. Leave. | | [report.js](report.js) | 991 | Self-contained report builder with a frozen `window.*` contract. Leave. | -| `features/*.js` (108 files) | 37,531 total | Mostly single-feature files with their own specs. The largest are the teaching layer (tutorial 1,656; lessons 1,043, the three courses 609 to 725; tour-blank 794) and duct-tool (866); DECOMPOSITION_MAP.md has a verdict for every one. | +| `features/*.js` (108 files) | 37,532 total | Mostly single-feature files with their own specs. The largest are the teaching layer (tutorial 1,656; lessons 1,043, the three courses 609 to 725; tour-blank 794) and duct-tool (866); DECOMPOSITION_MAP.md has a verdict for every one. | ### What's left inside app.js (by `// SECTION:` size) @@ -130,12 +130,12 @@ modules. Candidates in priority order: | [canvas-repair.spec.js](canvas-repair.spec.js) | Playwright regression for the registry pilot — uploads `test-2pages.pdf`, adds a page-0 marker, asserts `window.App.openCanvasRepairModal`/`applyCanvasRepair` are functions and `App.state === window.state`, opens the modal + clicks `#canvasRepairApply` (no-op default mapping), and asserts the marker survives with no console / page errors; `npx playwright test canvas-repair.spec.js` | | [features/note.js](features/note.js) | Second feature-file split (`window.App` registry pilot #2) — the Note add/edit modal (`openNoteModal` + its `noteModalCancel`/`noteModalDone` button bindings). Its own IIFE loaded **after** [app.js](app.js); reads shared `state`/helpers from `window.App` at call time, registers `App.openNoteModal`, and binds the modal's Cancel/Done at load. app.js's 5 inbound call sites (canvas click / dblclick / context-menu / touch handlers) call it via `App.openNoteModal(...)` | | [note.spec.js](note.spec.js) | Playwright regression for pilot #2 — uploads `test-2pages.pdf`, asserts `window.App.openNoteModal`/`ensureActiveCanvas`/`showLineColorModal` are functions, then exercises add (type + `#noteModalDone` persists a note), edit (reopen on the note object, change text), and cancel (`#noteModalCancel` clears `pendingNote`/`editingNote` and adds nothing), reading notes back via `window.App.ensureActiveCanvas`; asserts no console / page errors; `npx playwright test note.spec.js` | -| [features/zoom.js](features/zoom.js) | Third feature-file split (`window.App` registry pilot #3) — the Zoom Settings modal (`showZoomModal` + its `zoomModalClose`/`zoomMax`/`zoomSpeed` handlers). Its own IIFE loaded **after** [app.js](app.js); reads shared `state`/helpers from `window.App` at call time, registers `App.showZoomModal`, binds the modal inputs at load. `getMaxZoom`/`getWheelZoomSpeed` stay defined in app.js (used in ~10 places there) and are read via `App.*` — the first "publish-only, do-not-move" dep. its inbound call sites are the Zoom Rail's gear button ([features/zoom-rail.js](features/zoom-rail.js)) — the zoom-% click itself only toggles the rail DEEP-ZOOM part 2 (2026-10-14): the slider runs to the device's ceiling (`App.getDeviceZoomCeiling()`, 5000% on a capable device, 1200% on a small-cap or low-memory one) and shows the PROJECT's own ceiling held to that range, with `#zoomMaxHint` saying where the device holds it; Done writes `state.maxZoom` only when the slider moved, so opening the dialog on a phone never lowers a project's 3000% to 1200%. | -| [features/zoom-rail.js](features/zoom-rail.js) | The **Zoom Rail** — the giant floating vertical zoom slider on the right edge, **toggled** by clicking the footer zoom-% (`#zoomPct`). Log-scale track (equal distance per doubling, 0.2 → `getMaxZoom()`) with round-percent tick marks (majors labelled), an accent-yellow %-readout draggable thumb with a light magnetic snap to ticks, +/− buttons, and a gear that opens the Zoom Settings modal (the modal's only entry point — the rail's z-index 300 sits above the modal overlay's 200, so both stay usable together). Drags anchor the zoom at the canvas-wrapper center and reuse app.js's cheap transform preview + debounced commit. Replaced the old `#zoomOverlay` popover (markup/handlers/dismisser removed). Registers `App.openZoomRail`/`App.closeZoomRail`/`App.toggleZoomRail` plus the `App.onZoomRailSync` core-→-feature callback (called from `updateUI` and the pinch rAF so the thumb tracks wheel/pinch/±/fit while open; also rebuilds ticks when Zoom Settings changes the max zoom, and closes the rail if the project unloads). Five publish-only deps `doZoomIn`/`doZoomOut`/`updateContainerTransform`/`commitWheelZoom`/`syncZoomIndicators` (the drag's per-move sync is the light `syncZoomIndicators` — zoom-% + thumb only, **never** the full `updateUI()`, whose all-pages sidebar rebuild made zoom gestures lag on large projects; the full `updateUI()` runs once in the commit — see [zoom-no-updateui-during-gesture.spec.js](zoom-no-updateui-during-gesture.spec.js)). Dismissal: re-click the zoom %, outside click (clicks inside `#zoomModal` don't count), or Escape — the rail **stays until dismissed** (B9/J15 removed the old ~5s idle auto-fade, an invisible timer that lost the rail mid-adjustment on a field pause) DEEP-ZOOM (2026-10-14): `TICK_PCTS` gains 2000, 3000 and 5000 (2000 a major), shown only when `getMaxZoom()` allows. | +| [features/zoom.js](features/zoom.js) | Third feature-file split (`window.App` registry pilot #3) — the Zoom Settings modal (`showZoomModal` + its `zoomModalClose`/`zoomMax`/`zoomSpeed` handlers). Its own IIFE loaded **after** [app.js](app.js); reads shared `state`/helpers from `window.App` at call time, registers `App.showZoomModal`, binds the modal inputs at load. `getMaxZoom`/`getWheelZoomSpeed` stay defined in app.js (used in ~10 places there) and are read via `App.*` — the first "publish-only, do-not-move" dep. its inbound call sites are the Zoom Rail's gear button ([features/zoom-rail.js](features/zoom-rail.js)) — the zoom-% click itself only toggles the rail. DEEP-ZOOM part 2 (2026-10-14): the slider runs to the device's ceiling (`App.getDeviceZoomCeiling()`, 5000% on a capable device, 1200% on a small-cap or low-memory one) and shows the PROJECT's own ceiling held to that range, with `#zoomMaxHint` saying where the device holds it; Done writes `state.maxZoom` only when the slider moved, so opening the dialog on a phone never lowers a project's 3000% to 1200%. | +| [features/zoom-rail.js](features/zoom-rail.js) | The **Zoom Rail** — the giant floating vertical zoom slider on the right edge, **toggled** by clicking the footer zoom-% (`#zoomPct`). Log-scale track (equal distance per doubling, 0.2 → `getMaxZoom()`) with round-percent tick marks (majors labelled), an accent-yellow %-readout draggable thumb with a light magnetic snap to ticks, +/− buttons, and a gear that opens the Zoom Settings modal (the modal's only entry point — the rail's z-index 300 sits above the modal overlay's 200, so both stay usable together). Drags anchor the zoom at the canvas-wrapper center and reuse app.js's cheap transform preview + debounced commit. Replaced the old `#zoomOverlay` popover (markup/handlers/dismisser removed). Registers `App.openZoomRail`/`App.closeZoomRail`/`App.toggleZoomRail` plus the `App.onZoomRailSync` core-→-feature callback (called from `updateUI` and the pinch rAF so the thumb tracks wheel/pinch/±/fit while open; also rebuilds ticks when Zoom Settings changes the max zoom, and closes the rail if the project unloads). Five publish-only deps `doZoomIn`/`doZoomOut`/`updateContainerTransform`/`commitWheelZoom`/`syncZoomIndicators` (the drag's per-move sync is the light `syncZoomIndicators` — zoom-% + thumb only, **never** the full `updateUI()`, whose all-pages sidebar rebuild made zoom gestures lag on large projects; the full `updateUI()` runs once in the commit — see [zoom-no-updateui-during-gesture.spec.js](zoom-no-updateui-during-gesture.spec.js)). Dismissal: re-click the zoom %, outside click (clicks inside `#zoomModal` don't count), or Escape — the rail **stays until dismissed** (B9/J15 removed the old ~5s idle auto-fade, an invisible timer that lost the rail mid-adjustment on a field pause). DEEP-ZOOM (2026-10-14): `TICK_PCTS` gains 2000, 3000 and 5000 (2000 a major), shown only when `getMaxZoom()` allows. | | [zoom-rail.spec.js](zoom-rail.spec.js) | Playwright regression for the Zoom Rail — uploads `test-2pages.pdf`, asserts the registry contract (`openZoomRail`/`closeZoomRail`/`toggleZoomRail`/`onZoomRailSync` + the 4 publish-only deps), `#zoomPct` click toggles the rail (modal does **not** open; gear opens it with the rail staying up), mouse-drags the track past the ends asserting `state.zoom` rises to max then clamps to 0.2 with `#zoomPct` in sync, stays-until-dismissed persistence (B9: no idle auto-fade; unrelated `updateUI` churn doesn't dismiss it either) + the accent-yellow thumb, tick rebuild when max zoom changes 400% → 1200% (8 → 11 ticks), external `state.zoom` writes resync the thumb, mobile viewport tap shows the rail without the modal (and `#zoomOverlay` is gone), and outside-click + Escape dismiss; asserts no console / page errors; `npx playwright test zoom-rail.spec.js` | | [page-switch-cache.spec.js](page-switch-cache.spec.js) | Perf regression for the **PDF render bitmap cache** (`// SECTION: PDF render bitmap cache` in app.js) — the LRU of recently-rendered page ImageBitmaps keyed by the self-validating tuple (pdfPage proxy + rotation + zoom + effDpr) that makes revisits and idle-prefetched neighbor visits a synchronous blit instead of a pdf.js raster. Wraps each page's `pdfPage.render` with a call-counting spy, then asserts: a revisit adds **zero** render calls with `App.__pdfBitmapCacheStats().hits` incremented and real canvas content; rotate + undo (which rewrites `page.rotation` in place) both force fresh rasters (key self-invalidation); 12 rapid no-wait page flips ride the new `pdfRenderTask.cancel()` path with no console errors and land on the right page; the ~250ms idle prefetch caches the neighbor so its first visit is a blit; and `App.clearPdfBitmapCache()` empties to size 0. `npx playwright test page-switch-cache.spec.js` | | [zoom-no-updateui-during-gesture.spec.js](zoom-no-updateui-during-gesture.spec.js) | Perf regression for the zoom-gesture paths — asserts wheel zooming does **not** run the full `updateUI()` per frame (sentinel child planted in `#pagesList` must survive the gesture — any `updateUI()` wipes it via `renderPagesList`'s innerHTML rebuild), that `#zoomPct` still tracks `state.zoom` per frame via the light `syncZoomIndicators()` (published on the registry), and that exactly one full `updateUI()` + re-render lands at the debounced `commitWheelZoom` (sentinel gone after the 150 ms window); uploads `samples/sample-plan.pdf`; asserts no console / page errors; `npx playwright test zoom-no-updateui-during-gesture.spec.js` | -| [zoom.spec.js](zoom.spec.js) | Playwright regression for pilot #3 — uploads `test-2pages.pdf`, asserts `window.App.showZoomModal`/`getMaxZoom`/`getWheelZoomSpeed` are functions, opens via `window.App.showZoomModal()`, sets `#zoomMax` to 600 + `#zoomSpeed` to 200 (dispatching `input`), clicks `#zoomModalClose`, and asserts `state.maxZoom === 6` and `localStorage.zoomSettings.wheelZoomSpeed === 2` with no console / page errors; `npx playwright test zoom.spec.js` | +| [zoom.spec.js](zoom.spec.js) | Playwright regression for pilot #3 — uploads `test-2pages.pdf`, asserts `window.App.showZoomModal`/`getMaxZoom`/`getWheelZoomSpeed` are functions, opens via `window.App.showZoomModal()`, sets `#zoomMax` to 600 + `#zoomSpeed` to 200 (dispatching `input`), clicks `#zoomModalClose`, and asserts `state.maxZoom === 6` and `localStorage.zoomSettings.wheelZoomSpeed === 2`. A second test reads the 400% default, raises the ceiling to 1200% through the dialog and sets the zoom to it with `#pdfCanvas` still painting (the canvas-cap clamp, not a black screen); a third, on a 390px viewport, opens the dialog from the rail's gear and the rail stays open. Since DEEP-ZOOM (2026-10-14) both opens assert the slider's `max` equals `App.getDeviceZoomCeiling()` × 100, not a literal 1200. No console / page errors; `npx playwright test zoom.spec.js` | | [features/manage-icons.js](features/manage-icons.js) | Fourth feature-file split (`window.App` registry pilot #4) and the **first multi-region move** — the Manage Icons modal (`openManageIconsModal` + its `manageIconsModalClose`/`manageIconsCancel`/`manageIconsSave` handlers, which lived in app.js's event-binding block, a region away from the opener). Its own IIFE loaded **after** [app.js](app.js); reads shared `state`/helpers from `window.App` at call time, registers `App.openManageIconsModal`, binds the modal's Close/Cancel/Save at load. `getOrderedIcons`/`iconVbFor`/`getUserCustomIcons`/`saveUserCustomIcons`/`showToast` stay defined in app.js (each used 10-15× there) and are read via `App.*` — publish-only deps. The Save handler reads `App.getOrderedIcons().find(...)` (ordered icon objects) instead of the bare `ICONS` array, and preserves the existing no-`markProjectDirty` behavior. The single user-facing call site (the counter Create tab's "Manage icons…" link, `#counterManageIcons` in [features/counter.js](features/counter.js) — re-homed out of Settings → Advanced, T2 #29) calls `App.openManageIconsModal()` | | [manage-icons.spec.js](manage-icons.spec.js) | Playwright regression for pilot #4 — uploads `test-2pages.pdf`, asserts `window.App.openManageIconsModal` + the 5 publish-only deps (`getOrderedIcons`/`iconVbFor`/`getUserCustomIcons`/`saveUserCustomIcons`/`showToast`) are functions, then exercises rename (set the first built-in row's input, `#manageIconsSave`, assert `state.iconNames[firstPath]`), reorder (reopen, `button[data-action="bottom"]` on the first row, Save, assert `state.iconOrder` ends with the former-first path), and custom delete (seed via `App.saveUserCustomIcons`, reopen, `#manageIconsEditToggle`, check the custom row's `.icon-select-cb`, `#manageIconsDeleteSelected`, assert `getUserCustomIcons().length === 0` and the custom section hides); asserts no console / page errors; `npx playwright test manage-icons.spec.js` | | [features/multiply-zone-settings.js](features/multiply-zone-settings.js) | Fifth feature-file split (`window.App` registry pilot #5) and the **first needing no new published deps** — the Multiply Zone **settings** modal (`openMultiplyZoneSettingsModal` + its `multiplyZoneSettingsShowLabelBtn`/`multiplyZoneSettingsLabelSize`/`multiplyZoneSettingsClose` handlers). Its own IIFE loaded **after** [app.js](app.js); reads shared `state`/helpers from `window.App` at call time, registers `App.openMultiplyZoneSettingsModal`, binds the modal's toggle/slider/Close at load. Every dep (`state`, `showModal`, `hideModal`, `markProjectDirty`, `renderPdf`, `updateUI`) was already on `App`. Scope is the settings modal only — the Multiply Zone **apply** flow (X-tool draw, `multiplyZoneModal`, `getMultiplyZoneForPoint`/`...ForLine`) stays in app.js. app.js's 2 call sites (right-click on the header / sidebar Multiply Zone button) call `App.openMultiplyZoneSettingsModal()` | @@ -420,7 +420,7 @@ Contract: `App.renderCountersList`, `App.renderLineTypesList`, `App.DROP_ICON_STYLES`, …). Some entries are "publish-only" — the function stays defined in app.js because it is used widely there, and is merely exposed on `App` (e.g. `ensureActiveCanvas`, - `getMaxZoom`, `getWheelZoomSpeed`, `getOrderedIcons`, `iconVbFor`, + `getMaxZoom`, `getWheelZoomSpeed`, `getDeviceZoomCeiling` (DEEP-ZOOM), `getOrderedIcons`, `iconVbFor`, `getUserCustomIcons`, `saveUserCustomIcons`, `showToast`, the 9 Export PDFs deps `getPageCanvases`/`renderAnnotationsToContext`/`addReportPagesToPdf`/ `addHighlightsToPdf`/`addNotesToPdf`/`hasAnyHighlights`/`hasAnyNotes`/ @@ -907,6 +907,8 @@ Annotated, in rough order: | Page rotation | `rotatePage90` or `page.rotation` | | Rotation/share orientation guard | `bakeFrame` or `computePageBakeFrame` or `verifyPageBakeFrame` or `bakeFramesMatch` (geometry.js) or `page.bakeMismatch` | | Canvas-blank-at-zoom guard | `renderAreaSafety` or `canvasCornerReadsBack` or `effectiveDpr` or `getCanvasCaps` | +| Deep-zoom overlay window (sharp marks past the canvas budget) | `renderAnnotationWindow` or `paintOverlay` or `annWindowBox` or `recutOverlayWindow` (app.js `// SECTION: Deep-zoom overlay window`; the canvas is `#annWindowCanvas`) | +| Zoom ceiling (the project's under the device's) | `deviceZoomCeiling` or `getProjectMaxZoom` or `DEVICE_ZOOM_CEILING`; the backdrop budget `DEEP_ZOOM_BASE_MAX_AREA` | | Counter/Line Type details modal | `openCounterLineTypeDetailsModal` (features/item-details.js) | | Line Properties modal | `openLinePropertiesModal` or `closeLinePropertiesModal` (features/item-details.js) | | Supabase auth | `initSupabaseAuth` or `state.supabaseSession` | @@ -1436,7 +1438,10 @@ Everything below is built on top of the [RECONSTITUTE.md](RECONSTITUTE.md) core. so the soft overlay never halos the crisp marks and stands only in the strips a pan reveals; the aim loupe samples the crop canvas and the window where they stand. Past 4× the full-page canvas is only a backdrop under the tiles and the window, so `effectiveDpr` holds it to 24 Mpx - (`DEEP_ZOOM_BASE_MAX_AREA`). Spec: [deep-zoom.spec.js](deep-zoom.spec.js). + (`DEEP_ZOOM_BASE_MAX_AREA`). Zoom Settings ([features/zoom.js](features/zoom.js)) runs its + slider to the device's ceiling, shows the project's own held to it with a hint where the device + holds it, and writes `state.maxZoom` only when the slider moved; the rail's ticks gain 2000, 3000 + and 5000 where the ceiling allows. Spec: [deep-zoom.spec.js](deep-zoom.spec.js). - **Zoom Rail** — clicking the footer zoom % toggles a giant floating vertical slider on the right edge ([features/zoom-rail.js](features/zoom-rail.js)): log-scale track with labelled tick marks, a draggable accent-yellow %-readout diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bbd70d1..b36ade8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,38 @@ expired recovery UX" work occupies that slot). --- +## docs: the hand-kept lists caught up to main at ec29abc (2026-10-14) + +A read of AGENTS.md, ARCHITECTURE.md, RECONSTITUTE.md, SUPABASE_SETUP.md, FEATURES.md, +FEATURE-CATALOG.md, PUNCHLIST.md, the guides and the DEEP-ZOOM plan against the code after the +three PRs since the pass at 655a023 (#335 the DEEP-ZOOM row and plan, #336 the feature, #337 its +live check). The feature wrote its CHANGELOG entry, its ARCHITECTURE rows and catalog bullet and +AGENTS.md's `maxZoom` field; what drifted was around them. + +- **RECONSTITUTE.md.** The coordinate contract said `toCanvas` multiplies by `state.zoom * + devicePixelRatio`; it has been the render zoom and the effective density since the rung blits, + and DEEP-ZOOM gave it a third term, the overlay window's origin. Both bullets say so, and the + rendering pipeline names the second overlay target. +- **ARCHITECTURE.md.** The zoom.spec row described one of its three tests and none of the + DEEP-ZOOM change (the slider's max is the device's ceiling, not a literal 1200); the two zoom + feature rows ran their DEEP-ZOOM sentence onto the previous one with no period; the Deep zoom + catalog bullet said nothing of Zoom Settings or the rail's three new ticks; the grep table had + no row for the overlay window or the ceiling; the registry's publish-only examples gain + `getDeviceZoomCeiling`. +- **FEATURES.md and FEATURE-CATALOG.md.** A line and an entry for deep zoom (the feature wrote + neither). +- **PUNCHLIST.md.** The DEEP-ZOOM row was closed on ship, but the plan's Decisions still read + "Assumed, Will to confirm" for the two ceilings and its Tests still owe one run on Wendi's + machine: row DEEP-ZOOM-CONFIRM, a ⚑ call, points at both. The plan's intro said "Nothing is + built" above its own Built section; fixed, and Decisions names the row. +- features/zoom.js's header names the third publish-only dep it reads; sw.js restamped. +- Not touched: SUPABASE_SETUP.md (nothing under supabase/ changed), the guides (none names a + zoom ceiling), JOURNEY-MAP.md, the deck, DECOMPOSITION_MAP.md (a dated reading at 65f712f; its + line that `renderAnnotationsInner` is untouched and untested predates the `paintOverlay` split + and deep-zoom.spec.js, and the next `build:projectmap` reading supersedes it). Pre-existing, + not from these PRs: aim-loupe-desktop, aim-loupe-phase2, measure-loupe and zoom-canvas-cap + have no ARCHITECTURE Files row. + ## feat(zoom): zoom past 1200% with a sharp overlay window (DEEP-ZOOM, 2026-10-14) Wendi wanted to zoom in past 1200%, and at depth her marks blurred while the sheet stayed crisp. @@ -55,6 +87,7 @@ The plan (journeys/plans/DEEP-ZOOM.md, measured on main the same day) in three p buffer at 23,994,600 px, the tiles live, the ratchet at 0.5, a probe on the seeded run in the window its colour and clear one CSS px above it. Before the merge the same sheet at the old 1200% ceiling drew the icons soft and the runs three pixels fat beside crisp plan text. + ## docs: the hand-kept lists caught up to main at 655a023 (2026-10-13) A read of AGENTS.md, ARCHITECTURE.md, RECONSTITUTE.md, SUPABASE_SETUP.md, FEATURES.md, diff --git a/FEATURE-CATALOG.md b/FEATURE-CATALOG.md index c49cf568..28918f81 100644 --- a/FEATURE-CATALOG.md +++ b/FEATURE-CATALOG.md @@ -328,6 +328,15 @@ sheet re-renders for seconds after every zoom and the view "moves under you." *Useful because:* Rendering is cached, ladder-stepped, and moved off the main thread, so zooming a dense CAD sheet re-sharpens continuously instead of freezing. +**Deep zoom (to 5000%)** +*Problem:* A congested detail (a stacked riser, a packed mechanical room) needs more than 1200%, +and at depth the marks used to blur against the still-crisp sheet, while older builds went white or +black from "too many pixels." +*Useful because:* The ceiling is 5000% on a capable device (1200% on a phone or a small-memory one; +the project's own setting rides the save, never the device's), the visible area gets its own +full-density overlay so counters, numbers and length labels stay as sharp as the plan's line work, +and the full-page backdrop is budgeted so deep zoom uses less memory than 1200% did. + **Background page warm-up** *Problem:* Jumping deep into a 40-page set means a cold multi-second render on every first visit. *Useful because:* After a document opens, idle time pre-renders every page (your marked pages diff --git a/FEATURES.md b/FEATURES.md index de1007e7..adf56602 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -70,6 +70,7 @@ Compiled 2026-07-31 from the live app, ARCHITECTURE.md's feature catalog, and th ## Speed & navigation - **Instant zoom & pan (wheel, pinch, zoom rail)** — Big, dense sheets stay responsive — zoom commits are served from cache so the view sharpens immediately instead of re-rendering for seconds. +- **Deep zoom (to 5000%)** — Zoom in to 5000% on a desktop (1200% on a phone or a small-memory device) and the marks stay as crisp as the sheet: the visible area gets its own full-density overlay, so a congested detail reads at any depth with no white or black canvas. - **Background page warm-up** — After a document opens, every page pre-renders in idle time, so jumping deep into a 40-page set is instant instead of a cold multi-second load. - **Offline-grade caching of rendered pages** — Sheets you visited render from a persisted cache on reopen — yesterday's project opens warm today. - **Aim loupe (mobile)** — Press-and-hold magnifier for precise mark placement with a finger. diff --git a/PUNCHLIST.md b/PUNCHLIST.md index 48d11df5..682d8428 100644 --- a/PUNCHLIST.md +++ b/PUNCHLIST.md @@ -39,3 +39,4 @@ How agents add to this list: AGENTS.md, "Recording a to-do". | ICON-STORE | Opening a project REPLACES the user's own icon store with its `customIconPaths` (annotation-model.js:509 and 444 into app.js:209, wholesale; a project with an empty list empties the store), and they ride the user's later saves. Since #268 they are inert, but should a project be able to add icons to a user's store at all? Decide, then build | decision | ⚑ call | — | | | DEMO-TRACK | The demo track behind the test drive's "Try it" is built for all three trades (phases 1 to 3 landed 2026-10-02). Left: a tester's real tablet and phone walk with a stopwatch against the 60 s target | test | tester | — | [DEMO-TRACK.md](journeys/plans/DEMO-TRACK.md#open-after-phase-2) | | BOARD-QUIET | All Bids for a lead: the board becomes a quiet list, actions on the hovered row, exceptions only, grouped by estimator once there are enough; PEOPLE-TWINS, REVIEW-BAR, DROP-CARD-BUTTONS and CLOUD-OFF-ICON shipped the first steps (the twin fleet off by default, the decision in the opened bid only, oldest waiting first, the cloud silent unless the PDF is missing) | build | agent | — | [BID-BOARD-QUIET.md](journeys/plans/BID-BOARD-QUIET.md#what-is-left) | +| DEEP-ZOOM-CONFIRM | Zoom past 1200% shipped 2026-10-14 on two assumed ceilings: 5000%, and 1200% on a phone, a small canvas cap or a low-memory Chromium (one constant each, app.js `deviceZoomCeiling`). Will confirms both or names others; then one run on Wendi's machine at 3000% (her Save Status export carries the probed canvas cap, the safety knob and any blank events) | decision | ⚑ call | — | [DEEP-ZOOM.md](journeys/plans/DEEP-ZOOM.md#decisions) | diff --git a/RECONSTITUTE.md b/RECONSTITUTE.md index d7ccbff0..26ec8925 100644 --- a/RECONSTITUTE.md +++ b/RECONSTITUTE.md @@ -120,8 +120,12 @@ All annotations are stored in **PDF-space** (zoom- and pan-independent), so the takeoff is stable across zoom levels and screen sizes. Three helpers own the conversion (see `// SECTION: Coordinate Helpers`): -- `toCanvas(p)` — PDF-space -> canvas pixels. Multiplies by - `state.zoom * devicePixelRatio`. +- `toCanvas(p)` — PDF-space -> canvas pixels. Multiplies by the render zoom and the + effective density, `currentRenderZoom * currentEffDpr` (`state.zoom * devicePixelRatio` + when the raster is exact; a rung blit holds the zoom at the rung and the canvas budget + clamps the density), and while the deep-zoom overlay window paints it also subtracts + the window's origin, `overlayOffset` (zero for the page pass; DEEP-ZOOM 2026-10-14, + ARCHITECTURE.md "Deep zoom"). - `canvasToPdf(canvasX, canvasY)` — canvas/wrapper coords -> PDF-space. Divides by `state.zoom` after subtracting `state.pan`. - Never store canvas pixels in annotations; always convert to PDF-space first. @@ -167,7 +171,10 @@ events -> handlers -> mutate state -> render `state.zoom * devicePixelRatio`, copies it to the visible PDF canvas, then calls `renderAnnotations()`. - `renderAnnotations()` draws the active canvas's annotations onto the annotation - canvas (converting PDF-space -> canvas pixels via `toCanvas`). + canvas (converting PDF-space -> canvas pixels via `toCanvas`), and past the canvas + budget once more onto the overlay window, the visible area at full density + (`renderAnnotationWindow`, the same `paintOverlay` body), so the marks stay as sharp + as the sheet at deep zoom. - `updateUI()` reconciles the DOM (sidebar lists, buttons, status bar) with `state`. - `renderAnnotationsToContext(ctx, page, scale, overrides, annotationsOverride)` diff --git a/features/zoom.js b/features/zoom.js index 75ed3784..15564e6a 100644 --- a/features/zoom.js +++ b/features/zoom.js @@ -10,7 +10,8 @@ * and binds the modal's Close / max / speed inputs at this file's load. * * getMaxZoom / getWheelZoomSpeed stay defined in app.js (used in ~10 places - * there) and are read here via App.*. Boundary rule: all shared dependencies + * there) and are read here via App.*, as is getDeviceZoomCeiling since DEEP-ZOOM + * (the slider's max and its hint). Boundary rule: all shared dependencies * are read from App.* at call time, never captured at load, so load order * beyond "after app.js" does not matter. See ARCHITECTURE.md "Feature files / * window.App registry". No build step. diff --git a/journeys/plans/DEEP-ZOOM.md b/journeys/plans/DEEP-ZOOM.md index 8c88c614..b90a40c9 100644 --- a/journeys/plans/DEEP-ZOOM.md +++ b/journeys/plans/DEEP-ZOOM.md @@ -3,7 +3,7 @@ Will, 2026-10-14: Wendi wants to zoom in past 1200%. The fear is the white or black canvas from "too many pixels", which the app had before. Investigated and measured on main at 655a0231 the same day; the proposal below was approved and then handed to another builder. -Nothing is built. Mockups: none needed; the measurements and screenshots were taken on the +Built the same day, all three parts (see Built, below). Mockups: none needed; the measurements and screenshots were taken on the real app on the restaurant sheet (`samples/sample-plan-advanced.pdf`, P-101, 1224×792 pt). ## What the measurements say @@ -149,3 +149,5 @@ Live check: see CHANGELOG.md's DEEP-ZOOM entry. ## Decisions Assumed, Will to confirm: the ceiling is 5000%, and phones and small-cap devices hold 1200%. +Open as PUNCHLIST row DEEP-ZOOM-CONFIRM (2026-10-14), together with the run on Wendi's machine +under Tests above. diff --git a/sw.js b/sw.js index 88747061..ba5c2b0a 100644 --- a/sw.js +++ b/sw.js @@ -23,7 +23,7 @@ * visit once the CDN has settled. The app's admin "global force reload" clears caches * as a backstop. */ -const CACHE_VERSION = 'b681d94c35ef'; +const CACHE_VERSION = '09b60244e400'; const CACHE_NAME = `counttooling-shell-${CACHE_VERSION}`; // The full same-origin app shell. GENERATED by `npm run build:sw`, do not edit by hand: @@ -281,7 +281,7 @@ const PRECACHE_SHA256 = { '/features/line-color.js': '2fd4c7594f1a3686fd9323b7bc4d97f5b9c151b32475d5a4428062a075378ecb', '/features/custom-icon-upload.js': 'cf0d6731862f3baa8b7ed55cbfc89759df42934f52d1c22586ac37d3b406ab06', '/features/note.js': 'b7cc88aa00ac8a2450c59299959108ae3bd5b18b0e420fd61264533c23347d6b', - '/features/zoom.js': '5bfd9362c676102d514c4b1e90cd2ca9b4a2d679f15ea134a30aac8935cf53a3', + '/features/zoom.js': '119f2fa59ab960e977a348a2fb2d292d02fe2199f7f9f078d4d257f709c9a8b9', '/features/zoom-rail.js': '408522adca830c44fc407ce1cf143097782c255c4b20261efb7119ff9a7edd1b', '/features/manage-icons.js': '9da0efb19f2e86b1d3b2f1d9bd6eda2a12ae3e307abba3a9f2c9b5da8d646382', '/features/multiply-zone-settings.js': 'e808757a5758d7c0ba64d989ef3f6e051266b40a26ff01ae9ea8187b7b834dee',