Skip to content

docs: improve JSDoc of UndoManager#1007

Merged
tbouffard merged 4 commits intomainfrom
docs/improve_undo-manager_jsdoc
Feb 19, 2026
Merged

docs: improve JSDoc of UndoManager#1007
tbouffard merged 4 commits intomainfrom
docs/improve_undo-manager_jsdoc

Conversation

@tbouffard
Copy link
Copy Markdown
Member

@tbouffard tbouffard commented Feb 18, 2026

Summary by CodeRabbit

  • Documentation
    • Updated internal API docs and examples to use current terminology and clearer event names.
    • Clarified payload descriptions and example usage in comments for better developer understanding.
    • Confirmed no runtime behavior or public API signatures were changed.

@tbouffard tbouffard added the documentation Improvements or additions to documentation label Feb 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Comments and JSDoc in UndoManager.ts were updated to replace legacy mx-* names with current public types and event identifiers (e.g., mxUndoableChangeUndoableEdit, mxEventInternalEvent, mxGraphModelGraphDataModel), update change-type names, and modernize example code. No runtime logic, signatures, or exported APIs changed.

Changes

Cohort / File(s) Summary
Documentation Updates
packages/core/src/view/undoable-change/UndoManager.ts
Rewrote comments/JSDoc to use current API names: mxUndoableChangeUndoableEdit, mxGraphView/mxGraphModelGraphView/GraphDataModel, mxEvent.*InternalEvent.* (CLEAR, UNDO, REDO, ADD). Adjusted change-type names (RootChange, ChildChange, TerminalChange), updated payload descriptions to UndoableEdit, and modernized example code (const, standard functions) and listener binding references. All edits are comment-only; no code or signature changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided. The template requires an Overview section explaining what and why is changed, along with PR checklist items. Add a pull request description including: an Overview section explaining the JSDoc improvements, confirmation of relevant PR checklist items (especially whether this addresses an existing issue), and any additional notes for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: improving JSDoc documentation of UndoManager. It follows Conventional Commits format with 'docs' type and is concise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/view/undoable-change/UndoManager.ts (1)

57-58: ⚠️ Potential issue | 🟡 Minor

Legacy mxEvent.UNDO reference in code example was not updated.

The example still uses the mxEvent namespace which no longer exists in maxGraph. Since InternalEvent is already imported in this file (line 19), the example should reference InternalEvent.UNDO.

📝 Proposed fix
- graph.getDataModel().addListener(mxEvent.UNDO, listener);
- graph.getView().addListener(mxEvent.UNDO, listener);
+ graph.getDataModel().addListener(InternalEvent.UNDO, listener);
+ graph.getView().addListener(InternalEvent.UNDO, listener);

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

@sonarqubecloud
Copy link
Copy Markdown

@tbouffard tbouffard merged commit 3f18a2b into main Feb 19, 2026
6 checks passed
@tbouffard tbouffard deleted the docs/improve_undo-manager_jsdoc branch February 19, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant