-
Notifications
You must be signed in to change notification settings - Fork 301
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
Add collaboration UI #1491
Conversation
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.
To be able to test this method, we need to mock the whole class. We mock CollaboratorsRepository and all the calls that the tests made.
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. |
👋 @danilo04 !
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.
💯 |
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.
Haven't had an opportunity to fully test but some observations so far:
|
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.
Hi @SylvesterWilmott 👋 . Thanks for the review. I have made the following changes:
Do you mean the whole row where Add Collaborator is, is tappable?
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).
Fixed in 84ee1e4.
Fixed in 74730be. |
Thanks for the changes @danilo04 All looks good. 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. |
It looks like this PR was merged before the
|
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
Accept
. Should update the layout to list of collaboratorsReview
Only one developer and one designer are required to review these changes, but anyone can perform the review.
Release