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

Add collaboration UI #1491

Merged
merged 121 commits into from Sep 23, 2021
Merged

Add collaboration UI #1491

merged 121 commits into from Sep 23, 2021

Conversation

danilo04
Copy link
Contributor

@danilo04 danilo04 commented Sep 13, 2021

Fixes #1479

Fix

This PR adds a UI for adding/removing collaborators to a note. Sorry for the size of the PR but I couldn't break more the changes to bring collaboration to Android (they already broken in 4 different issues/PRs #1473).

Note: I have stressed tested the UI by adding and removing collaborators as fast as I could and there are some cases in which collaborators are deleted from the list but then added. I presume that this is mostly due to a race condition on the Simperium library. I will track the issue in Simperium/simperium-android#238.

Test

  1. Go to a note
  2. Tap on the menu on the top right corner (dot ...)
  3. Tap on collaborators
  4. Tap on Add Collaborator and type anything that is not a valid email. A message invalid collaborator should be shown.
  5. Write a valid email address and tap on Accept. Should update the layout to list of collaborators
  6. Tap on the cross icon to remove the collaborator. Should update the layout to show the initial message
  7. Tap on Add Collaborator and enter an email address from another valid simplenote account
  8. The note should be shared to the other account

Review

Only one developer and one designer are required to review these changes, but anyone can perform the review.

Release

The SimperiumCollaboratorsRepository now has a dependency for
Bucket<Note>, thus, all tests that use the instance directly had to be
updated.
Given that notes are synchronized across different devices, there may
be the case in which a user will try to get the collaborators of a note
that was deleted or is in the trash. For those cases, we cannot add
collaborators.
Created the getNote method that will be reused in addCollaborator and
getCollaborators since these methods need a Note object.
Collaborator validation should not be responsibility of
addCollaborators.
Since loading a note does a database query, we change all the methods
in SimperiumCollaboratorsRepository to suspend methods. To be able to
test properly the repository, we need to inject the dispatcher, so we
updated the dispatcher in all the test and created a provider for Hilt.
Tests on model does not require emulator. They can run fast and are
better suited to run as unit tests instead of connected tests.
Make explicit that TagValidationResult is part and just used in
ValidateTagUseCase.
@danilo04
Copy link
Contributor Author

Thank you for the thorough review as always @ParaskP7. I have made most of the changes requested and commented in some requests that I did not apply any change. Let me know WDYT?

We have commented over other channels about the long PR and the duplicated commits.

@ParaskP7
Copy link
Contributor

👋 @danilo04 !

Thank you for the thorough review as always @ParaskP7. I have made most of the changes requested and commented in some requests that I did not apply any change. Let me know WDYT?

Thank YOU for applying the suggestions in such a graceful way. I have just left a couple of comments unresolved for us to have one final discussion. However, I don't want to block this PR anymore and will approve it no matter. Feel free to merge it when you feel you are ready.

We have commented over other channels about the long PR and the duplicated commits.

💯

This is mostly for testing purposes since it is easier to inject a test
dispatcher to avoid multithreading bugs in the testing library for
coroutines.
@SylvesterWilmott
Copy link

Haven't had an opportunity to fully test but some observations so far:

  • "Add Collaborator" button should not be a flat button but should instead be a tappable row.
  • The list of collaborators has additional padding on the right, eg. the touch feedback of the "x" is cut off on the right-hand side. This is in contrast to similar layouts like tags edit view.
  • Once a collaborator is added, the email appears in the tags list.
  • The "Email Address" input blue colour does not adapt to dark mode. Blue30 should be used here.
  • The "x" icons in the collaborator list don't adapt to dark mode. Gray30 should be used here.

Even though the dialog was using the correct mode (light or dark), the
view inside the dialog was not. To make the view inside the dialog mode
aware, we use the context theme wrapper to inflate the layout.
@danilo04
Copy link
Contributor Author

danilo04 commented Sep 22, 2021

Hi @SylvesterWilmott 👋 . Thanks for the review. I have made the following changes:

"Add Collaborator" button should not be a flat button but should instead be a tappable row.

Do you mean the whole row where Add Collaborator is, is tappable?
I have made the whole row tappable in 74171ed but I am not sure if that is what you mean.

The list of collaborators has additional padding on the right, eg. the touch feedback of the "x" is cut off on the right-hand side. This is in contrast to similar layouts like tags edit view.

I have removed the padding but part of the touch feedback is cut off similar to the delete button in edit tags (fixed in 74171ed).

Once a collaborator is added, the email appears in the tags list.

I am not sure about this. Could you expand a little bit?
This will be handled in a different PR.

The "Email Address" input blue colour does not adapt to dark mode. Blue30 should be used here.

Fixed in 84ee1e4.

The "x" icons in the collaborator list don't adapt to dark mode. Gray30 should be used here.

Fixed in 74730be.

@SylvesterWilmott
Copy link

Thanks for the changes @danilo04

All looks good. Just one more request, let's add the touch feedback to the "Add Collaborator" row.

@danilo04
Copy link
Contributor Author

Hi @SylvesterWilmott.

Just one more request, let's add the touch feedback to the "Add Collaborator" row.

Fixed in 208f343. Let me know if it works OK on your part.

@danilo04 danilo04 merged commit 15796db into develop Sep 23, 2021
@danilo04 danilo04 deleted the issue/1479-add-collaboration-ui branch September 23, 2021 18:20
@SylvesterWilmott
Copy link

SylvesterWilmott commented Sep 24, 2021

It looks like this PR was merged before the needs design review label was removed but there are a couple more issues we can tackle in the next PR.

  1. The "Add Collaborator" row should be 48dp tall with 8dp top and bottom margins. This means the area that is tappable should only be 48dp. This is illustrated in Zeplin by clicking on the bounding boxes in the design:

Screenshot 2021-09-24 at 09 29 40

  1. It looks like it's possible to add yourself as a collaborator. While we validate the email, let's also make sure that the email doesn't match the email of the currently logged in account. In this event we can show the error You cannot add yourself as a collaborator in the red error text below the input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consistency Issues created in order to align the UX with other platforms [feature] tags Anything related to Tags [status] needs code review [status] needs design review [Type] Enhancement Improve existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Collaborators UI. This includes: list of collaborators and add Collaborator dialog.
3 participants