Skip to content

Commit e5e8295

Browse files
andresdjassoclaude
andcommitted
style(workflow): canvas title + split-chip hover wash + pinned icon position
The workflow name now sits in the canvas chrome cluster and stays visible while a chat is docked (the controls hide, the identity doesn't). Hovering either half of the split switcher tints the whole pill — a 40% wash on the container with the hovered/open segment at full fill on its own pseudo, so the two rules never fight on specificity and opacity never dims the glyphs. The icon segment's left padding now matches the titled chip (8px), so the bubble-clock no longer shifts 2px when a chat opens. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d3e777b commit e5e8295

2 files changed

Lines changed: 31 additions & 18 deletions

File tree

apps/sim/app/workspace/[workspaceId]/components/chat-switcher/chat-switcher.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,18 @@ export function ChatSwitcher({
149149

150150
const trigger = iconOnly ? (
151151
/* Split chip: the icon opens the most recent chat outright; the chevron
152-
opens the Recents list. The 1px bg-colored divider only reads when a
153-
segment carries its fill, slicing the pill into two buttons. */
154-
<span className='flex h-[30px] flex-shrink-0 items-stretch'>
152+
opens the Recents list. Hovering either segment tints the whole pill —
153+
the hovered (or open) segment at full fill, its sibling lighter — and
154+
the 1px bg-colored divider slices the fills into two buttons. The fills
155+
are before-pseudos so opacity never dims the glyphs. */
156+
<span className='before:-z-10 relative isolate flex h-[30px] flex-shrink-0 items-stretch before:absolute before:inset-0 before:rounded-lg before:bg-[var(--surface-active)] before:opacity-0 before:transition-opacity hover-hover:hover:before:opacity-40'>
155157
<Tooltip.Root>
156158
<Tooltip.Trigger asChild>
157159
<button
158160
type='button'
159161
aria-label='Open most recent chat'
160162
onClick={handleOpenMostRecent}
161-
className='flex items-center rounded-l-lg px-1.5 transition-colors hover-hover:bg-[var(--surface-active)]'
163+
className='before:-z-10 relative isolate flex items-center rounded-l-lg pr-1.5 pl-2 before:absolute before:inset-0 before:rounded-l-lg before:bg-[var(--surface-active)] before:opacity-0 before:transition-opacity hover-hover:hover:before:opacity-100'
162164
>
163165
{chipIcon}
164166
</button>
@@ -167,17 +169,16 @@ export function ChatSwitcher({
167169
<p>Open chat</p>
168170
</Tooltip.Content>
169171
</Tooltip.Root>
170-
<span aria-hidden='true' className='w-px self-stretch bg-[var(--bg)]' />
172+
<span aria-hidden='true' className='relative w-px self-stretch bg-[var(--bg)]' />
171173
<Tooltip.Root>
172174
<Tooltip.Trigger asChild>
173175
<button
174176
type='button'
175177
aria-label='Recents'
176178
onClick={() => setOpen((prev) => !prev)}
177179
className={cn(
178-
'flex items-center rounded-r-lg px-1 transition-colors',
179-
'hover-hover:bg-[var(--surface-active)]',
180-
open && 'bg-[var(--surface-active)]'
180+
'before:-z-10 relative isolate flex items-center rounded-r-lg px-1.5 before:absolute before:inset-0 before:rounded-r-lg before:bg-[var(--surface-active)] before:opacity-0 before:transition-opacity hover-hover:hover:before:opacity-100',
181+
open && 'before:opacity-100'
181182
)}
182183
>
183184
<ChevronDown className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4234,17 +4234,29 @@ const WorkflowContent = React.memo(
42344234
{!embedded && <DiffControls />}
42354235

42364236
{/* Workspace chrome over the canvas: sidebar toggle + chat switcher
4237-
at the top-left, matching the title-bar rhythm on other pages.
4238-
Hidden while a chat is docked — the chat pane's title bar
4239-
carries both controls. */}
4240-
{!embedded && !chatDock?.isOpen && (
4237+
+ workflow title at the top-left, matching the title-bar rhythm
4238+
on other pages. The controls hide while a chat is docked (the
4239+
chat pane's title bar carries them); the title stays — it's the
4240+
editor's identity. */}
4241+
{!embedded && (
42414242
<div className='absolute top-[7px] left-[7px] z-10 flex items-center gap-1'>
4242-
<SidebarToggle />
4243-
<ChatSwitcher
4244-
iconOnly
4245-
navigateOnSelect={!chatDock}
4246-
onSelectChat={chatDock ? (chatId) => chatDock.onSelectChat(chatId) : undefined}
4247-
/>
4243+
{!chatDock?.isOpen && (
4244+
<>
4245+
<SidebarToggle />
4246+
<ChatSwitcher
4247+
iconOnly
4248+
navigateOnSelect={!chatDock}
4249+
onSelectChat={
4250+
chatDock ? (chatId) => chatDock.onSelectChat(chatId) : undefined
4251+
}
4252+
/>
4253+
</>
4254+
)}
4255+
{workflowMetadata?.name && (
4256+
<span className='max-w-[320px] truncate px-1 font-medium text-[14px] text-[var(--text-primary)]'>
4257+
{workflowMetadata.name}
4258+
</span>
4259+
)}
42484260
</div>
42494261
)}
42504262
</div>

0 commit comments

Comments
 (0)