8000 Add photo station capture and reuse workflow by noobydp · Pull Request #137 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Add photo station capture and reuse workflow - #137

Open
noobydp wants to merge 2 commits into
tracefinity:mainfrom
noobydp:codex/photo-stations-capture-reuse
Open

noobydp wants to merge 2 commits into
tracefinity:mainfrom
noobydp:codex/photo-stations-capture-reuse

Conversation

@noobydp
@noobydp noobydp commented Jul 11, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Adds the reusable photo-station workflow to tracing: camera capture with capture-area cropping, saved station corners and matching suggestions, corner redetection, save-as-station, and a save-and-new loop for repeated captures. The /trace capture page and trace editor keep station-only controls behind PHOTO_STATIONS=1.

Review follow-up

  • A saved station can only Skip to Save on an existing photo when that exact station was applied to the capture. Changing stations takes the user through Corners instead.
  • Camera streams are stopped if permission resolves after unmount or a newer request, and the active stream remains usable when quick processing fails.
  • Capture is single-flight from frame encoding through upload; station reuse, redetection, and Continue share a single corner-operation lock.
  • Tracer preference reads and writes are best effort when browser storage is unavailable.
  • Added regression tests for the camera races, failed quick processing, and blocked browser storage.

Dependencies

Photo-station backend (#135) and management UI (#136) have merged. This branch is now based on current main and contains one focused commit.

Validation

  • Manually tested the camera, station, corners, and save-and-new/Skip to Save flows in the app against a copy of an existing local data library (20 September 2026).
  • Frontend: 233 tests passed; TypeScript check and production build passed; lint passed with 9 existing warnings and no errors.
  • Backend: 27 photo-station tests passed; ruff passed. The complete suite on Windows had 778 passes and 26 failures in POSIX-specific permission, ownership, and symlink tests; GitHub Linux CI passed the complete backend suite, frontend tests, end-to-end checks, and workflow checks.

Code and PR drafted with Codex

@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.

thanks @noobydp

Comment thread backend/app/api/routes.py Resolved
Comment thread backend/app/api/routes.py Resolved
Comment thread backend/app/models/schemas.py Resolved
Comment thread backend/app/models/schemas.py Resolved
Comment thread backend/tests/test_photo_stations.py Resolved
Comment thread backend/app/api/routes.py Resolved
@noobydp
noobydp force-pushed the codex/photo-stations-capture-reuse branch from e308c71 to 77dbad3 Compare August 2, 2026 08:46
@noobydp
noobydp commented Aug 2, 2026
Copy link
Copy Markdown
Contributor Author

Updated this branch after review and rebased it onto current main, still stacked on PRs #135 and #136.

Changes made in this update:

  • Capture crop now runs before downscale through the ingestion path, so cropped station captures keep the intended resolution.
  • Station dimension mismatch is checked before upload persistence, preventing orphaned uploads when a saved station does not match the incoming image.
  • Capture and reuse flows respect the PHOTO_STATIONS feature flag and hide station-only UI when disabled.
  • Removed the unused station_image_path mirror from frontend types following the backend cleanup in Add photo station backend #135.
  • Added API coverage for capture upload params, station reuse params, and guarded station endpoints.
  • Added backend coverage for finite crop/corner validation, y-axis corner scaling, stale dimension rejection, and station suggestions.

Local validation:

  • python -m ruff check backend
  • python -m pytest tests/test_photo_stations.py
  • python -m pytest -k "not TestPermissionError" on Windows: 318 passed, 8 deselected for the existing Windows-only permission fixture issue.
  • corepack pnpm lint using the repo-declared pnpm@10.29.2: 0 errors, 9 existing warnings.
  • corepack pnpm exec tsc --noEmit

Code and PR drafted with Codex

@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.

Thanks again for splitting this up and working through the earlier feedback. A few workflow races remain; happy to re-review and look to merge once these are addressed.

Comment thread frontend/src/app/trace/page.tsx Resolved
Comment thread frontend/src/app/trace/page.tsx Resolved
Comment thread frontend/src/app/trace/page.tsx Resolved
Comment thread frontend/src/app/trace/page.tsx Resolved
Comment thread frontend/src/app/trace/[id]/page.tsx Resolved
Comment thread frontend/src/app/trace/[id]/page.tsx Resolved
@noobydp
noobydp force-pushed the codex/photo-stations-capture-reuse branch from 77dbad3 to 7ec7fd3 Compare September 20, 2026 05:31
@noobydp
noobydp marked this pull request as ready for review September 20, 2026 15:48
@noobydp
noobydp requested a review from jasonmadigan October 25, 2026 05:15
@noobydp
noobydp commented Oct 25, 2026
Copy link
Copy Markdown
Contributor Author

Updated this branch with current main (57d10f3) in 6155043. The merge applied cleanly, and GitHub reports no merge conflicts. The photo station capture and reuse changes remain focused in this PR.

Validation:

  • make lint passed: Ruff, ESLint and TypeScript. ESLint reports nine existing warnings and no errors.
  • cd backend && python -m pytest -q: 852 passed.
  • cd frontend && pnpm test: 285 passed.

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

0