From 1904013dacdfa0649765ed71bba377a36043c35d Mon Sep 17 00:00:00 2001 From: xintaofei Date: Wed, 22 Apr 2026 18:37:01 +0800 Subject: [PATCH] refactor(sidebar): emphasize active-tab conversations via rail color and status icon - Highlight the vertical rail on conversations open in tabs with a darker primary tint and bleed 1px at both ends to stay continuous across cards - Add emphasized state to SidebarStatusIcon mirroring the rail, deepening color when the conversation is open in a tab - Redesign done icon as outlined circle + check, unify all status icons to sidebar-primary with consistent 0.75rem size and sidebar-tinted backdrop so they mask the rail --- .../sidebar-conversation-card.tsx | 14 ++- .../sidebar-conversation-list.tsx | 13 +++ .../conversations/sidebar-status-icon.tsx | 88 +++++++++++++------ 3 files changed, 84 insertions(+), 31 deletions(-) diff --git a/src/components/conversations/sidebar-conversation-card.tsx b/src/components/conversations/sidebar-conversation-card.tsx index 4828153..375a7d7 100644 --- a/src/components/conversations/sidebar-conversation-card.tsx +++ b/src/components/conversations/sidebar-conversation-card.tsx @@ -67,6 +67,7 @@ const STATUS_ICON_COLORS: Record = { interface SidebarConversationCardProps { conversation: DbConversationSummary isSelected: boolean + isOpenInTab?: boolean timeLabel?: string onSelect: (id: number, agentType: string) => void onDoubleClick?: (id: number, agentType: string) => void @@ -79,6 +80,7 @@ interface SidebarConversationCardProps { export const SidebarConversationCard = memo(function SidebarConversationCard({ conversation, isSelected, + isOpenInTab = false, timeLabel, onSelect, onDoubleClick, @@ -146,14 +148,18 @@ export const SidebarConversationCard = memo(function SidebarConversationCard({ > - + { + const set = new Set() + for (const tab of tabs) { + if (tab.conversationId != null) { + set.add(`${tab.agentType}:${tab.conversationId}`) + } + } + return set + }, [tabs]) + const [importing, setImporting] = useState(false) const [folderExpanded, setFolderExpanded] = useState>( {} @@ -814,6 +824,9 @@ export function SidebarConversationList({ selectedConversation?.agentType === conv.agent_type && selectedConversation?.id === conv.id } + isOpenInTab={openTabConversationKeys.has( + `${conv.agent_type}:${conv.id}` + )} timeLabel={formatRelative(conv.updated_at)} onSelect={handleSelect} onDoubleClick={handleDoubleClick} diff --git a/src/components/conversations/sidebar-status-icon.tsx b/src/components/conversations/sidebar-status-icon.tsx index e6eee3d..571a387 100644 --- a/src/components/conversations/sidebar-status-icon.tsx +++ b/src/components/conversations/sidebar-status-icon.tsx @@ -6,6 +6,7 @@ export type SidebarBeadStatus = "done" | "active" | "running" | "failed" interface SidebarStatusIconProps { status: SidebarBeadStatus + emphasized?: boolean className?: string } @@ -21,15 +22,15 @@ function IconFrame({ return (
+ @@ -116,20 +125,25 @@ export function SidebarStatusIcon({ if (status === "active") { return ( - + @@ -139,14 +153,34 @@ export function SidebarStatusIcon({ } return ( - + - + + )