organice icon indicating copy to clipboard operation
organice copied to clipboard

As a user, when creating a headline but don't input any text, I want the headline to be automatically discarded, so that I don't have empty headers in my file

Open schoettl opened this issue 4 years ago • 5 comments

When pressing the + icon in the header toolbar a new header is opened. When there is no text input and the user presses "Done" or clicks anywhere else, an empty headline (only the *) is added to the org file.

I think, adding an empty header happens more often by accident than deliberately. Therefore I'm for discarding headlines that are completely empty (no TODO keyword, no title, no headline, no tags, etc.).

As it is probably hard to distinguish between "add new header and leave it empty" and "edit header and delete all content", the header would also be deleted in the latter case.

Are there concerns about this proposed behavior?

schoettl avatar Dec 28 '19 16:12 schoettl

No concerns at all. I concur that adding an empty header will rarely be done by choice. It’s possible to create an empty header in Org mode and leave it be, of course. However, it’s likely a more deliberate action in Org mode itself whilst clicking “the wrong button” or changing your mind after clicking it in a GUI on the smartphone is a totally likely action.

Hence, I’m generally in favor of having a different UX in organice than in Org mode.

I just checked how more popular todo apps do it (like Things from culturedcode). They usually have a “save” and “cancel” action. What do you think about that?

I’m generally open for both options. Just trying to start a dialog since it’s new UX^^

munen avatar Dec 28 '19 17:12 munen

I asked one other daily organice user who I have quick access to. She is in favor of discarding the header when it is empty. No need for a cancel button.

I also think that it would be pretty easy to build as is purely data driven - there no UI considerations. With a cancel button it gets slightly harder - what happens when a user edits a header and then hits cancel? We would need the track the previous and edited state. It’s not super hard, but it’s harder and introduces more UI. Intuitive UX is when you don’t need more UI and it just behaves correctly, right?

TL;DR: I’m in favor of your suggestion!^^

munen avatar Dec 28 '19 18:12 munen

Yes, I also think, the "Done" button is sufficient.

Save/cancel is nice to have when you messed up the text and want to cancel. But normally not needed. At least I don't work on that and rather keep the UI clean and simple.

schoettl avatar Dec 28 '19 18:12 schoettl

@schoettl Part of this issue has been implemented by https://github.com/200ok-ch/organice/pull/227, specifically this https://github.com/200ok-ch/organice/pull/227/commits/d29a271c2f539ddf85e30c30d12cf6a0beb04ace.

An empty header won't be discarded in the front-end, but unless the user adds some other stuff to the file, it will not be synchronized.

The only way to get an empty headline in is now to:

  1. Click the + on the HeaderActionBar
  2. Click DONE
  3. Don't remove the empty header or don't use undo
  4. Do some other change to the file

This, to me, sounds like a deliberate action now. Personally, I wouldn't know of a good reason to add empty headers, but technically it is a valid file.

I'm not saying we have to close the issue, but depending on how much enforcement we want to do on this, we might. I'll leave this information here for you to ponder and comment upon.

NB: The whole PR might be interesting to read. organice just became a lot more mighty with https://github.com/200ok-ch/organice/pull/223 and https://github.com/200ok-ch/organice/pull/226.

munen avatar Jan 12 '20 14:01 munen

The behavior you just described, sounds strange to me, too. I would leave the issue open.

I'd try to remove the header again if it is empty. It should be possible to check the complete header "on finish editing" and remove it if there is no useful information in headline and description.

schoettl avatar Jan 12 '20 16:01 schoettl