Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions apps/staged/src/lib/features/branches/BranchCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions apps/staged/src/lib/features/sessions/hashtagItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) => ({
Expand Down
3 changes: 3 additions & 0 deletions apps/staged/src/lib/features/timeline/BranchTimeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@
<TimelineRow
type={item.type}
title={item.title}
titleHtml={hashtagItems.length > 0 && hasHashtagTokens(item.title)
? renderHashtagTokens(item.title, hashtagItems)
: undefined}
secondaryMeta={item.sessionId
? (liveSessionHints[item.sessionId] ??
item.secondaryMeta ??
Expand Down