-
Notifications
You must be signed in to change notification settings - Fork 138
feat: setting to show/hide hidden files #1541
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
base: main
Are you sure you want to change the base?
Conversation
fixes nextcloud#1245 Signed-off-by: Roberto Vidal <roberto.vidal@ikumene.com>
if (this.settingsOpen) { | ||
this.$data.initialShowHidden = Boolean(store.state.app.settings.showHidden) | ||
} else if (this.$data.initialShowHidden !== store.state.app.settings.showHidden) { | ||
this.$emit('reload') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting fancy here and trying to avoid full in-place reloads until they're absolutely needed, instead of using onChangeSettingsReload()
. I'm not sure it's a good fit for NC's general UX approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me. 👍
Thanks a lot for your PR. I've restarted tests and think there are some static analysis errors that need to be addressed, but the general PR seems almost ready to merge. A few small things commented inline and some feedback on your comments:
It is fine to assume that but good that you raised it as a question. Our web frontend and file system layers only handle files starting with a dot as hidden. I'm not sure how that propagates to the desktop client but we do not have any special logic for hidden files in other backend areas. For SMB as external storage we are able to detect the hidden flag but this would then already be filtered out in the storage layers (https://github.com/nextcloud/server/blob/e9e67cbc50d0b1efb02a734b4c858b32ef8832c0/apps/files_external/lib/Lib/Storage/SMB.php#L237)
For the mobile apps we could extend the API within notes to also pass the value along in
Would agree with that as well.
I'd be fine to even switch the default, but not sure what @marcoambrosini would think about this as designer? Also @enjeck @juliusknorr as primary maintainers of the app?
I remember that was a bit more tricky, they also are not that standard compared to other Nextcloud apps. Something we could follow up later on. |
if (this.settingsOpen) { | ||
this.$data.initialShowHidden = Boolean(store.state.app.settings.showHidden) | ||
} else if (this.$data.initialShowHidden !== store.state.app.settings.showHidden) { | ||
this.$emit('reload') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just nitpicks that you can ignore
f5adc21
to
1931164
Compare
Sorry I'm a bit confused by this comment. Are you saying we should not hardcode Re: mobile apps using WebDAV: I assume you mean that we have no control over apps that use WebDAV, correct? i.e. that there's no way to propagate this setting for them (I assume the WebDAV handling is part of |
Yes, sorry if that was not clear enough. I'd read the setting there instead of the hardcoded one as well.
Yes, that is in the responsibility of webdav / Nextcloud server then to handle. |
Signed-off-by: Roberto Vidal <roberto.vidal@ikumene.com>
Signed-off-by: Roberto Vidal <roberto.vidal@ikumene.com>
1931164
to
27ddb2c
Compare
I'd agree with defaulting with not showing it. |
This is a fix for #1245. It adds a new
showHidden
setting to control whether hidden files/folders are displayed to the user or not."Hidden" means "starts with a dot", a la UNIX. I'm not sure how much we care about a hypothetical notes folder living within a Windows FS that contains windows-like hidden files. (I supposed the answer is "not much").
The setting is only respected in the main web interface, and ignored for API methods. This is a quick-n-dirty compromise between letting clients handle hidden folders/files as they see fit on their own; vs. exposing this setting as public and store it per client (which goes beyond my knowledge of NC internals).
The setting also affects other entrypoints that transitively depend on
NotesService#getAll()
, such as the search provider and the top-level notes. This seems appropriate to me, given its main usecase is probably metadata files generated by 3rd party apps.I've set the default to
true
so it is "backwards compatible". I'm not sure how acceptable would be to switch it tofalse
.I haven't been able to get a proper setup to run tests locally, but I do want to add some tests.