Add photo station reuse workflow#53
Conversation
e2a49cd to
06b4580
Compare
jasonmadigan
left a comment
There was a problem hiding this comment.
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 usedatetime.now(timezone.utc)startCamerain trace page is not wrapped inuseCallbackand missing fromuseEffectdependency array -- React rules-of-hooks violation- trace page now has 16
useStatehooks with interleaved station state. the station logic should be extracted to ausePhotoStationhook or dedicated component - duplicated station creation logic between
POST /photo-stationsendpoint and inline inset_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.999in_is_full_capture_cropshould be named constants _loadsilently swallows all exceptions withexcept 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.
Summary
Review context
main(745aec8).Tests
backend\venv\Scripts\python.exe -m pytest backend\tests\test_photo_stations.pybackend\venv\Scripts\python.exe -m pytest backend\tests\test_bin_projects.py backend\tests\test_workflow_metadata.pynpm exec -- tsc --noEmitnpm run buildgit diff --checkCode and PR drafted with Codex.