From c8a4222d93ab8e65abbe25e41f77718bfe4cc1cd Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 17 Mar 2026 14:09:17 -0700 Subject: [PATCH] badges --- src/renderer/src/components/TabBar.tsx | 76 +++++++++---------- .../src/components/sidebar/WorktreeCard.tsx | 27 +++---- src/renderer/src/components/ui/badge.tsx | 2 +- 3 files changed, 51 insertions(+), 54 deletions(-) diff --git a/src/renderer/src/components/TabBar.tsx b/src/renderer/src/components/TabBar.tsx index 763a0994fad..bcddbee9ac3 100644 --- a/src/renderer/src/components/TabBar.tsx +++ b/src/renderer/src/components/TabBar.tsx @@ -19,12 +19,7 @@ import { ContextMenu, ContextMenuContent, ContextMenuItem, - ContextMenuRadioGroup, - ContextMenuRadioItem, ContextMenuSeparator, - ContextMenuSub, - ContextMenuSubContent, - ContextMenuSubTrigger, ContextMenuTrigger } from '@/components/ui/context-menu' import type { TerminalTab } from '../../../shared/types' @@ -43,14 +38,16 @@ interface SortableTabProps { } const TAB_COLORS = [ - { label: 'None', value: 'none' }, + { label: 'None', value: null }, + { label: 'Blue', value: '#3b82f6' }, + { label: 'Purple', value: '#a855f7' }, + { label: 'Pink', value: '#ec4899' }, { label: 'Red', value: '#ef4444' }, { label: 'Orange', value: '#f97316' }, { label: 'Yellow', value: '#eab308' }, { label: 'Green', value: '#22c55e' }, - { label: 'Blue', value: '#3b82f6' }, - { label: 'Purple', value: '#a855f7' }, - { label: 'Pink', value: '#ec4899' } + { label: 'Teal', value: '#14b8a6' }, + { label: 'Gray', value: '#9ca3af' } ] function SortableTab({ @@ -103,6 +100,12 @@ function SortableTab({ > {tab.customTitle ?? tab.title} + {tab.color && ( + + )} - {tab.color && ( - - )} @@ -136,7 +133,7 @@ function SortableTab({ { + onSelect={() => { const next = window.prompt('Change tab title', tab.customTitle ?? tab.title) if (next === null) return const trimmed = next.trim() @@ -145,29 +142,32 @@ function SortableTab({ > Change Title - - Assign Tab Color - - onSetTabColor(tab.id, value === 'none' ? null : value)} - > - {TAB_COLORS.map((color) => ( - - {color.value !== 'none' ? ( - - ) : ( - +
+
Tab Color
+
+ {TAB_COLORS.map((color) => { + const isSelected = tab.color === color.value + return ( + { + onSetTabColor(tab.id, color.value) + }} + > + {color.value === null && ( + )} - {color.label} - - ))} - - - + + ) + })} +
+
) diff --git a/src/renderer/src/components/sidebar/WorktreeCard.tsx b/src/renderer/src/components/sidebar/WorktreeCard.tsx index 3f2687c5059..587a3512c2d 100644 --- a/src/renderer/src/components/sidebar/WorktreeCard.tsx +++ b/src/renderer/src/components/sidebar/WorktreeCard.tsx @@ -127,12 +127,6 @@ const WorktreeCard = React.memo(function WorktreeCard({ [worktree.id, setActiveWorktree] ) - // Memoize badge style to avoid new object each render - const badgeStyle = useMemo( - () => (repo ? { backgroundColor: repo.badgeColor + '22', color: repo.badgeColor } : undefined), - [repo?.badgeColor] - ) - return (
)} @@ -185,9 +178,11 @@ const WorktreeCard = React.memo(function WorktreeCard({ {pr && ( -
- PR - {pr.title} +
+
+ PR + {pr.title} +
-
- Issue - {issue.title} +
+
+ Issue + {issue.title} +