feat: add visual indication for tracked change, comments and nested comments#1770
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dde7bcc58d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acd496d171
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
acd496d to
835f839
Compare
… precedence Add regression tests for getActiveCommentId behavior: - Returns innermost comment when cursor is in nested range - Returns outer comment when cursor is outside inner range - Comments take precedence over tracked changes at same position - TC ID returned when only TC exists at cursor position - Three levels of nested comments handled correctly - Returns null when cursor is outside all comments - Adjacent non-overlapping comments identified correctly
Add regression tests for trackedChangeParentId vs parentCommentId: - Comment on TC text gets trackedChangeParentId but no parentCommentId - Threaded comment in TC has both trackedChangeParentId (for bubble) and parentCommentId (for threading) - Parent spanning outside TC has no trackedChangeParentId
…hanges Refactor getActiveCommentId to: - Build a map of all comment ranges in the document - Find which comments contain the cursor position - Return the innermost comment (smallest range) when nested - Check for comments first, fall back to TC only if no comment found
Add trackedChangeParentId field to track TC association separately from comment threading. This allows: - Comments on TC text to appear as separate bubbles (not nested under TC) - Reply threading to work correctly via parentCommentId - Proper visibility toggling based on TC vs comment association - Correct export with proper range positions Files updated: - documentCommentsImporter: add trackedChangeParentId field - comment-import-helpers: check trackedChangeParentId for TC detection - comments-helpers: use trackedChangeParentId for export positioning - use-comment: pass trackedChangeParentId through - comments-store: use trackedChangeParentId for visibility check
Previously, comments on TC text were skipped for background highlighting because they had trackedChange=true. Now all comments get proper background-color highlight regardless of TC association. Update test to verify comments on TC text receive highlighting.
Synthetic comments created for tracked changes (with trackedChange=true) should not be exported to comments.xml as they are UI-only representations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef5991d04c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| this.activeCommentId = commentId; | ||
| // Force re-render of all pages by incrementing layout version | ||
| // This bypasses the virtualization cache check | ||
| this.layoutVersion += 1; |
There was a problem hiding this comment.
From a performance perspective, is there a way to limit the re-rendering to only comment marks, or only pages with comments?
Not a blocker, but just curious.
|
Code looks good, but a couple of UX questions. It looks like we removed the threading for tracked changes, but this could be purposeful. In my conversation with @missysuperdoc we want to deviate slightly from the Word functionality and thread comments under tracked changes, for example like this (from superdoc.dev)
When I now add that same doc on this branch, it looks like this we see all of the bubbles are now separated:
|
# [1.8.0-next.11](v1.8.0-next.10...v1.8.0-next.11) (2026-01-21) ### Features * add visual indication for tracked change, comments and nested comments ([#1770](#1770)) ([8eb07e4](8eb07e4))
|
🎉 This PR is included in version 1.8.0-next.11 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
# [1.8.0](v1.7.0...v1.8.0) (2026-01-21) ### Bug Fixes * add addToHistory to new insertTrackedChange command ([#1767](#1767)) ([e5081be](e5081be)) * annotation drop ([#1789](#1789)) ([f384213](f384213)) * annotation selection ([#1762](#1762)) ([1c831cc](1c831cc)) * annotation selection, applying formatting ([#1784](#1784)) ([924af4b](924af4b)) * guard against null editor ref in telemetry handler ([#1763](#1763)) ([16b3a9a](16b3a9a)) * **layout:** default missing lineRule to auto for OOXML line spacing ([d0fd582](d0fd582)) * preserve nested comment ranges on export (SD-1518) ([#1765](#1765)) ([9b81f9a](9b81f9a)) * reorganize style resolution in the layout engine (SD-1411) ([#1786](#1786)) ([1845b76](1845b76)) * **search:** preserve leading/trailing whitespace in flexible matches ([#1788](#1788)) ([c5d6751](c5d6751)) * trigger release ([f826636](f826636)) ### Features * add insertTrackedChange programmatic shortcut ([#1761](#1761)) ([cd0628e](cd0628e)) * add visual indication for tracked change, comments and nested comments ([#1770](#1770)) ([8eb07e4](8eb07e4)) * comment anchor helpers ([#1796](#1796)) ([595bdc6](595bdc6)) * comment highlight config ([#1798](#1798)) ([aa7e957](aa7e957)) * **comments:** add position-ordered comments getter ([#1774](#1774)) ([bdac914](bdac914)) * include non-breaking spaces in search ([#1768](#1768)) ([d2784b9](d2784b9)) * search cross block anchor ([#1799](#1799)) ([09efa63](09efa63)) * view options print and web ([#1793](#1793)) ([82adcb1](82adcb1))
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |




Tracked change, comments and nested comments visual indication
Prev:

Now:
