Skip to content

Implement dragula.js drag-and-drop for task cards on board page#72

Merged
olsonjeffery merged 2 commits into
mainfrom
task/12-within--project--proj-id---pag
Jul 24, 2026
Merged

Implement dragula.js drag-and-drop for task cards on board page#72
olsonjeffery merged 2 commits into
mainfrom
task/12-within--project--proj-id---pag

Conversation

@olsonjeffery

Copy link
Copy Markdown
Owner

Summary

Integrates dragula.js (vendored in assets/) into the board page to enable drag-and-drop of task cards between the four status columns (pending, in-progress, in-review, completed).

Changes

  • src/webapp/app.rs — Added dragula CSS <link> in the shell <head>
  • src/webapp/pages/board.rs — Added dragula JS <script>, data-status attributes on column divs, inline dragula initialization with drop handler, live DOM badge/count updates, and rollback on API failure
  • src/webapp/components/task_card.rs — Added data-task-id to card <a> element
  • assets/dragula.min.js, assets/dragula.min.css — dragula v3.7.3 vendored assets
  • src/webapp/app.css — dragula CSS overrides (mirror styling, drop-zone hover, Bulma compat)
  • AGENTS.md — Documented webapp JS dependency pattern (page-local imports)
  • Updated unit tests to verify data-status and data-task-id attributes

Testing

  • Unit tests: cargo test --lib -- board and cargo test --lib -- project_card pass
  • Manual Playwright MCP testing across all status transitions + error handling

Closes #12

- Add dragula CSS <link> in app.rs ShellPage <head>
- Add dragula JS <script> tag and init in board.rs with drop handler
- Add data-status attribute to board column divs
- Add data-task-id attribute to task card root <a> element
- Add dragula CSS overrides in app.css (mirror, transit, drop-zone)
- Implement live DOM update on drop (badge, counts, No tasks placeholder)
- Implement rollback to source column on API failure
- Update Rust unit tests to verify data-status and data-task-id attributes
- Document webapp JS dependency pattern in AGENTS.md
- Replace 5-line filter loop with Array.from + CSS attribute selector
- Extract revertDrag() function to eliminate duplicated error handling
- Replace regex in column label extraction with simpler split(' (')[0]
@olsonjeffery
olsonjeffery merged commit fc2f66e into main Jul 24, 2026
3 checks passed
@olsonjeffery
olsonjeffery deleted the task/12-within--project--proj-id---pag branch July 24, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant