Skip to content

Conversation

@benabel
Copy link
Contributor

@benabel benabel commented Nov 2, 2024

Hi @phpbg and thanks for sharing this app as oss. I open this PR for to enable or disable all subpath under a parentPath when clicked in the advanced settings page.

@benabel
Copy link
Contributor Author

benabel commented Nov 2, 2024

It also would be better to hide those subpath when parent is disabled. Are you OK with this UX change?

@phpbg
Copy link
Owner

phpbg commented Nov 6, 2024

Hi,
thanks for your PR.
It looks good, but we have to discuss if this is necessary.

Say you have following folders:

  • DCIM
  • DCIM/foo

Excluding DCIM will only exclude files that are direct children of DCIM. DCIM/foo will be synced unless you explicitely disable it too.

Your PR will disable automatically DCIM/foo if you disable DCIM. This may be interesting, but maybe it is not what the user expects.

At least we must not hide subfolders and let user decide.

This behaviour can be seen here:

.filter { !pathExclusions.contains(it.relativePath) }

We do not filter if file path starts with an excluded folder, we filter if file path match exactly with an excluded folder.

What do you think?

@benabel
Copy link
Contributor Author

benabel commented Nov 8, 2024

Hi @phpbg ,

that is exactly the desired behavior and I think this a better UX than previous one.

In fact, I have Music Folder in which my audios are classified like this: Music/artist/album/audios.mp3 with about 100 artists and many albums per artist. Previously it was almost impossible to disable syncing Music (more than hundred clicks needed!) now you can easily select which folders can be synced.

Nextcloud client app propose a similar approach that seems appropriate, they also have a sort of hierarchy in the ui to show the file structure and allowing folders handling.

Also hiding sub folders would be handy, when you have a lot of subfolders like me it is a lot clearer. Also here maybe the hierarchy ui could be a win instead of just hiding.

@benabel benabel changed the title Exclude subpaths when parentPtah is clicked Exclude subpaths when parent path is clicked Nov 8, 2024
@benabel
Copy link
Contributor Author

benabel commented Nov 11, 2024

Nice catch. I've included your change and rebased my repo if you want to include it.

Update app/src/main/java/com/phpbg/easysync/ui/AdvancedSyncSettingsViewModel.kt

Co-authored-by: Samuel CHEMLA <43315561+phpbg@users.noreply.github.com>
@phpbg
Copy link
Owner

phpbg commented Nov 17, 2024

It looks good, I do a few more tests then I'll merge it and make a release.

@phpbg phpbg merged commit 66211ff into phpbg:main Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants