Skip to content

fix: unable to undo after unique id#8238

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix-allow_id_addtohistory
Dec 4, 2025
Merged

fix: unable to undo after unique id#8238
sriramveeraghanta merged 1 commit intopreviewfrom
fix-allow_id_addtohistory

Conversation

@iam-vipin
Copy link
Member

@iam-vipin iam-vipin commented Dec 4, 2025

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Refactor
    • Adjusted how generated identifiers interact with undo history. The behavior is now determined by surrounding code context rather than an explicit control setting.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 4, 2025 09:02
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

A comment line has been modified in the unique-id plugin to document the removal of an explicit meta call that previously prevented generated IDs from being added to the undo history.

Changes

Cohort / File(s) Summary
Unique ID Plugin Configuration
packages/editor/src/core/extensions/unique-id/plugin.ts
Commented out tr.setMeta("addToHistory", false) call with explanatory documentation; no alternative behavior or functional replacement introduced.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single file with a comment-only modification
  • No functional logic changes or new code paths introduced
  • Straightforward documentation of existing behavior

Poem

A rabbit hops through code so neat,
A comment here makes change complete,
No logic lost, just words rearranged,
The history flows in gentler change,
Thump thump!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete with only the Type of Change section filled out; Description, Screenshots/Media, Test Scenarios, and References sections lack substantive content. Add detailed description of the undo issue, include test scenarios demonstrating the fix, and reference any related issues or PR discussions.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: unable to undo after unique id' clearly summarizes the main change—fixing an undo issue related to unique ID functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-allow_id_addtohistory

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.

@Palanikannan1437 Palanikannan1437 changed the title fix: undo unique id fix: unable to undo after unique id Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a bug with the undo feature in the editor's unique-id extension by commenting out a line that was preventing ID generation transactions from being added to the undo history. The commented-out line was causing issues with the undo functionality, so it has been temporarily disabled with an explanatory comment.

Key Changes

  • Commented out tr.setMeta("addToHistory", false) in the unique-id plugin's appendTransaction handler to fix undo feature issues

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// Don't add ID generation to undo history
tr.setMeta("addToHistory", false);
// since its causing issue with undo feature we are commmeting it out for now
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

Spelling error: "commmeting" should be "commenting".

Suggested change
// since its causing issue with undo feature we are commmeting it out for now
// since its causing issue with undo feature we are commenting it out for now

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/editor/src/core/extensions/unique-id/plugin.ts (1)

96-99: Clarify undo-history behavior in comments and fix typos

Right now the comments are misleading and a bit hard to read:

  • Line 96 still says “Don’t add ID generation to undo history”, but tr.setMeta("addToHistory", false) is commented out, so ID-generation changes are now tracked in history (which seems intentional per the PR title).
  • Line 97 has typos (its, commmeting) and doesn’t clearly describe what problem the meta flag caused.

I’d suggest making the intent explicit and cleaning up the wording, e.g.:

-      // Don't add ID generation to undo history
-      // since its causing issue with undo feature we are commmeting it out for now
-      // tr.setMeta("addToHistory", false);
+      // NOTE: We previously set `addToHistory = false` here to avoid adding ID generation to the undo history.
+      // This caused issues with the undo feature, so the meta flag is intentionally disabled for now.
+      // tr.setMeta("addToHistory", false);

This keeps the historical context, explains why the flag is off, and avoids confusion for future readers about the actual undo behavior.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22da267 and 8050222.

📒 Files selected for processing (1)
  • packages/editor/src/core/extensions/unique-id/plugin.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • packages/editor/src/core/extensions/unique-id/plugin.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)

@sriramveeraghanta sriramveeraghanta merged commit 739b1bf into preview Dec 4, 2025
11 of 13 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-allow_id_addtohistory branch December 4, 2025 09:15
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants