From 1f8f4e23af62d909bc56eed250475fa77561834a Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 15 Apr 2026 12:15:19 +1000 Subject: [PATCH 1/4] fix(staged): resolve hashtag badge titles in BranchCard timeline hashtagItems were loaded once at mount via a separate API call and never refreshed, so references to items created after mount showed raw IDs instead of titles. Derive hashtagItems reactively from the timeline state that is already kept up-to-date, and render badges for pending session items that previously skipped titleHtml entirely. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/staged/src/lib/features/branches/BranchCard.svelte | 1 + apps/staged/src/lib/features/timeline/BranchTimeline.svelte | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/staged/src/lib/features/branches/BranchCard.svelte b/apps/staged/src/lib/features/branches/BranchCard.svelte index 7d138b3cb..9363897b5 100644 --- a/apps/staged/src/lib/features/branches/BranchCard.svelte +++ b/apps/staged/src/lib/features/branches/BranchCard.svelte @@ -20,6 +20,7 @@ Branch, BranchTimeline as BranchTimelineData, HashtagItem, + ProjectNote, ProjectRepo, SessionStatusPayload, } from '../../types'; diff --git a/apps/staged/src/lib/features/timeline/BranchTimeline.svelte b/apps/staged/src/lib/features/timeline/BranchTimeline.svelte index 71589505d..041ff91bc 100644 --- a/apps/staged/src/lib/features/timeline/BranchTimeline.svelte +++ b/apps/staged/src/lib/features/timeline/BranchTimeline.svelte @@ -592,6 +592,9 @@ 0 && hasHashtagTokens(item.title) + ? renderHashtagTokens(item.title, hashtagItems) + : undefined} secondaryMeta={item.sessionId ? (liveSessionHints[item.sessionId] ?? item.secondaryMeta ?? From 147578317deed4fa01504300b68ea3d808b07d80 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 15 Apr 2026 12:25:54 +1000 Subject: [PATCH 2/4] refactor(staged): resolve review comments on hashtag badge fix - Remove unused ProjectNote type import from BranchCard.svelte - Export projectNotesToHashtagItems from hashtagItems.ts and reuse it in BranchCard.svelte instead of duplicating the filter+map logic Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/staged/src/lib/features/branches/BranchCard.svelte | 1 - apps/staged/src/lib/features/sessions/hashtagItems.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/staged/src/lib/features/branches/BranchCard.svelte b/apps/staged/src/lib/features/branches/BranchCard.svelte index 9363897b5..7d138b3cb 100644 --- a/apps/staged/src/lib/features/branches/BranchCard.svelte +++ b/apps/staged/src/lib/features/branches/BranchCard.svelte @@ -20,7 +20,6 @@ Branch, BranchTimeline as BranchTimelineData, HashtagItem, - ProjectNote, ProjectRepo, SessionStatusPayload, } from '../../types'; diff --git a/apps/staged/src/lib/features/sessions/hashtagItems.ts b/apps/staged/src/lib/features/sessions/hashtagItems.ts index 420df3b7e..14cf79ba0 100644 --- a/apps/staged/src/lib/features/sessions/hashtagItems.ts +++ b/apps/staged/src/lib/features/sessions/hashtagItems.ts @@ -116,7 +116,7 @@ export function timelineToHashtagItems( return items; } -function projectNotesToHashtagItems(notes: ProjectNote[]): HashtagItem[] { +export function projectNotesToHashtagItems(notes: ProjectNote[]): HashtagItem[] { return notes .filter((n) => n.title.trim()) .map((n) => ({ From 85c82ab7c123b6586c8641ac5e36591bbaf255e0 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 15 Apr 2026 12:28:49 +1000 Subject: [PATCH 3/4] fix(staged): remove redundant "Review of" prefix in hashtag badge fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The badge already renders with a "Review:" label prefix, so the fallback title only needs the short SHA — not "Review of " which produced the redundant "Review: Review of abc1234". Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/staged/src/lib/features/sessions/hashtagItems.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/staged/src/lib/features/sessions/hashtagItems.ts b/apps/staged/src/lib/features/sessions/hashtagItems.ts index 14cf79ba0..cb89d74ba 100644 --- a/apps/staged/src/lib/features/sessions/hashtagItems.ts +++ b/apps/staged/src/lib/features/sessions/hashtagItems.ts @@ -101,7 +101,7 @@ export function timelineToHashtagItems( } for (const review of timeline.reviews) { - const title = review.title || `Review of ${review.commitSha.slice(0, 7)}`; + const title = review.title || review.commitSha.slice(0, 7); items.push({ type: 'review', id: review.id, From 4a8327d76d74f66dbe0cc733dbc008ed3791aa84 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 16 Apr 2026 13:00:08 +1000 Subject: [PATCH 4/4] refactor(staged): use projectNotesToHashtagItems helper in BranchCard Replace the inline filter+map logic in BranchCard.svelte with a call to the already-exported projectNotesToHashtagItems helper from hashtagItems.ts, completing the refactor stated in commit 14757831. --- .../src/lib/features/branches/BranchCard.svelte | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/staged/src/lib/features/branches/BranchCard.svelte b/apps/staged/src/lib/features/branches/BranchCard.svelte index 7d138b3cb..18b421a5f 100644 --- a/apps/staged/src/lib/features/branches/BranchCard.svelte +++ b/apps/staged/src/lib/features/branches/BranchCard.svelte @@ -40,7 +40,7 @@ import RemoteWorkspaceStatusBadge from './RemoteWorkspaceStatusBadge.svelte'; import RemoteWorkspaceStatusView from './RemoteWorkspaceStatusView.svelte'; import { alerts } from '../../shared/alerts.svelte'; - import { timelineToHashtagItems } from '../sessions/hashtagItems'; + import { timelineToHashtagItems, projectNotesToHashtagItems } from '../sessions/hashtagItems'; interface Props { branch: Branch; @@ -115,15 +115,7 @@ let stale = false; commands.listProjectNotes(projectId).then((notes) => { if (stale) return; - projectNoteHashtagItems = notes - .filter((n) => n.title.trim()) - .map((n) => ({ - type: 'project-note' as const, - id: n.id, - title: n.title, - color: '--note-color', - bgColor: '--note-bg', - })); + projectNoteHashtagItems = projectNotesToHashtagItems(notes); }); return () => { stale = true;