Day detail page: "Previously [Day]s" accordion with historical frequency #235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Decomposed from #233 (2 of 4). Depends on #234 (day detail page must exist).
Repo
ldraney/landscaping-assistantUser Story
As a crew lead or admin
I want to see which properties have historically been assigned on a given weekday
So that I can quickly plan the day by referencing past patterns
Context
The day detail page (created in #234) needs a "Previously Tuesdays" accordion that shows every property ever assigned on that weekday, sorted by frequency (most common first). This uses the same DOW extraction pattern as the existing
compute_unqueued_this_weekmethod inWorkQueueItemsController(lines 231-245), but returns ALL historical properties for the weekday rather than filtering to unqueued ones.Properties already queued for the current date should be visually distinguished (e.g., muted or with a "queued" badge) so the user knows they're already planned.
File Targets
Files to create:
app/views/days/_previously_section.html.erb-- accordion partial using existing<details>+accordionStimulus controller patternFiles to modify:
app/controllers/days_controller.rb-- add@previouslyquery: historical DOW frequency for properties assigned on this weekday, sorted descending by countapp/views/days/show.html.erb-- render the_previously_sectionpartialFiles NOT to touch:
app/controllers/work_queue_items_controller.rb-- Today tab unchangedapp/javascript/controllers/accordion_controller.js-- reuse as-isFeature Flag
Flag: none
This is additive content on the new day detail page.
Acceptance Criteria
/days/2026-06-17(day name matches the date's weekday)WorkQueueItemon any Tuesday, sorted by frequency descendingTest Expectations
bundle exec rspec spec/requests/days_spec.rbConstraints
accordion_controller.jswithdata-accordion-key-value="previously-{wday}"WorkQueueItem.where("EXTRACT(DOW FROM work_date) = ?", date.wday).group(:property_id).order("count_id DESC").count(:id)Checklist
Related
project-landscaping-assistantScope Review: READY
Review note:
review-1473-2026-06-15Scope is solid. All file targets verified against codebase: DOW extraction pattern at lines 231-245 confirmed, accordion controller exists with keyValue pattern, Property.active scope verified. Template is complete with all required sections for Feature type. Traceability triangle intact (story:weekly-tracking found in project page, Forgejo issue open).
Dependency on #234 (day detail page controller/route/view) is properly documented and must be completed first -- currently in backlog as board item #1472.
One non-blocking platform-wide gap: no
arch-rails-appnote exists in pal-e-docs.