add workflow comment panel

This commit is contained in:
hjlarry
2025-09-16 09:51:12 +08:00
parent b3838581fd
commit 10aa16b471
4 changed files with 109 additions and 3 deletions

View File

@ -73,9 +73,16 @@ export const useWorkflowComment = () => {
}, [setControlMode, setPendingComment])
const handleCommentIconClick = useCallback((comment: WorkflowCommentList) => {
// TODO: display comment details
console.log('Comment clicked:', comment)
}, [])
try {
const store = useStore.getState()
store.setControlMode(ControlMode.Comment)
store.setActiveCommentId(comment.id)
reactflow.setCenter(comment.position_x, comment.position_y, { zoom: 1, duration: 600 })
}
catch (e) {
console.error('Failed to open comments panel:', e)
}
}, [reactflow])
const handleCreateComment = useCallback((mousePosition: { pageX: number; pageY: number }) => {
if (controlMode === ControlMode.Comment) {