Skip to content

chore: remove commented clearSelection in CellEditorHandler - #1075

Merged
redfish4ktc merged 1 commit into
mainfrom
chore/remove_commented_code
May 26, 2026
Merged

chore: remove commented clearSelection in CellEditorHandler#1075
redfish4ktc merged 1 commit into
mainfrom
chore/remove_commented_code

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented May 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove the commented clearSelection method in CellEditorHandler (packages/core/src/view/plugin/CellEditorHandler.ts).
  • The block was a verbatim port of mxGraph's mxCellEditor.clearSelection, but stopEditing already invokes the equivalent clearSelection utility from domUtils.ts. The two implementations only differ in the order they probe removeAllRanges vs empty, which is not observable in modern browsers.
  • This is the same mxGraph migration leftover pattern previously addressed in efb5b4b, where a stray /** left by the initial refactor silently commented out the GraphHierarchyNode.isAncestor method.

Test plan

  • npm run lint passes for the changed file
  • No behavior change at runtime: stopEditing already calls the imported clearSelection utility

Summary by CodeRabbit

  • Refactor
    • Improved internal code organization with no user-facing changes.

Review Change Stack

@redfish4ktc redfish4ktc added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label May 22, 2026
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1accf585-9480-42ba-b908-8a44d0687218

📥 Commits

Reviewing files that changed from the base of the PR and between 150ba68 and 8bff8bb.

📒 Files selected for processing (1)
  • packages/core/src/view/plugin/CellEditorHandler.ts
💤 Files with no reviewable changes (1)
  • packages/core/src/view/plugin/CellEditorHandler.ts

Walkthrough

The PR removes a duplicate clearSelection() method from CellEditorHandler and relies on the imported clearSelection utility from domUtils; stopEditing is repositioned after isSelectText.

Changes

Remove duplicate selection clearing

Layer / File(s) Summary
Remove duplicate clearSelection method
packages/core/src/view/plugin/CellEditorHandler.ts
The class-local clearSelection() method is removed and selection clearing now uses the clearSelection utility from domUtils.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

refactor

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description provides a clear summary, rationale, and test plan, but does not reference an existing issue or use issue-linking keywords as required by the template. Add issue reference (e.g., 'closes #xxxx' or 'fixes #xxxx') to the overview section, or explain if this is a minor change not tied to a specific issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: removing commented-out code (the clearSelection method) from CellEditorHandler, which is exactly what the changeset does.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@redfish4ktc
redfish4ktc force-pushed the chore/remove_commented_code branch from 150ba68 to b2af590 Compare May 22, 2026 15:50
The commented clearSelection method mirrored the original mxGraph implementation but was already superseded by the
clearSelection utility from domUtils, which is invoked in stopEditing. Both implementations are functionally
equivalent, so the dead code can be removed.

This is the same mxGraph migration leftover pattern previously addressed in efb5b4b, where a stray /** left by the
initial refactor silently commented out the GraphHierarchyNode.isAncestor method.
@redfish4ktc
redfish4ktc force-pushed the chore/remove_commented_code branch from b2af590 to 8bff8bb Compare May 22, 2026 15:53
@sonarqubecloud

Copy link
Copy Markdown

@redfish4ktc
redfish4ktc merged commit 0b08535 into main May 26, 2026
14 checks passed
@redfish4ktc
redfish4ktc deleted the chore/remove_commented_code branch May 26, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant