Skip to content

Add photo station reuse workflow#53

Open
noobydp wants to merge 1 commit into
tracefinity:mainfrom
noobydp:codex/photo-station-reuse
Open

Add photo station reuse workflow#53
noobydp wants to merge 1 commit into
tracefinity:mainfrom
noobydp:codex/photo-station-reuse

Conversation

@noobydp

@noobydp noobydp commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Capture step for camera/upload workflows, including station selection, saved capture areas, and direct upload into the same Capture/Corners/Trace/Save flow.
  • Adds backend photo-station persistence, station-owned preview images, station suggestions, corner reuse, redetect-corners, and cleanup/normalization behavior.
  • Adds dashboard station management and a reused Corners page for editing saved station corners.
  • Adds the Save and New loop with station reuse, Skip to Save when station/tracer context is known, and tighter Select Tools controls.
  • Includes small workflow polish found while testing: project section preferences, bin layout hole rendering fix, solid popovers, light-mode 3D preview background, and project Add Tools button sizing.

Review context

Tests

  • backend\venv\Scripts\python.exe -m pytest backend\tests\test_photo_stations.py
  • backend\venv\Scripts\python.exe -m pytest backend\tests\test_bin_projects.py backend\tests\test_workflow_metadata.py
  • npm exec -- tsc --noEmit
  • npm run build
  • git diff --check

Code and PR drafted with Codex.

@noobydp noobydp force-pushed the codex/photo-station-reuse branch from e2a49cd to 06b4580 Compare May 31, 2026 15:40
@noobydp noobydp marked this pull request as ready for review May 31, 2026 15:44

@jasonmadigan jasonmadigan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes requested

blockers

PR scope -- at +2926 lines across 28 files, this bundles at least four independently shippable concerns: (1) photo station CRUD backend, (2) capture page + camera workflow, (3) save-and-new loop + skip-to-save, (4) misc polish (sidebar width, bin preview bg, popover surfaces, polygon sizing). splitting these would make review safer and revert cleaner.

fragile file deletion ordering -- in set_corners, orig_path and orig both resolve session.original_image_path via _abs(). copy happens from orig_path, then orig deletes the same file. works by accident of ordering. use a single variable or copy after the unlink guard.

should fix

  • datetime.utcnow() is deprecated since Python 3.12. new code should use datetime.now(timezone.utc)
  • startCamera in trace page is not wrapped in useCallback and missing from useEffect dependency array -- React rules-of-hooks violation
  • trace page now has 16 useState hooks with interleaved station state. the station logic should be extracted to a usePhotoStation hook or dedicated component
  • duplicated station creation logic between POST /photo-stations endpoint and inline in set_corners -- extract a shared helper
  • no test for LIST /api/photo-stations, no invalid input tests (wrong corner count, missing corners), no frontend tests

nits

  • sidebar width change (200px to 300px) is unrelated -- separate PR
  • magic tolerance 0.001/0.999 in _is_full_capture_crop should be named constants
  • _load silently swallows all exceptions with except Exception: self._stations = {} -- corrupt JSON silently loses all stations

good feature overall -- the station reuse concept is solid and the backend test coverage for the core workflow is thorough. the main ask is splitting this into smaller PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants