From b1920646d85f3697dff5869e4af561bebbe67fdc Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 7 Aug 2026 10:16:06 -0700 Subject: [PATCH] fix(sidebar): keep the pin visible on the chat you're viewing The pin glyph carried a stale `!isCurrentRoute` guard copy-pasted from the status dot back when the dot was also hidden on the current route. #4354 later relaxed the dot's guard but left the pin's untouched, so opening a pinned chat made its pin vanish. Derive `showStatusDot` once and express the pin as its negation so the two conditions can no longer drift apart. Also align the collapsed rail, which never forwarded `isCurrentRoute` and so showed an unread dot on the chat you were already reading, and hide the pin by the same opacity mechanism the dot uses instead of a display toggle plus a mount guard. --- .../collapsed-sidebar-menu.tsx | 2 +- .../w/components/sidebar/sidebar.tsx | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx index a57934dfb44..d29e742c0a0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx @@ -300,7 +300,7 @@ export function CollapsedChatFlyoutItem({ diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx index 0b0515f5b59..02d5fc061a1 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx @@ -195,6 +195,13 @@ const SidebarChatItem = memo(function SidebarChatItem({ }) { const dragGhostRef = useRef(null) + /** + * The trailing slot fits one glyph, and the dot wins over the pin: it reports + * transient state (a run in progress, or an unread reply elsewhere), while pinning + * is persistent and already conveyed by the row sorting to the top of the list. + */ + const showStatusDot = isActive || (!isCurrentRoute && isUnread) + function handleDragStart(e: React.DragEvent) { e.dataTransfer.effectAllowed = 'copyMove' e.dataTransfer.setData( @@ -238,12 +245,12 @@ const SidebarChatItem = memo(function SidebarChatItem({ >
{chat.name}
{chat.id !== 'new' && ( -
- {(isActive || (!isCurrentRoute && isUnread)) && ( +
+ {showStatusDot && (