fix(sidebar): make uncategorized rooms draggable into categories #135

Merged
nrupard merged 1 commit from fix/sidebar-uncategorized-draggable into main 2026-05-18 17:56:59 +02:00
Owner

Bug

Channels in the "All rooms" / "Rooms" (uncategorized) section weren't draggable, so the only way to assign a room to a category was the per-row "Move to category" dropdown. Users expected drag-and-drop to work for all rows, not just rows already inside a category.

Fix

Add draggable="true" and data-room-id to the uncategorized <li>s when at least one category exists (no point making them draggable if there are no targets to drop on). The existing set_room_positions route already handles the drop via INSERT ON CONFLICT, so a previously-uncategorized room lands in the target category at the right position without any new endpoint or DB code.

Out of scope

Dragging back from a category to the All-rooms list is still done via the existing "Remove from category" dropdown entry; the uncategorized <ul> is not made a drop target here to keep the diff minimal. Can land in a follow-up if needed.

Test plan

  • just check (fmt + clippy across standalone + saas).
  • Existing 11 sidebar tests still pass (no test code changed; existing room_positions_endpoint_handles_cross_category_move exercises the same INSERT ON CONFLICT path that uncategorized->category goes through).
  • Manual: with at least one category present, drag a room from "All rooms" into a category - verify it lands in the category and persists across page reload.
## Bug Channels in the "All rooms" / "Rooms" (uncategorized) section weren't draggable, so the only way to assign a room to a category was the per-row `≡` "Move to category" dropdown. Users expected drag-and-drop to work for all rows, not just rows already inside a category. ## Fix Add `draggable="true"` and `data-room-id` to the uncategorized `<li>`s when at least one category exists (no point making them draggable if there are no targets to drop on). The existing `set_room_positions` route already handles the drop via `INSERT ON CONFLICT`, so a previously-uncategorized room lands in the target category at the right position without any new endpoint or DB code. ## Out of scope Dragging back from a category to the All-rooms list is still done via the existing "Remove from category" dropdown entry; the uncategorized `<ul>` is not made a drop target here to keep the diff minimal. Can land in a follow-up if needed. ## Test plan - [x] `just check` (fmt + clippy across standalone + saas). - [x] Existing 11 sidebar tests still pass (no test code changed; existing `room_positions_endpoint_handles_cross_category_move` exercises the same `INSERT ON CONFLICT` path that uncategorized->category goes through). - [ ] Manual: with at least one category present, drag a room from "All rooms" into a category - verify it lands in the category and persists across page reload.
fix(sidebar): make uncategorized room rows draggable into categories
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 9s
f60a7ed9fe
Phase 2 left uncategorized rooms non-draggable on purpose - the rationale was that the per-row "move to category" dropdown already covers those transitions. Users found it surprising: every other row in the sidebar is draggable, so the All-rooms rows look like they should be too. Added `draggable="true"` and `data-room-id` to those `<li>`s when at least one category exists (no point making them draggable with no targets to drop on). The existing `set_room_positions` route handles the drop via INSERT ON CONFLICT, so a previously-uncategorized room lands in the target category with the right position with no new endpoint or DB code.

Dragging back from a category to the All-rooms list is still handled by the existing "Remove from category" dropdown entry; the uncategorized `<ul>` is not made a drop target here to keep the diff minimal. Can land later if needed.
nrupard deleted branch fix/sidebar-uncategorized-draggable 2026-05-18 17:57:00 +02:00
Sign in to join this conversation.
No reviewers
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
psa-systems/lets-chat!135
No description provided.