Skip to content

🐛(frontend) fix phantom selection issue between nodes#126

Open
Ovgodd wants to merge 2 commits intomainfrom
fix/treeview-phantom-selection
Open

🐛(frontend) fix phantom selection issue between nodes#126
Ovgodd wants to merge 2 commits intomainfrom
fix/treeview-phantom-selection

Conversation

@Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Oct 13, 2025

Purpose

This PR fixes a phantom selection issue that occurred when switching between nodes in the document editor. It ensures that no invisible selection persists when moving between elements.

To test it just ajust rowHeight in TreeView to 50 and clic between nodes

issue : 1472

Before :

internodebefore.mp4

After:

internodeafter.mp4

Proposal

  • Fix node selection logic to prevent phantom selections
  • Ensure selection state is properly cleared when switching nodes
  • Manually tested across multiple node transitions to validate behavior

@Ovgodd Ovgodd self-assigned this Oct 13, 2025
paddingTop={10}
paddingBottom={10}
rowHeight={35}
rowHeight={50}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it is just for dev purpose, no?

Copy link
Collaborator Author

@Ovgodd Ovgodd Oct 16, 2025

Choose a reason for hiding this comment

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

Yes you guessed right aha

Comment on lines 403 to 405
onMouseDown={handleRowMouseEvent}
onClick={handleRowMouseEvent}
onKeyDown={handleKeyDown}
Copy link
Contributor

Choose a reason for hiding this comment

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

I find handleRowMouseEvent does not solve the root problem, it is more a patch.

The root problem seems to have the children that is not the same height as the parent, on Docs c__tree-view--row is 35px, when the child is --docs-sub-page-item 30px, could we have the child that inherit from the parent height instead, and add a margin in c__tree-view--row to keep the space between rows ?
If we do that I have the feeling we will not need to add this pathc, wdyt ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or rowHeight could be a prop as well, to fit the app need.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a good catch and I agree, when I manually set the PX of c__tree-view--row the bug disappear,

So make a rowHeight prop is a great idea imo

@Ovgodd Ovgodd force-pushed the fix/treeview-phantom-selection branch from 5feb6b6 to 7f76e59 Compare October 16, 2025 09:52
prevents invisible selections when switching between node elements

Signed-off-by: Cyril <c.gromoff@gmail.com>
@Ovgodd Ovgodd force-pushed the fix/treeview-phantom-selection branch from 7f76e59 to 24b921f Compare October 20, 2025 06:31
@Ovgodd Ovgodd requested a review from AntoLC October 20, 2025 09:19
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.

2 participants