Schedule digest: feature flag gate + Week tab upload button #212

Closed
opened 2026-06-14 02:50:05 +00:00 by ldraney · 1 comment
Owner

Type

Feature

Lineage

Follow-up to #204 (done). The digest feature works but is buried in the Photos tab and lacks a feature flag for admin control.

Repo

ldraney/landscaping-assistant

User Story

As a super admin
I want the schedule digest feature behind a toggleable feature flag with a prominent entry point on the Week tab
So that I can control when this feature is active and crew leads can actually find it

Context

PR #208 shipped the schedule digestion feature (Claude Vision OCR -> WorkQueueItems). Currently the flow is: Photos tab -> individual photo show page -> "Digest Schedule" button. This is not discoverable for the weekly planning workflow.

Two changes:

  1. Feature flag: Gate the entire digest feature behind a schedule_digest flag (default OFF). When OFF, the "Digest Schedule" button on upload show pages is hidden, and the Week tab upload button doesn't appear. Controlled from /platform/feature_flags.
  2. Week tab entry point: Add an "Upload Schedule" button on the Week view (visible when flag is ON and user is lead+). Clicking it opens a photo upload flow that, on success, immediately redirects to the digest confirmation screen for that week.

File Targets

Files the agent should modify:

  • lib/tasks/feature_flags.rake -- add schedule_digest flag (default: false)
  • app/views/uploads/show.html.erb -- wrap "Digest Schedule" section in feature_enabled?(:schedule_digest) check
  • app/views/weeks/index.html.erb -- add "Upload Schedule" button (gated behind flag + lead+ role)
  • app/controllers/uploads_controller.rb -- gate digest and confirm_digest actions behind feature flag check

Files the agent should NOT touch:

  • app/services/schedule_digester.rb -- the service is fine, just gating the entry points
  • app/models/upload.rb -- no model changes
  • app/views/uploads/digest.html.erb -- the confirmation UI is fine
  • app/controllers/work_queue_items_controller.rb -- unrelated

Feature Flag

Flag: schedule_digest
Type: global
Default: disabled
Visibility: super_admin toggle at /platform/feature_flags
Removal: after 2 weeks stable in production

Acceptance Criteria

  • schedule_digest flag registered in feature_flags.rake sync task (default OFF)
  • When flag is OFF: "Digest Schedule" button hidden on upload show page
  • When flag is OFF: no "Upload Schedule" button on Week tab
  • When flag is OFF: digest and confirm_digest actions return redirect with "Feature not available" flash
  • When flag is ON: "Upload Schedule" button appears on Week tab for lead+ roles
  • When flag is ON: clicking "Upload Schedule" opens photo upload, then redirects to digest confirmation for the displayed week
  • Existing Photos tab upload flow still works regardless of flag state (uploading photos is not gated, only digestion is)

Test Expectations

  • Request spec: digest action returns redirect when flag is OFF
  • Request spec: digest action works when flag is ON
  • Request spec: week index includes upload button when flag is ON and user is lead+
  • Run command: bundle exec rspec spec/requests/uploads_spec.rb spec/requests/weeks_spec.rb

Constraints

  • Follow existing feature flag patterns (see pending_completion flag usage in weeks/index.html.erb)
  • CSS: match existing button styles on the Week tab, no Tailwind
  • The upload-then-digest flow from the Week tab should pass the current week's Monday as week_start automatically

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • landscaping-assistant -- project this affects
  • Issue #204 (done) -- Schedule image digestion (the feature being gated)
### Type Feature ### Lineage Follow-up to #204 (done). The digest feature works but is buried in the Photos tab and lacks a feature flag for admin control. ### Repo `ldraney/landscaping-assistant` ### User Story As a super admin I want the schedule digest feature behind a toggleable feature flag with a prominent entry point on the Week tab So that I can control when this feature is active and crew leads can actually find it ### Context PR #208 shipped the schedule digestion feature (Claude Vision OCR -> WorkQueueItems). Currently the flow is: Photos tab -> individual photo show page -> "Digest Schedule" button. This is not discoverable for the weekly planning workflow. Two changes: 1. **Feature flag:** Gate the entire digest feature behind a `schedule_digest` flag (default OFF). When OFF, the "Digest Schedule" button on upload show pages is hidden, and the Week tab upload button doesn't appear. Controlled from `/platform/feature_flags`. 2. **Week tab entry point:** Add an "Upload Schedule" button on the Week view (visible when flag is ON and user is lead+). Clicking it opens a photo upload flow that, on success, immediately redirects to the digest confirmation screen for that week. ### File Targets Files the agent should modify: - `lib/tasks/feature_flags.rake` -- add `schedule_digest` flag (default: false) - `app/views/uploads/show.html.erb` -- wrap "Digest Schedule" section in `feature_enabled?(:schedule_digest)` check - `app/views/weeks/index.html.erb` -- add "Upload Schedule" button (gated behind flag + lead+ role) - `app/controllers/uploads_controller.rb` -- gate `digest` and `confirm_digest` actions behind feature flag check Files the agent should NOT touch: - `app/services/schedule_digester.rb` -- the service is fine, just gating the entry points - `app/models/upload.rb` -- no model changes - `app/views/uploads/digest.html.erb` -- the confirmation UI is fine - `app/controllers/work_queue_items_controller.rb` -- unrelated ### Feature Flag Flag: `schedule_digest` Type: global Default: disabled Visibility: super_admin toggle at `/platform/feature_flags` Removal: after 2 weeks stable in production ### Acceptance Criteria - [ ] `schedule_digest` flag registered in `feature_flags.rake` sync task (default OFF) - [ ] When flag is OFF: "Digest Schedule" button hidden on upload show page - [ ] When flag is OFF: no "Upload Schedule" button on Week tab - [ ] When flag is OFF: `digest` and `confirm_digest` actions return redirect with "Feature not available" flash - [ ] When flag is ON: "Upload Schedule" button appears on Week tab for lead+ roles - [ ] When flag is ON: clicking "Upload Schedule" opens photo upload, then redirects to digest confirmation for the displayed week - [ ] Existing Photos tab upload flow still works regardless of flag state (uploading photos is not gated, only digestion is) ### Test Expectations - [ ] Request spec: digest action returns redirect when flag is OFF - [ ] Request spec: digest action works when flag is ON - [ ] Request spec: week index includes upload button when flag is ON and user is lead+ - Run command: `bundle exec rspec spec/requests/uploads_spec.rb spec/requests/weeks_spec.rb` ### Constraints - Follow existing feature flag patterns (see `pending_completion` flag usage in `weeks/index.html.erb`) - CSS: match existing button styles on the Week tab, no Tailwind - The upload-then-digest flow from the Week tab should pass the current week's Monday as `week_start` automatically ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `landscaping-assistant` -- project this affects - Issue #204 (done) -- Schedule image digestion (the feature being gated)
Author
Owner

Scope Review: READY

Review note: review-1453-2026-06-13
All template sections present, all 4 file targets verified on origin/main, traceability complete (story:schedule-upload confirmed in project page). 7 ACs are testable, test spec files exist, follows established feature_enabled? pattern. Single-repo, fits single agent pass (~3-4 min).

## Scope Review: READY Review note: `review-1453-2026-06-13` All template sections present, all 4 file targets verified on origin/main, traceability complete (story:schedule-upload confirmed in project page). 7 ACs are testable, test spec files exist, follows established feature_enabled? pattern. Single-repo, fits single agent pass (~3-4 min).
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#212
No description provided.