Per-property photos, project tracking, and photo optimization #116

Open
opened 2026-06-06 11:11:02 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Standalone -- emerged from auth/tab planning session (2026-06-06). Replaces the current standalone Photos tab with per-property functionality.

Repo

ldraney/landscaping-assistant

User Story

As a crew member, I want to take photos and track projects per property so that work is documented where it belongs -- on the property, not in a separate tab.

Context

The current Photos tab is a flat list of uploads disconnected from properties. Photos and project tracking belong on the property detail page. The standalone Photos tab should be removed from the nav.

What changes:

  • Remove the Photos tab from bottom nav (drops from 5 tabs to 4, then to 3 once New is also merged into Properties)
  • Move photo upload/view to property detail page (per-property photo gallery)
  • Add per-property project tracking -- properties have specific projects beyond the current service types (mowing, weeding, trimming). A property might have a "patio install" or "tree removal" that needs tracking.
  • Crew members (all roles) can take photos and ask questions per property
  • Photo optimization pipeline: compress images for MinIO storage while preserving quality as much as possible (client-side resize before upload, or server-side processing with image_processing gem / libvips)

Photo optimization considerations:

  • Current: photos go straight to MinIO via ActiveStorage with no processing
  • Needed: resize large phone photos (often 4000x3000+ at 5-10MB) to a reasonable size for storage
  • Approach: ActiveStorage variants (Rails built-in) with libvips for server-side resize, or client-side resize via canvas before upload
  • Preserve originals or not -- TBD (storage cost vs quality needs)

File Targets

  • app/views/layouts/application.html.erb -- remove Photos tab from nav
  • app/views/properties/show.html.erb -- add photo gallery + upload section
  • app/models/upload.rb -- add belongs_to :property association
  • app/models/property.rb -- add has_many :uploads
  • db/migrate/ -- add property_id to uploads, add project tracking model
  • app/controllers/uploads_controller.rb -- scope to property
  • config/routes.rb -- nest uploads under properties
  • app/models/project.rb (new) -- per-property project tracking

Acceptance Criteria

  • Photos tab removed from bottom nav
  • Photos upload and gallery live on property detail page
  • Each photo belongs to a property
  • Per-property project tracking (beyond fixed service types)
  • Crew can take photos from the property detail page
  • Photos are optimized before or after upload (target: under 500KB per photo while maintaining usable quality)
  • Existing photos migrated to property association (or orphaned photos handled gracefully)

Test Expectations

  • Model specs: Upload belongs_to Property, Property has_many uploads
  • Request specs: upload scoped to property, photo list on property show
  • Run: bundle exec rspec

Constraints

  • Use ActiveStorage variants with libvips (already available in the Ruby base image) for server-side optimization
  • MinIO remains the storage backend
  • Must work on mobile (camera capture input)
  • Migration must handle existing uploads that have no property_id

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #33 -- original photo upload ticket
  • #107 -- auth (tab visibility depends on role)
### Type Feature ### Lineage Standalone -- emerged from auth/tab planning session (2026-06-06). Replaces the current standalone Photos tab with per-property functionality. ### Repo `ldraney/landscaping-assistant` ### User Story As a crew member, I want to take photos and track projects per property so that work is documented where it belongs -- on the property, not in a separate tab. ### Context The current Photos tab is a flat list of uploads disconnected from properties. Photos and project tracking belong on the property detail page. The standalone Photos tab should be removed from the nav. **What changes:** - Remove the Photos tab from bottom nav (drops from 5 tabs to 4, then to 3 once New is also merged into Properties) - Move photo upload/view to property detail page (per-property photo gallery) - Add per-property project tracking -- properties have specific projects beyond the current service types (mowing, weeding, trimming). A property might have a "patio install" or "tree removal" that needs tracking. - Crew members (all roles) can take photos and ask questions per property - Photo optimization pipeline: compress images for MinIO storage while preserving quality as much as possible (client-side resize before upload, or server-side processing with image_processing gem / libvips) **Photo optimization considerations:** - Current: photos go straight to MinIO via ActiveStorage with no processing - Needed: resize large phone photos (often 4000x3000+ at 5-10MB) to a reasonable size for storage - Approach: ActiveStorage variants (Rails built-in) with libvips for server-side resize, or client-side resize via canvas before upload - Preserve originals or not -- TBD (storage cost vs quality needs) ### File Targets - `app/views/layouts/application.html.erb` -- remove Photos tab from nav - `app/views/properties/show.html.erb` -- add photo gallery + upload section - `app/models/upload.rb` -- add `belongs_to :property` association - `app/models/property.rb` -- add `has_many :uploads` - `db/migrate/` -- add property_id to uploads, add project tracking model - `app/controllers/uploads_controller.rb` -- scope to property - `config/routes.rb` -- nest uploads under properties - `app/models/project.rb` (new) -- per-property project tracking ### Acceptance Criteria - [ ] Photos tab removed from bottom nav - [ ] Photos upload and gallery live on property detail page - [ ] Each photo belongs to a property - [ ] Per-property project tracking (beyond fixed service types) - [ ] Crew can take photos from the property detail page - [ ] Photos are optimized before or after upload (target: under 500KB per photo while maintaining usable quality) - [ ] Existing photos migrated to property association (or orphaned photos handled gracefully) ### Test Expectations - Model specs: Upload belongs_to Property, Property has_many uploads - Request specs: upload scoped to property, photo list on property show - Run: `bundle exec rspec` ### Constraints - Use ActiveStorage variants with libvips (already available in the Ruby base image) for server-side optimization - MinIO remains the storage backend - Must work on mobile (camera capture input) - Migration must handle existing uploads that have no property_id ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #33 -- original photo upload ticket - #107 -- auth (tab visibility depends on role)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#116
No description provided.