Commit Graph

8 Commits

Author SHA1 Message Date
Randy Fischer 684b89b8fc Add Engelsman, Kruising types and rebuild Overwegbevloering diagram
Three new inspection types based on analyzed reference diagrams:
- Engelsman (half/heel): 5-section layout with DWL/BAL scoring
- Kruising (incl. ingesloten): 4-section layout with DWL/BAL scoring
- Overwegbevloering: rebuilt as spatial diagram with 14 photo
  positions (sticker, spoorbord, 6x lage km, 6x hoge km)

Wissel subtype detection from SOORT field in SAP XML. Shared
DWL/BAL logic via usesDwlBal() helper. Section maps per type.
Overview photo export now includes all types.
2026-04-16 08:25:45 +02:00
Randy Fischer 6162b1b644 Add session summary and switch inspection diagram docs 2026-04-16 08:09:09 +02:00
Randy Fischer f2f9b65916 Add multi-inspection-type routing for Wissel, Overweg, and Spoor
Route inspection forms by objectsoort/EQART from CSV or SAP XML.
Each type gets its own header fields, assessment table layout,
overview photo grid, and XML export format. CSS toggles type-specific
sections via body class. SW cache bumped to v3.
2026-04-16 08:09:02 +02:00
Randy Fischer b005193dbc Request persistent storage after first save
IndexedDB data can be evicted under storage pressure, especially on iOS
Safari. navigator.storage.persist() asks the browser to keep our data. On
Chromium+Firefox it succeeds silently when conditions allow (installed PWA,
engagement heuristics); on Safari it typically grants only for installed
PWAs.

- persistentStorage.js: isPersisted() and requestPersistence() with graceful
  fallback when the Storage API is unavailable.
- persistence.js: request persistence once, after the first successful save —
  a heuristic that works across Firefox (user gesture context) and
  Chromium/Safari (data-stored context).
- sw.js: bump cache version, precache new file.
- index.html: load new script.
2026-04-15 15:54:06 +02:00
Randy Fischer 92ad6a92e3 Persist uploaded order CSVs across app restarts
Uploaded CSVs previously lived only in memory; reloading the app reset the
order list to the embedded SEED_ORDERS_CSV. Now every upload is written to a
new IndexedDB store so inspectors keep their order list after closing/reopening
the PWA.

- db.js: bump DB_VERSION to 4, add object store `ordersCsv` (keyPath 'id'),
  saveOrdersCsv(csvText) and loadOrdersCsv().
- csvLoader.js: loadOrdersFromUpload returns { text, orders } so the handler
  can persist the raw text alongside the parsed result.
- main.js: init() prefers the stored CSV, falls back to SEED_ORDERS_CSV. The
  upload handler persists the CSV before re-rendering.
2026-04-15 15:47:15 +02:00
Randy Fischer e86aa5bae2 Store photos as native Blobs instead of base64 data URLs
IndexedDB stores Blobs via structured clone, eliminating the ~33% base64
overhead and avoiding a round-trip through FileReader on every capture.

- photoService.js: capture pushes { blob: file } directly; render sets img.src
  via URL.createObjectURL(p.blob); openLightbox/closeLightbox revoke blob URLs.
- db.js: drop JSON.parse(JSON.stringify(...)) clone which stripped Blobs;
  IndexedDB put() performs structured clone internally.
- exportService.js: download p.blob directly.
- utils.js: remove readFileAsDataUrl and dataUrlToBlob (both unused).
2026-04-15 15:40:09 +02:00
Randy Fischer 776bd6366d Add PWA-ready MVP: split HTML/CSS/JS + DDD layering + service worker
- public/index.html: markup-only entry, classic <script> tags, no inline styles/handlers.
- public/css/: base, overview, form, modals, install, responsive stylesheets.
- public/js/: namespace bootstrap + main wiring (event handlers, init).
- public/manifest.webmanifest + icons/icon.svg + sw.js: installable, offline app shell.
- src/Domain: sectionMap, scoring, orderParser (pure, no I/O).
- src/Application: state, persistence, screens, inspection form, order overview,
  photo service, XML import, export, PWA registration, install screen.
- src/Infrastructure: IndexedDB, geolocation, utils, seed CSV, CSV upload parser.

Runs from file:// (PWA gated off) and from http(s)/localhost (PWA fully active).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 15:25:38 +02:00
Randy Fischer 367bbca688 Initial repo scaffold on develop
Baseline: .gitignore, README, empty _docs/. App code follows in a feature branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 15:24:55 +02:00