From f614d2cb5d619a9d8bca316e6844bcd1103bcf34 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Wed, 28 Oct 2026 02:56:59 -0700 Subject: [PATCH] fix: leave drafts unchanged from the parent out of the fork bar's draft badge Co-Authored-By: Claude Opus 5.5 --- frontend/src/lib/components/ForkWorkspaceBanner.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/ForkWorkspaceBanner.svelte b/frontend/src/lib/components/ForkWorkspaceBanner.svelte index 193f737ba7..fea12f9f6d 100644 --- a/frontend/src/lib/components/ForkWorkspaceBanner.svelte +++ b/frontend/src/lib/components/ForkWorkspaceBanner.svelte @@ -47,8 +47,14 @@ let showBanner = $derived(isFork && isNotOperator) // Drafts in this fork. Pass undefined when the banner is hidden so it doesn't fetch. - const drafts = useWorkspaceDrafts(() => (showBanner ? ($workspaceStore ?? undefined) : undefined)) - const draftCount = $derived(drafts.count) + // Drafts cloned in from the parent and never edited are left out, as the draft view + // the badge opens hides them; counting them shows a fresh fork's badge over an empty list. + const drafts = useWorkspaceDrafts( + () => (showBanner ? ($workspaceStore ?? undefined) : undefined), + () => false, + () => parentWorkspaceId ?? undefined + ) + const draftCount = $derived(drafts.items.filter((d) => d.unchanged_from_parent !== true).length) /** Bar width from which each badge says what it counts. Below it they keep the icon and the * number, which is the part a reader scans for; the tooltip names them either way. */