Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collaborative Memos #3782

Closed
Iziram opened this issue Aug 3, 2024 · 5 comments
Closed

Collaborative Memos #3782

Iziram opened this issue Aug 3, 2024 · 5 comments
Labels
enhancement New feature or request Stale

Comments

@Iziram
Copy link

Iziram commented Aug 3, 2024

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 add UserB to the memo.
UserB would have almost the same permissions as UserA. 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 is Private) 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. :

memoId userId permission
integer integer integer

Permission is a number representing the permission :

  • READ : 0
  • WRITE : 1
  • ADMIN : 2

Using 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)

const allowEditing = Collaborators(memo).getPermission(userId); // => 0/1/2 or undefined
// 0 and undefined act as Falsy values
if (allowEditing) {
  // here we are sur to edit because 1 and 2 are "true" values
}else{
  // Here we know for a fact that we won't be able to edit.
}

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 :

  • a "collaborator" button that opens a small modal. With the list of collaborators and each permission (with selectors to change their permissions)
  • a button to hide collaborative memos from the Home/Explore page. (optionnal)
@Iziram Iziram added the enhancement New feature or request label Aug 3, 2024
@Iziram
Copy link
Author

Iziram commented Aug 4, 2024

Issues related : #3754 #3708

@Iziram
Copy link
Author

Iziram commented Aug 4, 2024

I started to work on it.

Here is the repo : iziram/memos#collaborators

Worked on a bit of UI :

Memos.Mozilla.Firefox.2024-08-04.21-33-02.mp4

@wjbeckett
Copy link

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.

@KUKARAF
Copy link

KUKARAF commented Sep 1, 2024

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

@github-actions github-actions bot removed the Stale label Sep 2, 2024
@johnnyjoygh
Copy link
Collaborator

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. 7a9f619

@github-actions github-actions bot added the Stale label Sep 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

4 participants