Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Collapsing via the arrow icon causes a performance slowdown #2659

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dangold604
Copy link
Collaborator

Problem

This pull request resolve a bug causing slow action(expand/collapse) of thoughts, speed of action performance as expected.
This issue occurred because the cursor was not activated when clicking on the expanded root thought bullet.

Solution

The solution is to keep the cursor when clicking on the expanded root thought bullet.
Related to #2649

Demo

performance-issue.mp4

@raineorshine
Copy link
Contributor

raineorshine commented Nov 28, 2024

Hi, thanks for the submission.

Tapping on the bullet is only one of many ways to set the cursor to null. For example, if you hit escape or click the home icon the cursor will also be set to null. In that case, the virtualization is still broken. So the virtualization bug is not related to bullets or expansion states per se. I can see that virtualization breaks when the cursor becomes null though.

Note that at the design level, having the cursor thought be expanded is an invariant, so the suggested solution would violate that. The expansion state is determined by the location of the cursor, the surrounding thoughts, and if any thoughts are pinned. In em, unlike other outliners, you typically just navigate around, and thoughts expand/collapse automatically as the autofocus adjusts to the cursor location.

@dangold604
Copy link
Collaborator Author

@raineorshine
Are you suggesting that we should make virtualization work even when the cursor is null?

@raineorshine
Copy link
Contributor

Yes

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