brantje / nextnote

A full Evernote / OneNote style WYSIWYG note editor for Nextcloud / ownCloud. Join our telegram at: https://t.me/NextNote
GNU Affero General Public License v3.0
163 stars 19 forks source link

API Draft #11

Open brantje opened 7 years ago

brantje commented 7 years ago

I've published a API draft here. This is the API the app will use in the end.

Keep in mind that the app might change the name, in that case the endpoints will change.

ThomasDaheim commented 7 years ago

Thanks @brantje , a few comments from my end:

brantje commented 7 years ago
ThomasDaheim commented 7 years ago

PUT looks good for single action. Still would leave any mass operations open since you have {id} in the path.

Tree structure: Have thought about that for a while now. The challenge I can see is to where to store the group information if you use files. Three choices come to (my) mind:

1) Extend current scheme to e.g. [group1-group2-group3,group4,group5-group6] for hierarchies (via "-" and multiple groups (via ",") Pro: filename has all info, never needed to parse file e.g. to show notes tree Con: file names can get messy

2) hierarchical groups as directories Con: can't have one note in multiple groups; parsing & moving seems to be more complex

3) store group info in some tag where they don't interfere with the editor Pro: short filenames Con: Parsing required for e.g. find all notes for a given group

4) store group info in file meta information - no idea if this can be done independent of OS, ...

As for the api: could use a similar syntax for passing group information as a string as option 1)

The guys from the notes app had a discussion as well (https://github.com/nextcloud/notes/issues/8) with groups vs. tags. Maybe there is something to learn from that?

brantje commented 7 years ago

Ahh yea, the never ending tag vs. tree structure discussion. In my opinion, if tags are proper implemented, you can use them as a tree structure.

Personally i would go for tags, but what do others think?

ThomasDaheim commented 7 years ago

Tags seem to be more flexible. But UI around it is probably a bit more complex.

How does e.g. OneNote do it? They seem to have a structure in the UI:

So more like a tree and I can't seem to find a way to add tags. That seems to be sufficient for a large number of people out there...

But of course its largely a matter of taste, I would think. Some people prefer hierarchies, others tag clouds. I could live with tags as well, currently I wouldn't have the need for any hierarchy deeper than one level. And thats the same as tags :-)

brantje commented 7 years ago

Yea but we have limited space in the sidebar, and i hate horizontal scrolling. We could allow 2 nesting levels:

This way, we can keep the sidebar clean, and still support folders.

ThomasDaheim commented 7 years ago

I'm fine with that. Maybe it would possible to keep API and code in general without the restriction to to 2 levels? So we would be open for any further improvements...

But it would mean that you can't have a note with two different tags assigned. or we would have levels and tags as different concepts.

brantje commented 7 years ago

Yea, do you have an idea how to implement it? We can add a folder property to the object.

ThomasDaheim commented 7 years ago

I don't like "folder" because it suggests a form of implementation/presentation :-) Group is OK for me since it also keeps the wording from ownNote.

As for implementation see my post above. Something along the lines of "Extend current scheme to e.g. [group1-group2-group3,group4,group5-group6] for hierarchies (via "-" and multiple groups (via ",")" that would keep the API down to one parameter - a serialized tree.

enoch85 commented 7 years ago

I don't like "folder" because it suggests a form of implementation/presentation :-) Group is OK for me since it also keeps the wording from ownNote.

Agreed.

brantje commented 7 years ago

@ThomasDaheim for renaming / deleting groups, what endpoint url shall we make?

korelstar commented 7 years ago

In the last days, I thought about how to provide categories for the "Nextcloud Notes" app. I came to a similar conclusion: don't show all hierarchy levels in the sidebar, but only show the first level. But, nevertheless, I would not restrict the allowed levels to this (some people's will be comprehensively structured). Instead, show the deeper levels in the list of notes. I.e., the notes belonging to the current primary level are listed sorted by their (sub-)category/group and then by their title. Before a new category/group begins, a head with the respective name is shown. Example:

The sidebar shows:

If I chose "Project 1", then the list of notes shows all notes in this category/folder/group recursively:

ThomasDaheim commented 7 years ago

@korelstar Using formatting/coloring/... instead of indenting seems to be good idea!

@brantje : I have seen your method "Delete a note but keep the entity in db". That sounds like "archiviging", right? For file based notes it would mean to move them into a group "deleted" or similar?

brantje commented 7 years ago

@ThomasDaheim Afaik, when you delete a file using the files app it isn't deleted first. It gets a deleted flag, then under deleted files, you can completely remove the file.

Fmstrat commented 6 years ago

My suggestion: Implement groups, then convert to tags.

We've already got group functionality working, and this allows me to continue to focus on the mobile app. If we switch over to tags in the future, we can update users "groups" (which would be 1 per note) to the first "tag" when the upgrade occurs.

Prior to this happening, I could update the mobile app to check for tags/groups in the API response, and format accordingly, then phase out groups.