memos icon indicating copy to clipboard operation
memos copied to clipboard

feat: add nests (a.k.a namespaces)

Open andresmanelli opened this issue 1 year ago • 11 comments

Hello,

First of all, thank you for this amazing tool. I love the simplicity of it and the clean UI.

What I'm missing is the ability to separate personal/work/other notes (maybe it is there, and I couldn't find it).

Anyway, I thought of giving it a try, so I added what I called nests: basically, a group of notes that belong to a namespace.

I'm no front-end developer, so there are a couple of things missing. For the moment, there are only two hard-coded nests in the UI.

  • [ ] Get the user's nests and show their names in the menu
  • [ ] Add/Remove nests from the UI
  • [ ] Others?

I added the nest filter to several requests, so you can switch back and forth without issues:

nests

Let me know what you think.

andresmanelli avatar Nov 08 '24 16:11 andresmanelli

Adding some issues to align PR with other's request https://github.com/usememos/memos/issues/3830 https://github.com/usememos/memos/issues/3984

RoccoSmit avatar Nov 09 '24 00:11 RoccoSmit

@andresmanelli, can you provide some more context around what you are after / how you see nests working.

From the code if look like, as you mentioned, 1 nest can have many memos allowing you to group memos into their own context space. From the gif It look like on the FE you using nests as a tag filter. e.g. When you click on a nest the metadata records are not filtered for the nest group. The gif shows the tags are shared across nests. Is this intended? If so, can the same functionality be achieved expanding on the existing tag infrastructure?

Do you see nests only being used on on the home page or are shared spaces such as explore and the user pages also needing to make use of them in some way?

RoccoSmit avatar Nov 09 '24 02:11 RoccoSmit

@andresmanelli, can you provide some more context around what you are after / how you see nests working.

Sure @RoccoSmit, let's say I want to work on my personal notes, my work-related notes, and some project-specific notes. I wouldn't want to mix all of them in the UI, I'd prefer to switch between these namespaces and see their content.

From the code if look like, as you mentioned, 1 nest can have many memos allowing you to group memos into their own context space. From the gif It look like on the FE you using nests as a tag filter. e.g. When you click on a nest the metadata records are not filtered for the nest group. The gif shows the tags are shared across nests. Is this intended?

Actually no, I did't quite get how the tags are read from the database, so I couldn't get that done. I think tags that are created in notes of a nest should be show for that nest, but not for the others.

If so, can the same functionality be achieved expanding on the existing tag infrastructure?

I don't think using tags to filter a namespace is a great idea, as it would require using specific tag names to identify nests (maybe there is another way?). Using a specific database column seems cleaner to me. It does not pollute the rest of the functionality.

Do you see nests only being used on on the home page or are shared spaces such as explore and the user pages also needing to make use of them in some way?

I didn't filter the explore page, as I think it is intended to show everything that is Public or Protected (independently of the nest currently being used). Could you explain to me what do you mean by user pages ?


Also, I did not look into the resources for the moment. I think they should be filtered using the related memo's nest (in the resources page).

andresmanelli avatar Nov 09 '24 18:11 andresmanelli

Hey @RoccoSmit I added some changes:

  • Use the nest name nests/id as parameter to filters
  • Correctly filter metadata
  • Display actual nest information in the nest list
  • Add the nest_service

I will try to add the nest creation and the default nest selection in the user settings to have an "mvp" of this feature ready.

Thanks again for your comments.

andresmanelli avatar Nov 11 '24 21:11 andresmanelli

@andresmanelli, good work with the POC. My suggestion at this point, before you spend more time on it, would be to get @boojack and/or @johnnyjoygh 's input on if this feature fits in with their long term view of Memos (this is usually part of issue reviews) so that you have an understanding on if this feature will be merged or not

RoccoSmit avatar Nov 11 '24 23:11 RoccoSmit

@RoccoSmit of course, I understand!

I will probably add those two last things anyway to be able to use this, but I'll wait for comments on whether they find it interesting.

andresmanelli avatar Nov 12 '24 08:11 andresmanelli

@andresmanelli I think the Supernotes Collection could be a more fitting solution for the problem you're trying to solve. It allows users to organize their notes into distinct collections, which effectively separates different contexts or categories (like personal, work, and project-specific notes) without mixing them up in the UI. Each collection serves as a namespace, giving you the ability to group related notes together while keeping them isolated from other collections.

  • https://developer.supernotes.app/guides/custom-collections
  • https://help.supernotes.app/en/articles/9325045-custom-collections

johnnyjoygh avatar Nov 13 '24 02:11 johnnyjoygh

Some additional general notes from testing and code review.

  • Are you set on the name nests? Can we use something a bit more descriptive. I'm assuming you are referring to memos nested under a common group, but space, collections or categories would be more descriptive.
  • When user 1 views memos from user 2 on the explore page the other user's tags dont show on the right
  • Nests crud will need to be discussed further as its not currently possible to edit/delete a nest form the UI
  • The navigation will need to be modified so that its easier to see what part of the left nav is nest specific and what parts are global

RoccoSmit avatar Nov 13 '24 13:11 RoccoSmit

@johnnyjoygh thanks for the feedback!

I looked into Supernotes Collections, and I see it shares the basic concept of organizing notes in categories (based on filters, which is quite nice).

One subtle difference, is that all the notes keep sharing tags for example, or calendar view (maybe all metadata, but I didn't spend a lot of time testing).

I think collections could be also used on top of nests (different filter sets for different contexts). Does that make sense?

andresmanelli avatar Nov 14 '24 01:11 andresmanelli

* Are you set on the name `nests`? Can we use something a bit more descriptive. I'm assuming you are referring to memos nested under a common group, but space, collections or categories would be more descriptive.

@RoccoSmit Not at all, I actually chose nest as a pun, because of the bird on the home page :) Sadly I didn't find a nest icon to be more explicit. Anyway, I don't mind changing that.

* When user 1 views memos from user 2 on the explore page the other user's tags dont show on the right

I fixed that in my latest commits, moving the nest filter under the EXPLORE page check. Though, the tags don't seem to refresh when switching between home/explore if I don't reload. I didn't get why.

* Nests crud will need to be discussed further as its not currently possible to edit/delete a nest form the UI

Agree.

* The navigation will need to be modified so that its easier to see what part of the left nav is nest specific and what parts are global

Agree.

andresmanelli avatar Nov 14 '24 01:11 andresmanelli

@boojack , @johnnyjoygh , thoughts on:

  • The name Nests for this feature vs something like Spaces, Collections or Categories
  • The UX with the left navigation and indicating Nest level vs global navigation items
  • Nests management ?

RoccoSmit avatar Nov 14 '24 10:11 RoccoSmit

Hello @johnnyjoygh, I'd be happy to continue my work on this feature (if it interests the team). Could you provide some feedback if this is the case? The Stale state of this PR was more of a wait-for-comments.

Thank you anyway !

andresmanelli avatar Feb 02 '25 10:02 andresmanelli

I'd be very interested in this too @johnnyjoygh is this not fitting or is there any other reason this was not reopened?

CrazyWolf13 avatar Nov 24 '25 08:11 CrazyWolf13