Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support subfolders for Sync locations #175

Open
markokocic opened this issue Feb 19, 2024 · 5 comments
Open

Support subfolders for Sync locations #175

markokocic opened this issue Feb 19, 2024 · 5 comments
Labels
enhancement New feature or request org-roam Affects support for org-roam usage

Comments

@markokocic
Copy link

markokocic commented Feb 19, 2024

When I set up some directory as a sync location, only org files that are located directly in that directory are read. Org files in subfolders are not considered at all. This makes it unnecessary cumbersome to handle use case with org files inside a folder hierarchy. Also, linking between those org files / notebooks doesn't work, since Orgzly knows nothing about subfolders.

It would be good if Orgzly supported subfolders inside an sync location.

There is a similar ticket reported at #146 which is Git related. This one is more general.

@markokocic markokocic added the enhancement New feature or request label Feb 19, 2024
@amberin
Copy link
Member

amberin commented Feb 20, 2024

Yeah, see my last comment in #146, but let's keep them separate, since the two repo types have different problems. With Git repos, files in subfolders are loaded but then written to the root folder. I'm not really sure about the Android storage access framework and subfolders... I hope it's possible, but we'll see.

@amberin amberin added the org-roam Affects support for org-roam usage label Feb 20, 2024
@amberin
Copy link
Member

amberin commented Feb 21, 2024

I believe this must be implemented per repo type, so I'm not sure if we should make this issue about the directory repo type (which seems to be the most popular type), or try to keep it general. (I suspect there is nothing wrong in the general code, but rather in the different repo implementations.)

@markokocic
Copy link
Author

I think there are two parts of the fix.

  • First is making sure Notebook in Orgzly are directory tree aware regarding non-unique names, relative links and so on... This part is general, regardless of the sync type
  • Second part is serialisation of such Notebooks and mapping them to different sync types, and there would be a difference between directory, webdav or git

@amberin
Copy link
Member

amberin commented Feb 22, 2024

Well, different repo types don't even necessarily use the same storage abstractions. For instance, a "directory" repo with a content:https:// URL does not use the Java.io.File class, whereas git repos do. So the entire "file" or "directory" concepts are different for different repo types. All they have in common are concepts such as Book and Rook (remote book).

@amberin
Copy link
Member

amberin commented May 23, 2024

The corresponding issue in the original repo is orgzly/orgzly-android#225. It's apparently one of Orgzly's issues that people "like" the most. 😉

I've been trawling the original repo's issues to take stock of the thinking so far, looking for clues on what @nevenz might have explored and/or ruled out. It seems like they saw notebook folder/grouping support in the UI as a goal, or even prerequisite. That is too far out of my comfort zone to take a shot at.

My current hunch is that I might be able to contribute to the following:

  1. Add support for some kind of .orgzlyexclude or .orgzlyinclude file (ideally, both options should be possible) in all repo types. This is Support the .orgzlyignore file in all repo types #224.
  2. Maybe: Take a shot at Allow selecting multiple notebooks #227, although I have no idea about its potential difficulties.
  3. Load files from all subdirectories, with notebook names including the relative path (relative to repo root). This should avoid the most obvious confusion and be usable, if not always pretty. I've looked into it for directory repos, and it doesn't seem too hard. My questions are mostly around how to make the code reusable and testable across repo types.

I think 3) could be a small but worthwhile step forward. It would not entail any UI changes, but updating the documentation would be important, to make users aware of the new "invisible" exclude/include feature of #224.

I believe these additions should probably happen in the order outlined above, since, when we add the last feature, there might be long-time users who risk suddenly loading a big number of org files from subfolders which are currently being ignored. It would then be important that they can easily a) delete multiple unwanted notebooks, and b) add exclude/include rules as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request org-roam Affects support for org-roam usage
Projects
None yet
Development

No branches or pull requests

2 participants