200ok-ch / organice

An implementation of Org mode without the dependency of Emacs - built for mobile and desktop browsers
https://organice.200ok.ch/
GNU Affero General Public License v3.0
2.42k stars 150 forks source link

Allow capturing when no file is opened #937

Open maser opened 1 year ago

maser commented 1 year ago

Is your feature request related to a problem? Please describe. I have a capture template with a specific file set as capture target. If I have any file open I can click the plus icon and my capture is written to the target file, but when no file is opened, there is no option to capture. As I am shown the file list when I open the app, I then have to navigate to my org directory, open any file and then start the capture.

Describe the solution you'd like I'd like to be able to capture when no file is opened so I can open the app on my phone and immediately hit the capture button.

Describe alternatives you've considered

Additional context As the same icon is used for 'create new file' and 'capture', some change is needed in order not to confuse users. I think using a different icon for creating files (e.g. file-circle-plus) would make sense. Then there could be two actions in file lists, one to create a new file, one to capture. The latter would only be shown if any capture template with a target file exists.

I think I can make this change myself if you agree with the suggestion.

munen commented 1 year ago

Hi @maser

Thank you for checking out organice! :pray:

I like your proposed change and I can relate to how you want to use it. Personally, I'm practicing Getting Things Done, so my 'add stuff to inbox' capture template needs to be ready all the time. In Emacs, I use it from whichever buffer I might have open. In organice, I currently have to have the right file opened.

Since you said that you can do the change yourself, I'm happy to help with testing and documentation on your PR.

Let's quickly discuss UX. I imagine a new flag "Available globally?" flag in the capture template editor similar to "Available in all Org files?". Every capture template that has this flag will then show up even when in the file explorer. I assume you had something similar in mind, if not, I'm happy to hear the proposal.

Now, what happens with these 'global' capture templates when you are visiting an Org file that has capture templates itself? I think they should still be shown and merged into the local capture templates. Now, what if there's a 'merge conflict'? Let's say there is a capture template called 't', defined locally and globally? I think we can ignore that. Right now, if a user defines redundant or conflicting capture templates, they will all be available to her.

Ok, so having said all that, before you invest a lot of work (and make users happy), let me say that there's likely an easier way for you. You mentioned the things you tried before:

I tried putting a bookmark to the target file on my Android home screen, but I can only install the PWA which then always opens at the root route.

Using bookmarks (to the home screen) used to work in iOS and Android. We even had to change the implementation twice over the years to make Android happy, again(; Nobody knows why it currently doesn't work anymore, but for your use case it also doesn't have to. In the "File Settings", you can pick the file that organice should load on startup:

image

This is a rather new feature I implemented recently (due to the Android bookmark issue), so make sure you run the latest version.

I thought I could use the URL parameter capturing option, but while that works great on the desktop, I wasn't able to find a way to use this on Android.

I don't own an Android phone, but I use bookmarklets in iOS to capture URLs from the browser extensively as documented here: https://organice.200ok.ch/documentation.html#bookmarklets

Having written this, since you got it to work on the Desktop, I'm assuming that we're running into another situation where Android behaves differently. If so, I'm unfortunately unable to help since I don't own such a device.

Ok, having said all that - I like your proposal and it's up to you if the 'default file' functionality is good enough for you. I'll assign the issue to you and wait for feedback.

P.S.: One more goody of the 'default file' functionality vs the bug that Android loads the root node is that you'll always open a file first. Files are all cached locally, so it'll work offline, too. Folders aren't cached locally, yet.

maser commented 1 year ago

Hi @munen,

I am sorry for not being responsive. I've started thinking about your points but haven't gotten around to formulating a reply due to other things in my life taking precedence. I'm still very much on board to implement this.

munen commented 1 year ago

Hi @maser

I am sorry for not being responsive. I've started thinking about your points but haven't gotten around to formulating a reply due to other things in my life taking precedence. I'm still very much on board to implement this.

No worries. I think it's a great feature. When you have time, let's finish the UX discussion. Until then, good luck with the other issues currently taking precedence!