Commit fbbb9f7
fix(penpal): render pending comment highlights via rehype plugin instead of DOM mutation
The pending highlight (shown while composing a new comment) was applied
by directly mutating React-managed DOM — wrapping text nodes in <mark>
elements. When an SSE event raced with comment submission, React would
re-render the MarkdownViewer and encounter unexpected nodes during
reconciliation, crashing with "The object can not be found here."
Move the pending highlight into the existing rehypeCommentHighlights
plugin so React owns the full lifecycle. When pendingAnchor is set, it's
added to the threadHighlights array with a `pending` flag that adds the
`pending-highlight` CSS class alongside `comment-highlight`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent e126595 commit fbbb9f7
7 files changed
Lines changed: 8105 additions & 54 deletions
File tree
- apps/penpal/frontend
- src
- components
- pages
0 commit comments