Skip to content

Commit 44f7229

Browse files
andresdjassoclaude
andcommitted
style(chrome): drop the content card frame in floating-stage mode
The stacked cards floated inside the workspace chrome's bordered content card, which framed the whole composition in an outline. A new non-persisted isStageFloating flag on the sidebar store (set by the workflow shell while the stack is card-forward) tells the chrome to drop the content card's border/rounding and paint the backdrop in --surface-1, so the chat module and stack cards float directly on chrome space. The frame returns the moment the editor comes forward or the stack closes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3df0261 commit 44f7229

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export function WorkspaceChrome({ children }: WorkspaceChromeProps) {
6161
const openFlyout = useSidebarStore((s) => s.openFlyout)
6262
const scheduleFlyoutClose = useSidebarStore((s) => s.scheduleFlyoutClose)
6363
const closeFlyout = useSidebarStore((s) => s.closeFlyout)
64+
const isStageFloating = useSidebarStore((s) => s.isStageFloating)
6465

6566
// Hide the flyout after navigating from it.
6667
useEffect(() => {
@@ -134,8 +135,13 @@ export function WorkspaceChrome({ children }: WorkspaceChromeProps) {
134135
>
135136
<div
136137
className={cn(
137-
'flex-1 overflow-hidden bg-[var(--bg)]',
138-
(isFullscreen || !isCollapsed) && 'rounded-[8px] border border-[var(--border)]'
138+
'flex-1 overflow-hidden',
139+
// Floating-stage mode: the content renders as detached cards on
140+
// the chrome backdrop, so the content card frame disappears.
141+
isStageFloating ? 'bg-[var(--surface-1)]' : 'bg-[var(--bg)]',
142+
(isFullscreen || !isCollapsed) &&
143+
!isStageFloating &&
144+
'rounded-[8px] border border-[var(--border)]'
139145
)}
140146
>
141147
{children}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type {
1818
import Workflow from '@/app/workspace/[workspaceId]/w/[workflowId]/workflow'
1919
import { useWorkflows } from '@/hooks/queries/workflows'
2020
import { useMothershipTabsStore } from '@/stores/mothership-tabs/store'
21+
import { useSidebarStore } from '@/stores/sidebar/store'
2122
import { DockedChat } from './docked-chat'
2223

2324
/** Sentinel `?chat=` value for a docked chat that hasn't been created yet. */
@@ -281,12 +282,19 @@ export function WorkflowWithChat() {
281282
return () => window.removeEventListener('resize', handleWindowResize)
282283
}, [])
283284

284-
if (!workspaceId || !workflowId) return null
285-
286285
// Stacked-card mode: the stage stops being a panel — everything floats as
287286
// detached modules on the workspace chrome backdrop, chat included.
288287
const isStackMode = stackOpen && stageFront === 'card'
289288

289+
// The workspace chrome drops its content card frame while modules float.
290+
const setStageFloating = useSidebarStore((s) => s.setStageFloating)
291+
useEffect(() => {
292+
setStageFloating(isStackMode)
293+
return () => setStageFloating(false)
294+
}, [isStackMode, setStageFloating])
295+
296+
if (!workspaceId || !workflowId) return null
297+
290298
return (
291299
<div className={cn('flex h-full w-full', isStackMode && 'bg-[var(--surface-1)]')}>
292300
{dock.open && (

apps/sim/stores/sidebar/store.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const useSidebarStore = create<SidebarState>()(
5353
sidebarWidth: SIDEBAR_WIDTH.DEFAULT,
5454
isCollapsed: false,
5555
isFlyoutOpen: false,
56+
isStageFloating: false,
5657
_hasHydrated: false,
5758
setWorkspaceDropdownOpen: (isOpen) => set({ workspaceDropdownOpen: isOpen }),
5859
setSidebarWidth: (width) => {
@@ -106,6 +107,9 @@ export const useSidebarStore = create<SidebarState>()(
106107
if (clampedWidth !== sidebarWidth) set({ sidebarWidth: clampedWidth })
107108
applySidebarWidth(clampedWidth)
108109
},
110+
setStageFloating: (floating) => {
111+
if (get().isStageFloating !== floating) set({ isStageFloating: floating })
112+
},
109113
setHasHydrated: (hasHydrated) => set({ _hasHydrated: hasHydrated }),
110114
}),
111115
{

apps/sim/stores/sidebar/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export interface SidebarState {
88
isCollapsed: boolean
99
/** Whether the hover flyout menu is showing while the sidebar is collapsed */
1010
isFlyoutOpen: boolean
11+
/**
12+
* The content area is in floating-stage mode (workflow stage stack): panes
13+
* render as detached cards on the chrome backdrop, so the workspace chrome
14+
* drops its content card frame entirely.
15+
*/
16+
isStageFloating: boolean
1117
_hasHydrated: boolean
1218
setWorkspaceDropdownOpen: (isOpen: boolean) => void
1319
setSidebarWidth: (width: number) => void
@@ -32,5 +38,7 @@ export interface SidebarState {
3238
* default (e.g. soft navigation) or grew wider than a now-smaller window.
3339
*/
3440
syncWidth: () => void
41+
/** Enters/leaves floating-stage mode (see {@link SidebarState.isStageFloating}). */
42+
setStageFloating: (floating: boolean) => void
3543
setHasHydrated: (hasHydrated: boolean) => void
3644
}

0 commit comments

Comments
 (0)