Add drag-to-reorder on daily work queue #7

Closed
opened 2026-05-25 01:39:27 +00:00 by ldraney · 2 comments
Owner

Type

Feature

Lineage

Standalone — follows from work queue implementation in #5.

Repo

ldraney/landscaping-assistant

User Story

As a landscaper
I want to drag queue items to reorder my route
So that I can prioritize which properties to hit first

Context

The position column exists on work_queue_items but is set by insertion order. On a given day the user needs to rearrange their route based on geography, urgency, or preference. Mobile touch-drag is essential since this is used in the field.

File Targets

Files to modify or create:

  • app/javascript/controllers/sortable_controller.js — new Stimulus controller wrapping Sortable.js
  • app/controllers/work_queue_items_controller.rb — add reorder action for bulk position update
  • app/views/work_queue_items/_queue_item.html.erb — add drag handle
  • app/views/work_queue_items/index.html.erb — wire up sortable controller
  • config/routes.rb — add reorder route
  • config/importmap.rb — pin sortable.js
  • app/assets/stylesheets/application.css — drag handle + dragging styles

Acceptance Criteria

  • Drag handle visible on each queue item
  • Drag-and-drop reorders items visually
  • New positions persist to the database
  • Works on mobile (touch drag)
  • Turbo-compatible (no full page reload)
  • Completed items can still be reordered

Test Expectations

  • Request spec: POST reorder endpoint updates positions
  • Model spec: position ordering is respected in queries
  • Run command: bundle exec rspec

Constraints

  • Use Sortable.js via importmap (no npm/yarn)
  • Stimulus controller pattern — match existing filter_controller.js style
  • Bulk position update in a single request, not per-item PATCH

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-landscaping-assistant
### Type Feature ### Lineage Standalone — follows from work queue implementation in #5. ### Repo `ldraney/landscaping-assistant` ### User Story As a landscaper I want to drag queue items to reorder my route So that I can prioritize which properties to hit first ### Context The `position` column exists on `work_queue_items` but is set by insertion order. On a given day the user needs to rearrange their route based on geography, urgency, or preference. Mobile touch-drag is essential since this is used in the field. ### File Targets Files to modify or create: - `app/javascript/controllers/sortable_controller.js` — new Stimulus controller wrapping Sortable.js - `app/controllers/work_queue_items_controller.rb` — add `reorder` action for bulk position update - `app/views/work_queue_items/_queue_item.html.erb` — add drag handle - `app/views/work_queue_items/index.html.erb` — wire up sortable controller - `config/routes.rb` — add reorder route - `config/importmap.rb` — pin sortable.js - `app/assets/stylesheets/application.css` — drag handle + dragging styles ### Acceptance Criteria - [ ] Drag handle visible on each queue item - [ ] Drag-and-drop reorders items visually - [ ] New positions persist to the database - [ ] Works on mobile (touch drag) - [ ] Turbo-compatible (no full page reload) - [ ] Completed items can still be reordered ### Test Expectations - [ ] Request spec: POST reorder endpoint updates positions - [ ] Model spec: position ordering is respected in queries - Run command: `bundle exec rspec` ### Constraints - Use Sortable.js via importmap (no npm/yarn) - Stimulus controller pattern — match existing `filter_controller.js` style - Bulk position update in a single request, not per-item PATCH ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-landscaping-assistant`
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-1249-2026-05-24

Issue body is well-structured with all Feature template sections present and all 7 file targets verified against the codebase. No blockers, no decomposition needed.

Two traceability gaps require resolution before the ticket is READY:

  • [SCOPE] story:work-queue is not listed in the project-landscaping-assistant user-stories table. Add the user story entry.
  • [SCOPE] No arch-rails-app note exists in pal-e-docs. This arch label is used by 5 board items — creating the note benefits the whole project.
## Scope Review: NEEDS_REFINEMENT Review note: `review-1249-2026-05-24` Issue body is well-structured with all Feature template sections present and all 7 file targets verified against the codebase. No blockers, no decomposition needed. Two traceability gaps require resolution before the ticket is READY: - **[SCOPE]** `story:work-queue` is not listed in the project-landscaping-assistant user-stories table. Add the user story entry. - **[SCOPE]** No `arch-rails-app` note exists in pal-e-docs. This arch label is used by 5 board items — creating the note benefits the whole project.
Author
Owner

Scope Review: APPROVED

Review note: review-1249-2026-05-24-v2

Re-review passes. Both prior NEEDS_REFINEMENT items resolved:

  • story:work-queue entry confirmed in project-landscaping-assistant user-stories table
  • arch:rails-app covered by shared arch note (arch-rails-app-pal-enterprises) + project page Architecture section

All 7 file targets verified against codebase. 6 AC testable. No decomposition needed. Ticket is ready for implementation.

## Scope Review: APPROVED Review note: `review-1249-2026-05-24-v2` Re-review passes. Both prior NEEDS_REFINEMENT items resolved: - `story:work-queue` entry confirmed in project-landscaping-assistant user-stories table - `arch:rails-app` covered by shared arch note (arch-rails-app-pal-enterprises) + project page Architecture section All 7 file targets verified against codebase. 6 AC testable. No decomposition needed. Ticket is 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#7
No description provided.