Skip to content

Commit cfa9f66

Browse files
andresdjassoclaude
andcommitted
fix(panel): add the mothership-panel store missing from the resize commit
The persisted split-width store (stores/mothership-panel) never made it into "the split remembers" — the branch referenced a module that only existed in the working tree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 99db8fa commit cfa9f66

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

  • apps/sim/stores/mothership-panel
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { create } from 'zustand'
2+
import { devtools, persist } from 'zustand/middleware'
3+
4+
/**
5+
* Persisted split geometry for the Mothership surfaces, so a user's resize
6+
* survives view switches, route changes, and reloads. Widths are px;
7+
* `null` means the user never resized (CSS defaults apply). Consumers clamp
8+
* to the current viewport on apply — never at save time.
9+
*/
10+
interface MothershipPanelState {
11+
/** Resource panel width on the chat surface. */
12+
panelWidth: number | null
13+
/** Docked chat pane width on the workflow route. */
14+
chatPaneWidth: number | null
15+
setPanelWidth: (width: number) => void
16+
setChatPaneWidth: (width: number) => void
17+
}
18+
19+
export const useMothershipPanelStore = create<MothershipPanelState>()(
20+
devtools(
21+
persist(
22+
(set) => ({
23+
panelWidth: null,
24+
chatPaneWidth: null,
25+
setPanelWidth: (width) => set({ panelWidth: width }),
26+
setChatPaneWidth: (width) => set({ chatPaneWidth: width }),
27+
}),
28+
{ name: 'mothership-panel' }
29+
),
30+
{ name: 'mothership-panel-store' }
31+
)
32+
)

0 commit comments

Comments
 (0)