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

Fold: Misc. fixes and headaches #264

Open
mkoskim opened this issue Oct 15, 2024 · 0 comments
Open

Fold: Misc. fixes and headaches #264

mkoskim opened this issue Oct 15, 2024 · 0 comments
Labels
need fix Something needs fixing at some point

Comments

@mkoskim
Copy link
Owner

mkoskim commented Oct 15, 2024

Folding is great feature, but it is also a great headache.

First and foremost: Currently folding is implemented with CSS "magic". When you fold a group, its class becomes "folded", which contains display: none setting in the CSS. But some elements are left visible, like scene headers in folded chapter, and chapter headers in folded act.

Using CSS to implement folding makes it quite fast. Nothing is really removed from the DOM, some things are just not visible, even when they are there.

But this messes up with SlateJS (browser's) cursor movement. You can get lost to hidden elements. Also, if some parts are entirely folded (e.g. scenes without a heading), you can get all sorts of "quirks" when using arrow keys: you may not be able to move to scene to unfold it, or cursor may go to the end of the document. Anything can happen.

So, even thought folding is just crucial feature, there is lots of work and studying to make its implementation fast, convenient and robust.


Related issues:

@mkoskim mkoskim added the need fix Something needs fixing at some point label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need fix Something needs fixing at some point
Projects
None yet
Development

No branches or pull requests

1 participant