Drag-and-drop reordering for link cards #9
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
Standalone -- user request during initial palinks development.
Repo
ldraney/palinksUser Story
As a user
I want to drag link cards into my preferred order
So that I can organize links by priority rather than just by date
Context
Links currently sort by updated_at desc. Users need manual control over card ordering. This requires a position column, a sort endpoint, and a client-side drag controller that works on both desktop (HTML5 DnD) and mobile (touch events). The JS pipeline (importmap + Stimulus) was not yet set up in this project.
File Targets
Files modified or created:
db/migrate/*_add_position_to_links.rb-- add position integer columnapp/models/link.rb-- update ordered scope to use positionapp/controllers/links_controller.rb-- add sort actionconfig/routes.rb-- add sort collection routeconfig/importmap.rb-- new, pins for Turbo/Stimulusapp/javascript/application.js-- new, JS entrypointapp/javascript/controllers/-- new, Stimulus bootstrap + sortable controllerapp/views/links/index.html.erb-- add sortable data-controllerapp/views/links/_link.html.erb-- add drag handle and data-targetapp/assets/stylesheets/application.css-- drag states, handle, compact cardsapp/views/layouts/application.html.erb-- add javascript_importmap_tagsconfig/environments/development.rb-- allow dev tunnel hostdocker-compose.yml-- remap to port 9998Acceptance Criteria
Test Expectations
bin/rails db:migrateconfirms position column addedConstraints
.is-*state classes, component comments with Stimulus refs)Checklist
Related
palinks-- project this affects