mirror of
https://github.com/langgenius/dify.git
synced 2026-01-19 03:35:06 +08:00
fix: remove panelWidth prop in panel slice, use default value 420 in layout slice(single source)
This commit is contained in:
@ -26,12 +26,12 @@ const Wrap = ({
|
||||
isExpand,
|
||||
children,
|
||||
}: Props) => {
|
||||
const panelWidth = useStore(state => state.panelWidth)
|
||||
const nodePanelWidth = useStore(state => state.nodePanelWidth)
|
||||
const wrapStyle = (() => {
|
||||
if (isExpand) {
|
||||
return {
|
||||
...style,
|
||||
width: panelWidth - 1,
|
||||
width: nodePanelWidth - 1,
|
||||
}
|
||||
}
|
||||
return style
|
||||
|
||||
@ -32,7 +32,7 @@ export const createLayoutSlice: StateCreator<LayoutSliceShape> = set => ({
|
||||
setWorkflowCanvasHeight: height => set(() => ({ workflowCanvasHeight: height })),
|
||||
rightPanelWidth: undefined,
|
||||
setRightPanelWidth: width => set(() => ({ rightPanelWidth: width })),
|
||||
nodePanelWidth: storage.getNumber(STORAGE_KEYS.WORKFLOW.NODE_PANEL_WIDTH, 400),
|
||||
nodePanelWidth: storage.getNumber(STORAGE_KEYS.WORKFLOW.NODE_PANEL_WIDTH, 420),
|
||||
setNodePanelWidth: width => set(() => ({ nodePanelWidth: width })),
|
||||
previewPanelWidth: storage.getNumber(STORAGE_KEYS.WORKFLOW.PREVIEW_PANEL_WIDTH, 400),
|
||||
setPreviewPanelWidth: width => set(() => ({ previewPanelWidth: width })),
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
import type { StateCreator } from 'zustand'
|
||||
import { STORAGE_KEYS } from '@/config/storage-keys'
|
||||
import { storage } from '@/utils/storage'
|
||||
|
||||
export type PanelSliceShape = {
|
||||
panelWidth: number
|
||||
showFeaturesPanel: boolean
|
||||
setShowFeaturesPanel: (showFeaturesPanel: boolean) => void
|
||||
showWorkflowVersionHistoryPanel: boolean
|
||||
@ -29,7 +26,6 @@ export type PanelSliceShape = {
|
||||
}
|
||||
|
||||
export const createPanelSlice: StateCreator<PanelSliceShape> = set => ({
|
||||
panelWidth: storage.getNumber(STORAGE_KEYS.WORKFLOW.NODE_PANEL_WIDTH, 420),
|
||||
showFeaturesPanel: false,
|
||||
setShowFeaturesPanel: showFeaturesPanel => set(() => ({ showFeaturesPanel })),
|
||||
showWorkflowVersionHistoryPanel: false,
|
||||
|
||||
Reference in New Issue
Block a user