I use notes app on desktop that doesn't create extensions for text files by default. I would be nice if it would be possible to create and use extension-less files by this app as well.
Allow setting empty extension for new notes in Settings. Also displaying notes from files without extensions (treating them like normal txt files).
I'm not sure if this is a good idea. What does it mean if a file has "no extension"? This is not easy to detect! E.g.: "My vacation on 03.04.2019" => is ".2019" an extension or not?
I'm afraid that this is too error prone. It is also an edge case that will confuse most users. I tend to veto this.
I'm not sure if this is a good idea. What does it mean if a file has "no extension"? This is not easy to detect! E.g.: "My vacation on 03.04.2019" => is ".2019" an extension or not?
According to code there is a list of extensions that are 'allowed': https://github.com/nextcloud/notes/blob/b72149ef0c0694a9becfe72cd8df25308dfb4826/lib/Service/NotesService.php#L425
By 'file with no extension' we can treat everything outside of it: like file with name containing '.' and any other text after it, or no dot at all.
I think it's unnecessary restrictive to limit text files to ['txt', 'org', 'markdown', 'md', 'note'']. At least on Linux file types are not necessarily recognized by extension. You can have file named 'some file' properly recognized as text file and opened by text editor. So why rename it to 'some file.txt'? This is redundant.
Also there are so many text formats that don't fit in the above list, like: 'log', 'nfo', 'csv', 'html', 'ini', 'xml', 'yaml', 'json' backup files: 'bak', config files: 'cnf', 'conf', 'cfg', all programming language files: 'c', 'py', 'rb', diff files: 'diff' and so on. All of these can be easily edited through Notes, so why limit usage of the app just because of file name?
On the other hand updating allowedExtensions with every known extension is unnecessary workload and always leaves something behind.
I'm afraid that this is too error prone. It is also an edge case that will confuse most users. I tend to veto this.
Well, there is already option to specify extension for new files (txt or md). Adding ability to write some user provided extension there (or in config file) - besides already existing options - does not seem as a interface overload to me.
Also the ability to list all files instead of only those with allowedExtensions is just a checkbox.
This is an app for taking notes and not a generic text file editor (that one exists in Nextcloud, too). So I can't see why it would be interesting to open files with those extensions you mentioned (log, c, ...). Hence, it is not necessary to extend and handle the list of extensions.
Allowing all files independent from it's extension is dangerous, because there could be other file types like images in the folder (embedding images is an often requested feature). Hence, we would have to use libmagic or something similar to differ between text files and other files. I think this makes it really complex and I still can't see that there is a notable amount of people who would use this.
Any opinions, @nextcloud/notes ?
Agree with @korelstar in general. It's a Notes app. :) For generic text there's files_texteditor or soon also Text.
I use notes app on desktop that doesn't create extensions for text files by default.
@cryptogopher maybe this is an issue to file with that app instead, since it most likely will lead to issues with ither apps too, not only Nextcloud Notes. Which app is it if I may ask?
That said, maybe working in the Text app to Notes will change some stuff regarding compatibility. @juliushaertl @nextcloud/text can comment on that. :)
This is an app for taking notes and not a generic text file editor (that one exists in Nextcloud, too).
There is no Android app for this text file editor (https://github.com/nextcloud/files_texteditor) AFAIK :/ And this is actually main requirement for my needs.
I would use any text editor available on Android for editing. But unfortunately there are sync problems with Android Nextcloud to sync such edited files to cloud easily (e.g. Nextcloud Android client cannot mark folder as available offline, so there is no automatic sync of whole folder content - only individual files; also automatic sync is only available on wifi and does sync only every 15 minutes since few versions ago :/; there are bugs reported for both isues)
Allowing all files independent from it's extension is dangerous, because there could be other file types like images in the folder (embedding images is an often requested feature). Hence, we would have to use
libmagicor something similar to differ between text files and other files. I think this makes it really complex and I still can't see that there is a notable amount of people who would use this.
Allowing editing based on MIME type would actually be the best solution. But I agree that it can be more complicated/time consuming. That's why I narrowed down my request to only having ability to list/create files with non-standard extensions.
@cryptogopher which app is it then that you use which doesn't add extensions?
And yes, checking by mimetype requires to download the file (as far as I know) which is of course more costly than checking the extension.
Regarding the Android app, that's @stefan-niedermann's call. Currently it only reads out files from the "Notes" subfolder, but especially with the Text app release, a first step could be to just read out any compatible file (.md, .txt, etc) and show it sorted by recently modified?
What do you think @nextcloud/notes @nextcloud/text? :)
Notes Android will follow the Server side notes app, as always :) In general the android app is extension agnostic, it does not know about it and ot shouldn't.
But i agree, that this is a very special use case. I don't believe, the trade off is it worth to be honest. I see many potential for errors like @korelstar stated.
Thanks guys for discussing this. Although I really didn't want take that much of your time :) I'm also not pushing you to change anything. If you feel like it's waste of your time you can just close the ticket right now.
@jancborchardt I'm working on Linux and applications here don't really enforce using file extensions at all. I suppose file extensions is more of a Windows thing. If I create text file with no dot in filename or with dots followed with any text I want - the file still opens in text editor if it contains text.
Anyway restricting application use by file extension is in my opinion artificial and unnecessarily narrows down potential use cases. What if user would like to have subdirectory in his notes directory with some scripts? Is it really worth to force filename change just to use it in your application? I understand, that you didn't foresee such usage, but still: this is just text and your app allows editing text. Why restrict what type of text can be edited? Maybe it's just me, but it looks like building car only to get to work, but not to go on holidays.
And saying that "this is too error prone" and "that will confuse most users" is not convincing argument. We're talking about people that are proficient enough to install and configure Nextcloud with non-standard extensions (like me:). Why shouldn't they be able to configure plugin for file types/extensions that suit them?
It would be more than enough to actually let users specify in config file what kind of extensions they want to have displayed. I achieved expected goal by actually changing:
https://github.com/nextcloud/notes/blob/b72149ef0c0694a9becfe72cd8df25308dfb4826/lib/Service/NotesService.php#L425
to
$allowedExtensions = [''];
and changing:
https://github.com/nextcloud/notes/blob/fc7631eb9e7e89876f2570d18b872b89fb30832c/src/components/AppSettings.vue#L43
to
extensions: ['', '.txt', '.md'].
(Well the second setting does not actually work as expected, because dot is added anyway at the end of filename with empty extension. But after using it for a while I consider it a feature not a bug. Now I can simply tell apart files created on my desktop, outside of Nextcloud and those created by Notes app by that final dot in filename :)
What would be the problem with changing those 2 arrays to configuration settings? So the user could change it like e.g. changing default notesPath in
https://github.com/nextcloud/notes/blob/16de16937ef5f0260fd999b282ca23edd98a25be/lib/Service/SettingsService.php#L21
Thanks again.
We're talking about people that are proficient enough to install and configure Nextcloud with non-standard extensions
This is not entirely true - there are many (promoted) servers which users can simple sign on (like dropbox) which have a confugred notes app active on the server side ;-)
@jancborchardt I'm working on Linux and applications here don't really enforce using file extensions at all. I suppose file extensions is more of a Windows thing.
I use Linux too since more than 10 years and haven鈥檛 come across an app which doesn鈥檛 use file extensions. :) Gedit, Atom, Markdown editors etc all add file extensions.
Thanks guys for discussing this. Although I really didn't want take that much of your time :) I'm also not pushing you to change anything. If you feel like it's waste of your time you can just close the ticket right now.
Thanks for your understanding. As said I think it鈥檚 best to file this issue with the app as it will lead to issues elsewhere too, not just with Nextcloud.
Most helpful comment
Notes Android will follow the Server side notes app, as always :) In general the android app is extension agnostic, it does not know about it and ot shouldn't.
But i agree, that this is a very special use case. I don't believe, the trade off is it worth to be honest. I see many potential for errors like @korelstar stated.