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:
@@ -13,6 +13,7 @@ type BoughtItemListProps = {
|
||||
savingIds: string[]
|
||||
/** The editing state of each row, owned by the parent so only one row edits at a time. */
|
||||
editingProps: (itemId: string) => Pick<ItemRowProps, 'editing' | 'onEditingChange'>
|
||||
onMove: (item: ListItem) => void
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,7 @@ export function BoughtItemList({
|
||||
updateItem,
|
||||
savingIds,
|
||||
editingProps,
|
||||
onMove,
|
||||
}: BoughtItemListProps) {
|
||||
return (
|
||||
<Collapsible defaultOpen asChild>
|
||||
@@ -42,6 +44,7 @@ export function BoughtItemList({
|
||||
updateItem={updateItem}
|
||||
isSaving={savingIds.includes(item.id)}
|
||||
{...editingProps(item.id)}
|
||||
onMove={() => onMove(item)}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user