feat(items): move an item to another list with a long swipe

A longer swipe left on an item (past the edit threshold) opens a dialog
with the user's other lists; picking one moves the item there while the
user stays on the current list. On desktop, right-click now opens a
context menu with "Editar" and "Mover a otra lista…".

The API gets POST /api/lists/:listId/items/:itemId/move, which requires
membership in both lists and publishes item.removed on the source list
and item.created on the target, so other members see the change live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-10-20 20:24:38 -03:00
parent 86d4796d88
commit feb8df14c0
13 changed files with 807 additions and 71 deletions

View File

@@ -4,6 +4,7 @@ import type { ListItem } from './shopping-list'
export type ListEventType =
| 'item.created'
| 'item.updated'
| 'item.removed'
| 'invitation.created'
| 'member.added'
| 'list.updated'
@@ -15,6 +16,8 @@ export type ListEventType =
*/
export type ListEvent =
| { type: 'item.created' | 'item.updated'; listId: string; item: ListItem }
/** The item left this list (it was moved to another one). */
| { type: 'item.removed'; listId: string; itemId: string }
| { type: 'invitation.created'; listId: string; email: string }
| { type: 'member.added'; listId: string; userId: string }
| { type: 'list.updated'; listId: string; name: string }