Skip to content

fix(tracked-changes): sync tracked changes store on undo and redo#2164

Open
palmer-cl wants to merge 4 commits intomainfrom
colep/sd-1893-bug-undo-tracked-change-leaves-suggestion-bubble-side-panel
Open

fix(tracked-changes): sync tracked changes store on undo and redo#2164
palmer-cl wants to merge 4 commits intomainfrom
colep/sd-1893-bug-undo-tracked-change-leaves-suggestion-bubble-side-panel

Conversation

@palmer-cl
Copy link
Collaborator

  • fix undo and redo logic with tracked changes
  • add behavior tests and visual tests

@linear
Copy link

linear bot commented Feb 24, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48eb61710e

ℹ️ 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".

Copy link
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid fix - guard removal + explicit sync on undo/redo addresses the actual data flow gap (PR #2195 will prob conflict here)

if (!Object.keys(currentPositions).length) return 0;

const toNormalizedId = (id) => (id === undefined || id === null ? null : String(id));
const getCommentAliasIds = (comment) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias strategies are different in three places - store's getCommentAliasIds includes getCommentPositionKey, vue's version only uses [importedId, commentId], and getFloatingComments uses commentId || importedId.

they converge for new tracked changes but will mismatch on imported docs with both IDs.

@@ -823,9 +932,6 @@ export const useCommentsStore = defineStore('comments', () => {
* @returns {void}
*/
const handleEditorLocationsUpdate = (allCommentPositions) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct for undo, but changes behavior for all callers.

heads up: #2195 is incoming and touches the same files (FloatingComments.vue, comments-store.js, SuperDoc.vue) - it adds stale cleanup in FloatingComments that mitigates any flicker from transient empty payloads, so should be safe once both land

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants