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:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user