Commit Graph

11 Commits

Author SHA1 Message Date
Ty 8749b07611 Fix preview cropping: canvas fits within viewport, preserves aspect ratio
.preview was width:100% inside max-height:50vh container — tall photos
were clipped. Now: max-width:100%, max-height:50vh, width/height auto,
object-fit:contain, flex-centered in the wrap.

Added e2e regression test: loads a photo, verifies the canvas bounding
box fits the viewport, preserves aspect ratio, and is not clipped by
the container.
2026-09-14 11:51:44 -07:00
Ty f00c4a7460 UAT-8a: rotate the rect, not a separate axis vector
reduceAxisState 'rotate' now changes state.rect.angle and re-derives
state.axis via axisFromRect(newRect). The rectangle rotates as a whole;
the axis for Measure is derived from the rotated rect's long side.

2 new regression tests: rect.angle changes on rotate, axis is
re-derived from rotated rect. 109/109 tests green.
2026-09-14 11:23:00 -07:00
Ty 0d06e6f7b7 UAT-3: browser gate (hard stop) + iPad Safari fix
Spec CAPTURE.md §Browsers: Phone iOS Safari / Android Chrome, PC
Chrome / Edge / Firefox, others hard stop.

- browserGate.js: UA detection + allowlist (pure, DOM-free)
- +layout.svelte: renders hard-stop panel when unsupported
- iPadOS 13+ reports as Macintosh — added Safari rule (Version/ +
  Safari/ without Chrome/) so iPad Safari is not blocked
- 27 unit tests incl. iPad Safari regression
- 107/107 full suite green
2026-09-14 07:44:49 -07:00
Ty a83c9239ff UAT-7: fix auto key selection — prefer key that removes more background
Root cause: auto selected the key with MORE kept pixels, which always
picked the green key (it keeps 100% of dark non-green backgrounds).
The black key correctly isolates the slab on dark surfaces.

Fix:
- auto now prefers the key with FEWER kept pixels (removed more bg)
  when both are non-empty
- green key has a greenness pre-filter: non-greenish pixels pass
  through (kept) so the black key can handle them, instead of the
  green key keeping 100% of a dark surface
- added 3 regression tests: dark-bg auto selection, green-sheet auto
  selection, green-key passthrough on non-green surfaces

106/106 unit tests green.
2026-09-14 07:41:51 -07:00
Ty 88b9c47200 UAT-4: remove non-spec controls (edge offset, feather) from Mask UI
Spec CAPTURE.md §Mask lists exactly two controls: Sheet and Sensitivity. Edge offset and feather nudge buttons were extra. Removed from the UI; core params (edgeOffset, feather) remain in maskState.js, still unit-tested.
2026-09-14 07:24:42 -07:00
Ty b124450d0c M1-5: Measure + PNG + full capture UI (TDD)
- measure.js: sampleWidthsPx scanline sampler
- inventory.js: prepareInventoryMetadata
- +page.svelte: full 4-state capture flow (Add photo, Mask, Axis, Measure)
- Canvas overlay: checkerboard mask, bounding rect, axis line
- Inventory PNG: 3:4 portrait, slab centered 80% fill, alpha
- 77/77 unit tests green
2026-09-14 02:11:28 -07:00
Ty 507865e30b Add e2e fixtures: slab-green.jpg, sheet-only-green.jpg, slab.heic 2026-09-14 00:43:58 -07:00
Ty 0284a2211a M1-4: Length axis (TDD)
- Add axis.js: length axis rectangle state, 28 tests
- 71/71 unit tests green
2026-09-14 00:32:42 -07:00
Ty 7e2a1845cf M1-3: Capture + Mask state (TDD)
- Add maskState.js: sheet Auto/Green/Black, sensitivity, edge offset, feather
- Overlay = slab photo + checkerboard on removed px
- Debounced recompute 2.0s after last sensitivity change
- Approve blocked when maskStats empty
- HEIC shows retake notice
- Refactored mask.test.js + extended e2e mask.spec.js
- 43/43 unit tests green
2026-09-14 00:02:36 -07:00
Ty dd011207a0 feat(m1-2,m1-3): deterministic core + mask keying (TDD, green)
Card 2 (deterministic core) + Card 3 (capture+mask geometry):
- src/lib/core/math.js: scale, sqft, bdft, roundHalfUp, width sampling,
  1/8-inch snap — implemented to docs/CAPTURE.md identities.
- src/lib/core/mask.js: keySheet green/black/auto chroma keys + maskStats.
  - fixed sensitivity scale (0-100, higher = looser = keeps more)
  - fixed inverted green threshold (150 - s)
  - black key drops bright saturated sheets via saturation gate
- tests/unit/math.test.js: corrected 3 wrong expected values to match the
  spec (sqft 21x12in = 1.75 not 17.5; bdft 3.06; sample avg 11.25).
- tests/e2e/mask.spec.js: skeleton, skipped pending M1-5 live UI.

Full unit suite green: 24/24. E2e collects clean.
2026-09-13 23:17:36 -07:00
Ty 93666320ef feat(m1-1): scaffold SvelteKit + Dockerfile + TDD test harness
- SvelteKit (JS, adapter-node) home page + /api/health route
- frontend/Dockerfile multi-stage build->serve (slabuploader-m1:local, 349MB)
- Test harness: Vitest unit + Playwright e2e; smoke tests RED->GREEN verified
- Build, image build, and image serve all verified
2026-09-13 22:55:34 -07:00