From 7f781edd895bdbac180c09c55975134f0b124d12 Mon Sep 17 00:00:00 2001 From: Timothy Cardoza Date: Thu, 19 Mar 2026 17:41:56 -0500 Subject: [PATCH] task sharing restructure seems working --- src/store/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/store/index.ts b/src/store/index.ts index 6e2d118..6040fd6 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -648,6 +648,7 @@ export const matchesFilter = (task: Task) => { ) || bucketRefs.some(context => context.id === (ctx as { bucketId: string }).bucketId); if (!inCurrentBucket) return false; } else { + if (hasHandoffBucket) return false; if (task.ownerId !== (ctx as { userId: string }).userId) return false; } @@ -2052,9 +2053,21 @@ const checkForHandoffs = (task: Task, updates: Partial): Partial => const context = getContextByRef(ref); if (!context || context.policy !== "handoff") continue; if (context.kind === "user" && context.targetUserId) { + const senderPersonalContext = getPersonalContext(currentUserId); + const nextShareRefs = senderPersonalContext + ? refs.filter(existingRef => !( + existingRef.kind === "user" && + (existingRef.contextId === senderPersonalContext.id || existingRef.key === senderPersonalContext.key) + )) + : refs; + const labelTags = updates.labelTags || task.labelTags; + const noteRefs = updates.noteRefs || task.noteRefs; + const favoriteTag = (updates.tags || task.tags || []).find(tag => tag.endsWith("_favorite__")); return { ...updates, - ownerId: context.targetUserId + ownerId: context.targetUserId, + shareRefs: nextShareRefs, + tags: buildTaskTags(labelTags, nextShareRefs, noteRefs, favoriteTag) }; } }