notes icon indicating copy to clipboard operation
notes copied to clipboard

Category: Add new category button to create new folders

Open theatischbein opened this issue 2 years ago • 9 comments

Following #967 I added an action in the navigation item Categories for adding new folders in the current notes path acting as categories.

Some remarks:

  • I used the remote.php api end-point like the files app, but I am unsure if there is a more elegant way https://github.com/nextcloud/server/blob/55ba9601f2ef5b14524693a77c59cb7f7174270c/apps/files/src/utils/davUtils.js
  • I wanted to use NcActionInput like the calendar app, but I had trouble to get the trailing submit arrow working, because it only works if the value isn't empty at rendering.. https://github.com/nextcloud/nextcloud-vue/blob/c269d6a3c255f6c62cdefe9407f3756911ee8964/src/components/NcActionInput/NcActionInput.vue#L221
  • The Category list does not display empty folder, after creating a category I seleted it so that the success is visible, but if no note is added, the category will vanished from the list until a note is added this category
  • The category list will count wills in folder even they are not matching the select file suffix
  • Opening the add menu is possible without expanding the category list (just shown in gif differently)

This gifs show the workflow and an error case, if a folder with that name already exist (but may not listed in categories if the folder is empty)

ezgif com-video-to-gif

theatischbein avatar Mar 24 '23 21:03 theatischbein

I used the remote.php api end-point like the files app, but I am unsure if there is a more elegant way nextcloud/server@55ba960/apps/files/src/utils/davUtils.js

I wanted to use NcActionInput like the calendar app, but I had trouble to get the trailing submit arrow working, because it only works if the value isn't empty at rendering.. nextcloud/nextcloud-vue@c269d6a/src/components/NcActionInput/NcActionInput.vue#L221

Maybe we can Have a separate clear category button? Otherwise I could imagine this would be good to fix upstream in the library in a follow up.

The Category list does not display empty folder, after creating a category I seleted it so that the success is visible, but if no note is added, the category will vanished from the list until a note is added this category Opening the add menu is possible without expanding the category list (just shown in gif differently)

Seems reasonable, I don#t think there is need for any separate API here if we can use standard webdav. Thanks a lot for the pull request. I think this could need some design input from @nimishavijay and @jancborchardt in terms of handling the categories without notes. From my perspective we should probably consider changing that behaviour to also show empty categories (which are just folders in the end).

The category list will count wills in folder even they are not matching the select file suffix

I think this would be ok, we might want to discuss separately how we handle different file extensions with the new rich editor, especially if .txt files should rather be opened in plain text editing mode rather than also markdown.

juliusknorr avatar Apr 13 '23 19:04 juliusknorr

Just noticed that showing all categories is at least an option as part of the 3-column layout in https://github.com/nextcloud/notes/pull/842/commits/4412195062b3b9e9a12100941fbbcc3c2276a582

juliusknorr avatar Apr 13 '23 19:04 juliusknorr

Just noticed that showing all categories is at least an option as part of the 3-column layout in https://github.com/nextcloud/notes/commit/4412195062b3b9e9a12100941fbbcc3c2276a582

Yeah, we could simply also show categories without notes in them, that is fine. If the folder exists it should be shown. :)

And design-wise yep, this depends a bunch on the 3-column layout. With the switch to that, we don’t need this whole expand and collapse mechanic anymore, as the folder/category list is the only thing in the left navigation.

jancborchardt avatar Apr 17 '23 08:04 jancborchardt

Another ping here @juliushaertl does this need to await the redesign to the 3 column layout ?

Are they any open tasks that I can implemend here ?

theatischbein avatar Apr 27 '23 07:04 theatischbein

We merged the three column layout end of last week, i think this change would be a great addition to rebase on top.

Regarding other tasks it mostly depends on your interest, we are generally open to any feature contribution, if there is an issue if of course might make sense to discuss ideas first to also align with our designers about potential UX topics.

We also have a chatroom for contributors on our Nextcloud instance, in case you are interested in joining for some exchange feel free to drop me an email to julius at nextcloud.com then I'd be glad to send you an invite.

juliusknorr avatar May 09 '23 16:05 juliusknorr

I also gave this a rebase and during that adjusted the positioning of the new category button which could now be located right next to the section header:

Screenshot 2023-11-07 at 15 49 39

The main missing part would be to properly handle displaying the new category in the list now.

juliusknorr avatar Nov 07 '23 14:11 juliusknorr