refactor(web): migrate workflow-variable-inpsect-panel-height to useSetLocalStorage (#36982)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Li zhongyu 2026-06-03 11:48:59 +08:00 committed by GitHub
parent 7507e9ba67
commit 7968d2c3c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -4894,11 +4894,6 @@
"count": 2
}
},
"web/app/components/workflow/variable-inspect/index.tsx": {
"no-restricted-globals": {
"count": 1
}
},
"web/app/components/workflow/variable-inspect/left.tsx": {
"ts/no-explicit-any": {
"count": 1

View File

@ -5,6 +5,7 @@ import {
useCallback,
useMemo,
} from 'react'
import { useSetLocalStorage } from '@/hooks/use-local-storage'
import { useResizePanel } from '../nodes/_base/hooks/use-resize-panel'
import { useStore } from '../store'
import Panel from './panel'
@ -21,10 +22,12 @@ const VariableInspectPanel: FC = () => {
return workflowCanvasHeight - 60
}, [workflowCanvasHeight])
const setPanelHeightStorage = useSetLocalStorage<string>('workflow-variable-inpsect-panel-height', { raw: true })
const handleResize = useCallback((width: number, height: number) => {
localStorage.setItem('workflow-variable-inpsect-panel-height', `${height}`)
setPanelHeightStorage(`${height}`)
setVariableInspectPanelHeight(height)
}, [setVariableInspectPanelHeight])
}, [setVariableInspectPanelHeight, setPanelHeightStorage])
const {
triggerRef,