cherrytree icon indicating copy to clipboard operation
cherrytree copied to clipboard

Collapsable headers please! [feature request]

Open RFImages opened this issue 2 years ago • 108 comments

Hi I had previously made a request for collapsable text sections in the body of a node or subnode, similar to the way you collapse nodes and subnodes in the node/subnode pane.

Recently I discovered by accident that Microsoft Word already has this feature so I am using it to edit LONG subnode bodies, then having to copy it back to Cherry tree: https://support.microsoft.com/en-us/office/collapse-or-expand-parts-of-a-document-701786e0-95e2-40bf-bfe5-f0233cd3520c

The way they do it is perfect, just identifiy heading lines (h1, h2, h3 as you already do), then when hovering over the heading, an arrow appears on the left that can be clicked to collapse or expand the body below tcontained within that heading.

This is SOO helpful for super long text nodes, to be able to focus on the area of interest without all the clutter of the rest of the text body. It is so useful that I am willing to donate a downpayment of $50 if you also think it is a feature worth implementing, and then larger donation on completion, depending on how well done and how soon. What do you say Giuspen? I needed this yesterday as I strugggle daily with a particularly long To Do list in my todo node and I don't want to have multiple subnodes just to maintain a heirarchy (too many clicks, too time consuming

RFImages avatar Nov 14 '23 00:11 RFImages

ok to get attention I will up my bid to $75, payable immediately upon acknowlegement of this feature request and an estimation of when it will be available. When implemented I will donate significantly more! Yes, I am bribing you! The utility of this feature is enormous for me, and I assume others, since Microsoft saw fit to incorporate it into Word.

RFImages avatar Nov 21 '23 12:11 RFImages

:(

RFImages avatar Dec 09 '23 16:12 RFImages

Hi @RFImages don't be sad it's difficult for me to follow all the issues I'm only one :) In fact I apologise to who doesn't receive an answer and feels ignored, I hate that but believe me I become crazy if I follow everything and I fail to focus on a development feature. I will have a look after v1.0.3 but before this I need to implement virtual nodes.

giuspen avatar Dec 09 '23 16:12 giuspen

:) Ok cool, I understand you are packed with work on this great product. As promised I will now donate $75 on good faith. What are virtual nodes?

RFImages avatar Dec 11 '23 18:12 RFImages

Thank you my friend :) Virtual nodes are a group of node "views" that point to only one node content, so you can see and edit from all the nodes scattered in the tree that belong to that group. Not sure if there's a better way to call them, I'm still thinking and open to suggestions.

giuspen avatar Dec 11 '23 18:12 giuspen

It may not be $75 considering various sources for exchange rates, but will make it up to you generously when this feature is incorporated. Thanks for considering it. Others have asked for it as well. Keep me informed!

RFImages avatar Dec 11 '23 19:12 RFImages

Not sure I understand the Node thing, or it's usefulness is there a post where I can read about it?

RFImages avatar Dec 11 '23 19:12 RFImages

It's discussed here https://github.com/giuspen/cherrytree/issues/1222 and has been requested time ago privately from one of the few supporters that have a recurring monthly donations, I cannot make him wait any longer

giuspen avatar Dec 11 '23 19:12 giuspen

Oh no I understand I am not asking that, I am just curious about what virtual nodes are. Thanks for the link.

RFImages avatar Dec 11 '23 19:12 RFImages

Ok I think understand it now and yes I agree that would be useful. I will comment in the other post.

RFImages avatar Dec 11 '23 19:12 RFImages

This got off topic, but wondering where the collapsible header feature might be in the queue? I am noting other similar requests here

[Collapse, Expand Text Selection · Issue #2026 · giuspen/cherrytree (github.com)] (https://github.com/giuspen/cherrytree/issues/2026)_

Collapsable Text Selections · Issue #2360 · giuspen/cherrytree (github.com)

RFImages avatar Mar 30 '24 10:03 RFImages

Hi @RFImages I didn't forget about this, I am still to release a bugfix version v1.1.2 today or tomorrow related to the search, then I will be off until half of April without a computer, only phone, and then I will start looking into this.

giuspen avatar Apr 01 '24 13:04 giuspen

Thank you @giuspen You mean you can't develop software on a phone? haha Come to think of it, being able to view cherrytree on android would be great! How will you view your personal cherrytree? Safe travels to the desert island!

RFImages avatar Apr 01 '24 14:04 RFImages

Hey @RFImages I haven't found yet a way to hide part of the GTK text view in order to achieve the result using the gtk3 library interface. One quick but not as good possibility would be to allow the so called code boxes to collapse. A code box though can currently contain only plain text (this may change in future where I will try to support rich text too) So basically you would place your header and below a code box with plain text that can collapse and will remember the collapsed status. Let me know if this may help your workflow or not.

giuspen avatar Jun 22 '24 12:06 giuspen

Interesting just after writing to you I found https://github.com/aeischeid/gedit-folding it looks like it is possible to hide sections of text using text tags, I'll investigate further

giuspen avatar Jun 22 '24 12:06 giuspen

I am so happy to see this get attention! Especially since I just started a new job and it will be a huge help in keeping me organized and efficient. Thanks for remembering, great timing. I just sent a donation 25 to keep you motivated. Paypal would not let me make it monthly for some reason but I will make this recurring. The code box solution does not help much because all of my text body is highly formatted. I hope that the text tags work!

RFImages avatar Jun 22 '24 20:06 RFImages

Many thanks for your donation @RFImages ! I will complete first the auto/guided recovery of corrupted documents from the most recent backups and then I am on this. I now know that the library supports what I need and I have a plan so I don't expect problems. I will update this ticket soon with likely a version for you to try.

giuspen avatar Jun 22 '24 21:06 giuspen

Beautiful! Do you think it will work with the headers as the collapse/expand point similar to the way Word handles it? Also I am always afraid to upgrade for fear of my version 1.0.0 .ctz file being corrupted by the newer version. Is my fear unfounded?

RFImages avatar Jun 22 '24 21:06 RFImages

Yes the idea is to improve the current parser that adds an anchor before every header when generating the TOC so that these anchors will be clickable and capable of hiding/showing the text under the header (up to the next header of the same level). Theoretically the current stable version v1.1.3 is the safest ever as I'm constantly trying to make it more and more robust, but it is certainly good to save a time based backup from time to time. I have always done it even though have never needed one.

giuspen avatar Jun 22 '24 21:06 giuspen

In case of a collapsed header, if you close and reopen cherrytree would you expect the header to be still collapsed or expanded?

giuspen avatar Jul 02 '24 21:07 giuspen

I think I would prefer it were left in the state it last was when saved (collapsed). If that's too hard I prefer it open collapsed. A collapse all/expand all option would be nice.

RFImages avatar Jul 02 '24 21:07 RFImages

I just had a thought I wonder how this would affect the search function. If the word is found within a header would it have to expand that header?

RFImages avatar Jul 02 '24 22:07 RFImages

Hello @giuspen It has been a couple of months and I am wondering,

  1. Are you ok? if (you are ok) then Is this still in progress? ; elseif (you have had time) {Are there obstacles? ; Is it very time consuming and not enough time has elapsed?} elseif (not done) I understand, I just hope this doesn't get pushed too far on the back burner. I have need of it every day! ; else I am ready to make monthly contributions! ; else Thoughts and prayers!

I thought I would ask this in language you understand ;) Feel free to correct my psuedo code syntax. Hard to believe github does not allow indentation!

RFImages avatar Aug 30 '24 18:08 RFImages

Hey @RFImages no problema just some much needed holidays. I have started looking at this and will propose a first version soon. Likely the first version will not remember collapsed/expanded status.

giuspen avatar Aug 30 '24 19:08 giuspen

Great glad you got some time to refresh! I would be happy to test a handicapped first version. @giuspen

RFImages avatar Aug 30 '24 19:08 RFImages

I'd also be interested in this. Having used org-mode in emacs, I'd suggest to consider what happens when we do a search. In org-mode, when we do a progressive search, the subsection opens at the identified string/regexp, and then closes when we move to the next in the progressive search. It only stays open if we begin editing there.

So, perhaps you'd want to open the drop-down when we click on one find in the search box, and then close that/ open the next when we click on that.

I hope I've explained that clearly enough.

And @giuspen / you've been quite the trooper all these years. It's been a while since I've checked in here, but you were always remarkably responsive. Back when you were working on markdown/ pandoc/ lua etc., you have someone working with you. I'm sorry to hear you're on your own now. :heart:

DiagonalArg avatar Sep 02 '24 00:09 DiagonalArg

Agree, @giuspen is an example of what any software developer should be. As a solo act his support far exceeds that of very large software companies who don't care a whit about the user, even after charging ridiculous subscription prices. With this feature I intend to support him with a regular donation. I hope other users will choose to do the same.

RFImages avatar Sep 02 '24 01:09 RFImages