From b8f18d6ca10122ca6124f521a35873ad795d9cdc Mon Sep 17 00:00:00 2001 From: Krusty Date: Mon, 2 Mar 2026 23:18:10 -0800 Subject: [PATCH 01/21] feat(mission-control): add quick assign UI and unskip AC1 gating --- e2e/mission-control-phase1.spec.ts | 5 +--- src/components/ListItem.tsx | 48 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/e2e/mission-control-phase1.spec.ts b/e2e/mission-control-phase1.spec.ts index ed47166..078b009 100644 --- a/e2e/mission-control-phase1.spec.ts +++ b/e2e/mission-control-phase1.spec.ts @@ -74,10 +74,7 @@ test.describe("Mission Control Phase 1 acceptance", () => { await createList(page, "MC Assignee List"); await createItem(page, "MC Assigned Item"); - const hasAssigneeUi = (await page.getByRole("button", { name: /assign/i }).count()) > 0 - || (await page.getByText(/assignee/i).count()) > 0; - - test.skip(!hasAssigneeUi, "Assignee UI is not shipped in current build; keeping runnable AC1 harness."); + await expect(page.getByRole("button", { name: /assign/i }).first()).toBeVisible({ timeout: 5000 }); const start = Date.now(); await page.getByRole("button", { name: /assign/i }).first().click(); diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx index c25ac50..9c321fc 100644 --- a/src/components/ListItem.tsx +++ b/src/components/ListItem.tsx @@ -68,8 +68,10 @@ export const ListItem = memo(function ListItem({ const checkItemMutation = useMutation(api.items.checkItem); const uncheckItemMutation = useMutation(api.items.uncheckItem); const removeItem = useMutation(api.items.removeItem); + const updateItemMutation = useMutation(api.items.updateItem); const [isUpdating, setIsUpdating] = useState(false); + const [assignFeedback, setAssignFeedback] = useState(null); const [showDetails, setShowDetails] = useState(false); const itemRef = useRef(null); const longPressTimeoutRef = useRef | null>(null); @@ -182,6 +184,31 @@ export const ListItem = memo(function ListItem({ } }; + const handleQuickAssign = async () => { + if (!canUserEdit || isUpdating) return; + + haptic("light"); + setIsUpdating(true); + + try { + await updateItemMutation({ + itemId: item._id, + userDid, + legacyDid, + assigneeDid: userDid, + }); + setAssignFeedback("Assigned"); + window.setTimeout(() => setAssignFeedback(null), 1600); + } catch (err) { + console.error("Failed to assign item:", err); + setAssignFeedback("Assign failed"); + window.setTimeout(() => setAssignFeedback(null), 2000); + haptic("error"); + } finally { + setIsUpdating(false); + } + }; + return (
+ {/* Quick assign control */} + {!isSelectMode && canUserEdit && !assigneeDid && ( + + )} + + {assignFeedback && ( + + {assignFeedback} + + )} + {/* Share button - only show if not in select mode */} {!isSelectMode && (