Closed Iziram closed 1 month ago
Issues related : #3754 #3708
I started to work on it.
Here is the repo : iziram/memos#collaborators
Worked on a bit of UI :
https://github.com/user-attachments/assets/8e2afeb5-171d-4d0a-9bee-889a9ee18a7a
super excited for this! As a fellow "moving away from Keep", this will solve most of the gaps I have with my wife and I sharing to-do lists and notes, etc.
super excited for this! As a fellow "moving away from Keep", this will solve most of the gaps I have with my wife and I sharing to-do lists and notes, etc.
I can only second that
As of now, there is no way to make to people edit the same memos. ( Even Admins can't modify other memos)
For a good start, I first implemented for admin users to modify other memos. https://github.com/usememos/memos/commit/7a9f61967da808a27f07b5492d6f94b290a4b7b9
Describe the solution you'd like
A lot of people are comming to Memos from Google Keep. Memos can be a great alternative but lacks in term of collaborative feature. As of now, there is no way to make to people edit the same memos. ( Even Admins can't modify other memos)
I hope that together we can discuss what is the best way to add collaborative editing to Memos.
Type of feature
User Experience (UX)
Additional context
Current code
In the current code, the ability to edit is defined by :
const readonly = memo.creator !== user?.name;
const allowEdit = !props.readonly && memo && currentUser?.name === memo.creator;
Which makes the creator the only one capable of editing the memo.
Ways of adding collaborative features
Workspace Editing
As i previously mention in a PR ( #3673), one of the easiest way is to let everyone in the same workspace edit all "workspace memos". Such a "feature" as i implemented will not resolve the "admin" problem on public and private memos. But is easy to add and don't touch the database models.
Collaborators Field
An other way would be to add a "Collaborator" field to each memos. Then a
UserA
could addUserB
to the memo.UserB
would have almost the same permissions asUserA
. Editing the content of the memos but not the visibility nor add collaborators.This is a quite robust way of dealing with collaborative work but changes to the database will be needed.
CollaboratorsPermissions
This part is a upgrade for the
Collaborators Field
feature. What we could do is add a permission system. (Read/Write/Admin)It would work like that :
READ
: Can see the memos (even if its visibility isPrivate
) and can comment.WRITE
:READ
+ can edit the content of the memo (e.g: check boxes, add task to list)ADMIN
:WRITE
+ can change the visibility, add collaborators, delete the memos... (anything that the creator can do)Instead of using a field in the memo (which could eventually become too large) we could use an other table in the database. :
integer
integer
integer
Permission is a number representing the permission :
READ
: 0WRITE
: 1ADMIN
: 2Using 0 for
READ
let us use the "permission" number as a "allow edit" bool value(the following code is not a implementation, just a example)
Obviously, the server host (and users set as Admins) will have the
ADMIN
permission on each memos.UI
In terms of UI, this will add :