@@ -368,7 +368,7 @@ function DirectEditPanelContent() {
368368 handleMoveComplete,
369369 addComment, submitCommentDraft, addCommentReply, deleteComment, exportComment,
370370 sendCommentToAgent, setActiveCommentId,
371- startTextEditing, toggleEditMode, deleteSelection,
371+ startTextEditing, toggleEditMode, deleteSelection, setCommentDraftText , setCommentDraftBlockedHandler ,
372372 } = useDirectEditActions ( )
373373
374374 const {
@@ -399,7 +399,8 @@ function DirectEditPanelContent() {
399399
400400 React . useEffect ( ( ) => {
401401 commentDraftRef . current = ''
402- } , [ activeCommentId ] )
402+ setCommentDraftText ( '' )
403+ } , [ activeCommentId , setCommentDraftText ] )
403404
404405 const activeDraftComment = React . useMemo ( ( ) => {
405406 if ( ! commentTargetElement || ! activeCommentId ) return null
@@ -428,6 +429,21 @@ function DirectEditPanelContent() {
428429 ) )
429430 } , [ ] )
430431
432+ React . useEffect ( ( ) => {
433+ if ( ! activeCommentId ) {
434+ setCommentDraftBlockedHandler ( null )
435+ return
436+ }
437+
438+ setCommentDraftBlockedHandler ( ( ) => {
439+ triggerCommentInputAttention ( activeCommentId )
440+ } )
441+
442+ return ( ) => {
443+ setCommentDraftBlockedHandler ( null )
444+ }
445+ } , [ activeCommentId , setCommentDraftBlockedHandler , triggerCommentInputAttention ] )
446+
431447 const hasPendingCommentDraft = React . useCallback ( ( nextCommentId : string | null = null ) => {
432448 if ( ! activeCommentId ) return false
433449 if ( nextCommentId && nextCommentId === activeCommentId ) return false
@@ -548,6 +564,7 @@ function DirectEditPanelContent() {
548564 comment = { activeDraftComment }
549565 attentionNonce = { commentInputAttention ?. commentId === activeDraftComment . id ? commentInputAttention . nonce : 0 }
550566 draftRef = { commentDraftRef }
567+ onDraftTextChange = { setCommentDraftText }
551568 onSubmit = { ( text ) => submitCommentDraft ( activeDraftComment . id , text ) }
552569 onCancel = { ( ) => handleSetActiveComment ( null ) }
553570 /> ,
0 commit comments