From e17d6228e438791e210d6c845bf8a55f8675cf99 Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 3 Apr 2026 14:20:34 +0200 Subject: [PATCH] fix(manacore/web): fix getTagsByIds missing allTags param in zitare, fix TagDragData cast Co-Authored-By: Claude Opus 4.6 (1M context) --- .../apps/web/src/lib/modules/zitare/ListView.svelte | 6 ++++-- packages/shared-ui/src/dnd/DragPreview.svelte | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/manacore/apps/web/src/lib/modules/zitare/ListView.svelte b/apps/manacore/apps/web/src/lib/modules/zitare/ListView.svelte index d4f9131e0..be3cbfc8a 100644 --- a/apps/manacore/apps/web/src/lib/modules/zitare/ListView.svelte +++ b/apps/manacore/apps/web/src/lib/modules/zitare/ListView.svelte @@ -12,7 +12,7 @@ import { Heart } from '@manacore/shared-icons'; import { dropTarget } from '@manacore/shared-ui/dnd'; import type { TagDragData } from '@manacore/shared-ui/dnd'; - import { getTagsByIds } from '$lib/stores/tags.svelte'; + import { useAllTags, getTagsByIds } from '$lib/stores/tags.svelte'; import type { ViewProps } from '$lib/app-registry'; import type { LocalFavorite } from './types'; import type { Quote } from '@zitare/content'; @@ -45,8 +45,10 @@ let currentFav = $derived(quote ? favorites.find((f) => f.quoteId === quote!.id) : undefined); let isFav = $derived(!!currentFav); + const tagsQuery = useAllTags(); + let allTags = $derived(tagsQuery.value ?? []); let currentTagIds = $derived(currentFav?.tagIds ?? []); - let currentTags = $derived(getTagsByIds(currentTagIds)); + let currentTags = $derived(getTagsByIds(allTags, currentTagIds)); function nextQuote() { quotesStore.loadRandomQuote(); diff --git a/packages/shared-ui/src/dnd/DragPreview.svelte b/packages/shared-ui/src/dnd/DragPreview.svelte index b3685c39d..863deb0b7 100644 --- a/packages/shared-ui/src/dnd/DragPreview.svelte +++ b/packages/shared-ui/src/dnd/DragPreview.svelte @@ -27,7 +27,9 @@ const OFFSET_Y = -20; const tagData = $derived( - dragState.activeDrag?.type === 'tag' ? (dragState.activeDrag.data as TagDragData) : null + dragState.activeDrag?.type === 'tag' + ? (dragState.activeDrag.data as unknown as TagDragData) + : null ); const entityData = $derived(() => {