Day detail page: controller, route, and basic show view #234

Closed
opened 2026-06-16 03:31:46 +00:00 by ldraney · 3 comments
Owner

Type

Feature

Lineage

Decomposed from #233 (1 of 4). Must land first -- other tickets depend on this page existing.

Repo

ldraney/landscaping-assistant

User Story

As an admin or super admin
I want to click a day on the Week tab and see a dedicated day detail page
So that I have a planning-oriented view for any day of the week, separate from the Today operational view

Context

Currently, clicking a day label on the Week tab routes to /today?date=X, which shows the full Today view with accordion sections designed for "what am I doing right now." Days need their own pages for planning. This ticket creates the foundation: a new DaysController#show with a basic view showing the day name, date, and any properties currently queued for that date. The Week tab day labels are updated to point to the new route.

The Today tab (/today) remains completely unchanged.

Role gating: DaysController is gated to admin, super_admin only, matching the Week tab. Day pages are sub-pages of the Week tab planning portal -- if a role can't see the Week tab, they shouldn't reach day pages either. Broadening to crew leads would be a separate ticket that opens both the Week tab and day pages together.

File Targets

Files to create:

  • app/controllers/days_controller.rb -- show action with require_role :admin, :super_admin, loads @date from params, queries WorkQueueItem.where(work_date: @date) with associated properties
  • app/views/days/show.html.erb -- page heading with day name (e.g., "Tuesday, June 17"), back link to Week tab, list of queued properties for this date
  • spec/requests/days_spec.rb -- request specs for the show action

Files to modify:

  • config/routes.rb -- add get "/days/:date", to: "days#show", as: :day
  • app/views/weeks/index.html.erb -- line 81: change work_queue_items_path(date: day) to day_path(date: day)

Files NOT to touch:

  • app/controllers/work_queue_items_controller.rb -- Today tab stays as-is
  • app/views/work_queue_items/ -- Today view unchanged

Feature Flag

Flag: none
New route/page, not a toggle on existing behavior.

Acceptance Criteria

  • GET /days/2026-06-17 returns 200 with "Tuesday" in the heading
  • Page shows properties currently queued for that date (from work_queue_items table)
  • Back link navigates to the Week tab for the correct week
  • Week tab day labels now link to /days/:date instead of /today?date=
  • Invalid date params return a graceful error (redirect to Week tab)
  • Non-admin roles (crew_member, lead, client) get redirected away

Test Expectations

  • Request spec: GET /days/:date returns 200 for admin
  • Request spec: page includes the weekday name in the response body
  • Request spec: page lists queued properties for the date
  • Request spec: invalid date param handled gracefully
  • Request spec: requires authentication
  • Request spec: non-admin roles are denied access
  • Run command: bundle exec rspec spec/requests/days_spec.rb

Constraints

  • Follow existing controller patterns (auth via authenticate_user!, role gating via require_role :admin, :super_admin)
  • Match existing CSS patterns for headings and lists -- no new CSS framework
  • Mobile-first layout
  • The queued properties list is read-only in this ticket -- add/remove comes in later tickets

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-landscaping-assistant
  • Parent: #233 (decomposed)
  • Blocked by: nothing
  • Blocks: #235, #236, #237 (all depend on this page existing)
### Type Feature ### Lineage Decomposed from #233 (1 of 4). Must land first -- other tickets depend on this page existing. ### Repo `ldraney/landscaping-assistant` ### User Story As an admin or super admin I want to click a day on the Week tab and see a dedicated day detail page So that I have a planning-oriented view for any day of the week, separate from the Today operational view ### Context Currently, clicking a day label on the Week tab routes to `/today?date=X`, which shows the full Today view with accordion sections designed for "what am I doing right now." Days need their own pages for planning. This ticket creates the foundation: a new `DaysController#show` with a basic view showing the day name, date, and any properties currently queued for that date. The Week tab day labels are updated to point to the new route. The Today tab (`/today`) remains completely unchanged. Role gating: `DaysController` is gated to `admin, super_admin` only, matching the Week tab. Day pages are sub-pages of the Week tab planning portal -- if a role can't see the Week tab, they shouldn't reach day pages either. Broadening to crew leads would be a separate ticket that opens both the Week tab and day pages together. ### File Targets Files to create: - `app/controllers/days_controller.rb` -- `show` action with `require_role :admin, :super_admin`, loads `@date` from params, queries `WorkQueueItem.where(work_date: @date)` with associated properties - `app/views/days/show.html.erb` -- page heading with day name (e.g., "Tuesday, June 17"), back link to Week tab, list of queued properties for this date - `spec/requests/days_spec.rb` -- request specs for the show action Files to modify: - `config/routes.rb` -- add `get "/days/:date", to: "days#show", as: :day` - `app/views/weeks/index.html.erb` -- line 81: change `work_queue_items_path(date: day)` to `day_path(date: day)` Files NOT to touch: - `app/controllers/work_queue_items_controller.rb` -- Today tab stays as-is - `app/views/work_queue_items/` -- Today view unchanged ### Feature Flag Flag: none New route/page, not a toggle on existing behavior. ### Acceptance Criteria - [ ] `GET /days/2026-06-17` returns 200 with "Tuesday" in the heading - [ ] Page shows properties currently queued for that date (from `work_queue_items` table) - [ ] Back link navigates to the Week tab for the correct week - [ ] Week tab day labels now link to `/days/:date` instead of `/today?date=` - [ ] Invalid date params return a graceful error (redirect to Week tab) - [ ] Non-admin roles (crew_member, lead, client) get redirected away ### Test Expectations - [ ] Request spec: GET `/days/:date` returns 200 for admin - [ ] Request spec: page includes the weekday name in the response body - [ ] Request spec: page lists queued properties for the date - [ ] Request spec: invalid date param handled gracefully - [ ] Request spec: requires authentication - [ ] Request spec: non-admin roles are denied access - [ ] Run command: `bundle exec rspec spec/requests/days_spec.rb` ### Constraints - Follow existing controller patterns (auth via `authenticate_user!`, role gating via `require_role :admin, :super_admin`) - Match existing CSS patterns for headings and lists -- no new CSS framework - Mobile-first layout - The queued properties list is read-only in this ticket -- add/remove comes in later tickets ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-landscaping-assistant` - Parent: #233 (decomposed) - Blocked by: nothing - Blocks: #235, #236, #237 (all depend on this page existing)
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-1472-2026-06-15
Template is complete and file targets all verified against the codebase. Two body fixes and one scope item needed before this is READY.

  • [BODY] Fix "Blocks" references in Related section: #234-2, #234-3, #234-4 are not valid Forgejo issue references. Replace with #235, #236, #237.
  • [BODY] Add explicit role gating to Constraints: the user story says "crew lead or admin" but the Week tab is gated to :admin, :super_admin only — crew leads cannot see the Week tab. Specify which roles DaysController should allow.
  • [SCOPE] Create architecture note arch-rails-app in pal-e-docs. This label is used across 30+ board items with no backing note.
## Scope Review: NEEDS_REFINEMENT Review note: `review-1472-2026-06-15` Template is complete and file targets all verified against the codebase. Two body fixes and one scope item needed before this is READY. - **[BODY]** Fix "Blocks" references in Related section: `#234-2, #234-3, #234-4` are not valid Forgejo issue references. Replace with `#235, #236, #237`. - **[BODY]** Add explicit role gating to Constraints: the user story says "crew lead or admin" but the Week tab is gated to `:admin, :super_admin` only — crew leads cannot see the Week tab. Specify which roles `DaysController` should allow. - **[SCOPE]** Create architecture note `arch-rails-app` in pal-e-docs. This label is used across 30+ board items with no backing note.
Author
Owner

Scope refinement applied (review-1472-2026-06-15):

  1. Fixed invalid issue refs: "Blocks: #234-2, #234-3, #234-4" → "#235, #236, #237"
  2. Role gating specified: admin, super_admin only, matching Week tab. Day pages are sub-pages of the Week tab planning portal. Broadening to crew leads would be a separate ticket.
  3. Added AC: "Non-admin roles get redirected away"
  4. Added test expectation: "non-admin roles are denied access"
  5. Updated user story from "crew lead or admin" to "admin or super admin"
**Scope refinement applied (review-1472-2026-06-15):** 1. Fixed invalid issue refs: "Blocks: #234-2, #234-3, #234-4" → "#235, #236, #237" 2. Role gating specified: `admin, super_admin` only, matching Week tab. Day pages are sub-pages of the Week tab planning portal. Broadening to crew leads would be a separate ticket. 3. Added AC: "Non-admin roles get redirected away" 4. Added test expectation: "non-admin roles are denied access" 5. Updated user story from "crew lead or admin" to "admin or super admin"
Author
Owner

Scope Review: READY

Review note: review-1472-2026-06-16
Re-review passed. Both previously flagged issues (invalid issue references, ambiguous role gating) are now resolved. Template complete, all file targets verified against codebase, traceability intact, dependencies documented and confirmed. Ready for implementation.

## Scope Review: READY Review note: `review-1472-2026-06-16` Re-review passed. Both previously flagged issues (invalid issue references, ambiguous role gating) are now resolved. Template complete, all file targets verified against codebase, traceability intact, dependencies documented and confirmed. Ready for implementation.
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#234
No description provided.