Skip to content

editor: reveal fold buttons on hover#4056

Merged
tvanderstad merged 2 commits intomasterfrom
fold-buttons-on-hover
Dec 26, 2025
Merged

editor: reveal fold buttons on hover#4056
tvanderstad merged 2 commits intomasterfrom
fold-buttons-on-hover

Conversation

@tvanderstad
Copy link
Copy Markdown
Contributor

hover-reveal-fold-buttons.mov

The code for fold buttons remains untidy as I'm still figuring out how this ought to work. The conditions for revealing the fold button are:

  • Is the button itself hovered?
  • For headings, is the heading text hovered?
  • For list items, is the region where children nodes are rendered hovered?

This is what was simplest to implement and I'd like to see how it goes. One shortcoming here is that I haven't worked out the hit-testing i.e. the fold button could still be revealed if the hovered location is behind a modal like settings. To fix this, I should use the hit-testing system, but if I did that the text itself (in a list item) would cover the much of the area where the children nodes are rendered and prevent hovers from registering. I think the target state is for block nodes to return responses indicating hover/click/etc the way inline nodes do, and for headings to use this pattern as well, if I can solve the hit-testing problem.

@tvanderstad tvanderstad merged commit e360325 into master Dec 26, 2025
1 check passed
@tvanderstad tvanderstad deleted the fold-buttons-on-hover branch December 26, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant