Skip to content

Commit d37d02a

Browse files
andresdjassoclaude
andcommitted
style(workflow): stage stack as detached cards — back card is identity only
The stacked state is now two clean card panes over an opaque stage: a slim back-card bar showing just the workflow icon + name (no canvas, controls, or panel bleeding through the peek), and a fully rounded, inset front pane for the resource tabs. The back card sits narrower than the front for toast-stack depth and clicking it brings the editor forward; the editor stays mounted and live underneath throughout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 062867c commit d37d02a

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/docked-chat/workflow-with-chat.tsx

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import { useParams, useSearchParams } from 'next/navigation'
55
import { Tooltip } from '@/components/emcn'
6-
import { X } from '@/components/emcn/icons'
6+
import { Workflow as WorkflowIcon, X } from '@/components/emcn/icons'
77
import { isMothershipPageId, MOTHERSHIP_PAGES } from '@/lib/copilot/resources/types'
88
import {
99
MothershipResourcesProvider,
@@ -14,6 +14,7 @@ import type {
1414
MothershipResourceType,
1515
} from '@/app/workspace/[workspaceId]/home/types'
1616
import Workflow from '@/app/workspace/[workspaceId]/w/[workflowId]/workflow'
17+
import { useWorkflows } from '@/hooks/queries/workflows'
1718
import { useMothershipTabsStore } from '@/stores/mothership-tabs/store'
1819
import { DockedChat } from './docked-chat'
1920

@@ -39,6 +40,9 @@ export function WorkflowWithChat() {
3940
const searchParams = useSearchParams()
4041
const initialChatParam = searchParams.get('chat')
4142

43+
const { data: workflows = [] } = useWorkflows(workspaceId)
44+
const workflowName = workflows.find((workflow) => workflow.id === workflowId)?.name ?? 'Workflow'
45+
4246
const [dock, setDock] = useState<DockState>(() =>
4347
initialChatParam
4448
? {
@@ -308,17 +312,30 @@ export function WorkflowWithChat() {
308312
/>
309313
{stackOpen && (
310314
<>
311-
{/* The peek: the editor's own title strip shows through this
312-
transparent band — clicking it brings the workflow forward. */}
315+
{/* Opaque stage backdrop: the editor stays mounted and live
316+
underneath, but the back card shows only its identity — never
317+
slices of canvas or controls. */}
318+
<div aria-hidden='true' className='absolute inset-0 z-30 bg-[var(--bg)]' />
319+
{/* The back card: a slim bar with just the workflow icon + name,
320+
peeking above the front card (toast-stack depth). Narrower
321+
than the front so it reads as behind; clicking it brings the
322+
workflow forward. */}
313323
<button
314324
type='button'
315325
aria-label='Back to workflow'
316326
onClick={collapseStack}
317-
className='absolute inset-x-0 top-0 z-30 h-[44px] cursor-pointer'
318-
/>
327+
className='absolute inset-x-4 top-2 z-30 flex h-[52px] items-start rounded-t-xl border border-[var(--border-1)] bg-[var(--surface-5)] px-3 transition-colors hover-hover:bg-[var(--surface-active)] dark:bg-[var(--surface-4)]'
328+
>
329+
<span className='flex h-[42px] min-w-0 items-center gap-1.5'>
330+
<WorkflowIcon className='size-[14px] flex-shrink-0 text-[var(--text-icon)]' />
331+
<span className='truncate font-medium text-[14px] text-[var(--text-body)]'>
332+
{workflowName}
333+
</span>
334+
</span>
335+
</button>
319336
{/* The front card: the workspace resource tabs + active content,
320-
stacked over the editor with toast-stack depth. */}
321-
<div className='absolute inset-x-2 top-[44px] bottom-0 z-30 flex animate-slide-in-bottom flex-col overflow-hidden rounded-t-xl border border-[var(--border-1)] border-b-0 bg-[var(--bg)] shadow-sm'>
337+
a fully detached rounded pane over the back card. */}
338+
<div className='absolute inset-x-2 top-[46px] bottom-2 z-30 flex animate-slide-in-bottom flex-col overflow-hidden rounded-xl border border-[var(--border-1)] bg-[var(--bg)] shadow-sm'>
322339
<MothershipResourcesProvider
323340
selectResource={selectStageTab}
324341
addResource={addStageTab}

0 commit comments

Comments
 (0)