Open biva opened 3 years ago
I would love either this or the headline overview from the other issue being implemented (or both).
Thanks for proposing this. As the outline view has been added now and provides an alternative way to achieve the same goals i'll close this issue.
Well, to be honest we had this feature on our feature planning whiteboard recently and I agree that it's a useful one. So maybe let's keep this open? :grin:
There are 2 things to be added:
Let's tackle 1 first as this seems the easiest. 2 requires more thought as this might be something users would want to have control over remembering the state and will have an impact on existing structures with headings.
A few more things to consider from my perspective:
Very nice to see this being tackled. I think what @luka-nextcloud explains as 1. is rather tracked in https://github.com/nextcloud/text/issues/3646, no?
Another question would be whether spoilers (that's another way how these expandable sections are often called) can be nested. Seems like HTML allows this, and so does GFM (Github flavoured markdown: https://gist.github.com/scmx/eca72d44afee0113ceb0349dd54a84a2?permalink_comment_id=4196669#gistcomment-4196669. But it seems rather useless to me and brings extra complexity, so I don't think that we have to support it.
The menu button could insert a new details element, but how would it behave if -> Clicking it with selected text
I'd expect the editor to ask me for a summary text and move the selected content into the details section of the spoiler.
Should there be a way to undo the details section but keep the content?
I'd expect this, definitely. When inside a details section, the menu button should remove the details section but preserve its content.
You're right I totally missed #3646, let me actually extract the first part of this ticket and the discussion and move over to that one.
Spoilers/foldable details sections are tracked separately in https://github.com/nextcloud/text/issues/3646
This ticket remains about making existing sections like headings foldable.
Initial report
Is your feature request related to a problem? Please describe. For large pages, it is hard to have a vision of the structure, or to navigate within the page to find the right section / paragraph.
Describe the solution you'd like It would be great to be able to collapse (fold) and open (unfold) sections, thanks to a small arrow on the left. Sections would be based on headers (H1, H2, ...), with subsections that would also be collapsible (foldable). In addition, a button on the top would fold/unfold all.
Describe alternatives you've considered Having a menu on the top or on the right sidebar (also with collapsible sections)
Additional context