fix(activity-feed-v2): dedupe prosemirror-model to fix mention selection#4680
Conversation
The threaded-annotations 3.x bump (tiptap 3) left a stale prosemirror-model 1.25.4 entry in yarn.lock while @tiptap/pm required ^1.25.7, so two copies were installed and selecting a mention user threw "RangeError: Can not convert <mention, ' '> to a Fragment". Dedupe prosemirror-model/-view to a single version so only one copy is loaded.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merge Queue Status
This pull request spent 10 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Summary
RangeError: Can not convert <mention, " "> to a Fragment (looks like multiple versions of prosemirror-model were loaded), so the mention was never inserted.@box/threaded-annotationsto 3.x (tiptap 3).@tiptap/pmrequiresprosemirror-model@^1.25.7, butyarn.lockkept a staleprosemirror-model@1.25.4entry thatprosemirror-state/prosemirror-view/prosemirror-tablesstill resolved to, so two copies ofprosemirror-model(andprosemirror-view) were installed. The editor schema and the transaction pipeline used different copies, breaking theinstanceofchecks during mention insertion.prosemirror-model(single 1.25.9) andprosemirror-view(single 1.42.0) inyarn.lock. All existing semver ranges are satisfied by the deduped versions; no package.json changes.Test plan
@box/activity-feededitor: typing@Aliopens the dropdown in both cases; selecting a user threw the RangeError before this change and correctly inserts the mention node after.yarn installproduces a singleprosemirror-model/prosemirror-viewcopy (no nested copy under@tiptap/pm/node_modules).src/elements/content-sidebar/activity-feed-v2jest suite passes (342 tests).