Summary
The inline comment editor destroys its own TipTap instance when the comment list refetches while a comment is being edited, leaving a destroyed ProseMirror instance mounted.
Severity
High (editing UX) — code-confirmed; live repro requires a comment-list refetch to land while editing (e.g. a concurrent update/poll).
Affected code
ui/src/components/work-item/CommentEditor.tsx:67 — useEditor(...) is created with no recreation deps (returns a single instance).
ui/src/components/work-item/CommentEditor.tsx:90-100 — an effect keyed on [editor, initialHtml] whose cleanup calls editor.destroy() (line 98). When initialHtml changes while mounted, React runs the cleanup -> editor.destroy(), but the hook still returns the same now-destroyed instance.
- Line 93 —
setContent(initialHtml || '') uses the default emitUpdate: true, dirtying the doc on every seed.
- The inline edit composer passes a live
initialHtml={c.comment} from ui/src/pages/IssueDetailPage.tsx:746-747.
Impact
Mid-edit the editor can become non-functional (cannot type/format) and emits destroyed-instance console errors.
Suggested fix
Remove the manual editor.destroy() (the hook tears down on unmount). Only call setContent when initialHtml genuinely differs from editor.getHTML(), passing { emitUpdate: false }.
Summary
The inline comment editor destroys its own TipTap instance when the comment list refetches while a comment is being edited, leaving a destroyed ProseMirror instance mounted.
Severity
High (editing UX) — code-confirmed; live repro requires a comment-list refetch to land while editing (e.g. a concurrent update/poll).
Affected code
ui/src/components/work-item/CommentEditor.tsx:67—useEditor(...)is created with no recreation deps (returns a single instance).ui/src/components/work-item/CommentEditor.tsx:90-100— an effect keyed on[editor, initialHtml]whose cleanup callseditor.destroy()(line 98). WheninitialHtmlchanges while mounted, React runs the cleanup ->editor.destroy(), but the hook still returns the same now-destroyed instance.setContent(initialHtml || '')uses the defaultemitUpdate: true, dirtying the doc on every seed.initialHtml={c.comment}fromui/src/pages/IssueDetailPage.tsx:746-747.Impact
Mid-edit the editor can become non-functional (cannot type/format) and emits destroyed-instance console errors.
Suggested fix
Remove the manual
editor.destroy()(the hook tears down on unmount). Only callsetContentwheninitialHtmlgenuinely differs fromeditor.getHTML(), passing{ emitUpdate: false }.