feat: add "Unsubscribe from repository" button #784
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Add a "Unsubscribe from repository" button.
It uses the "Set a repository subscription" REST API,
Discussion
Two things:
At first I was going to start implementing the "Mark repository as done" button (as it had already been discussed in feat: add a "mark notification as done" button #706, PR coming soon 😉), but having miss-aligned icons made me look into adding this feature first...
But I feel like it's really "heavy" on the UI, it's not so beautiful and it makes it harder to distinguish if the row is a Notification or a Repository...
What do you think?
Following the "Unsubscribe from notification" implementation, I made it so that clicking on Repository unsubscribe marks all of the repository's notifications as read. But this behaviour looks a bit odd to me; why automatically discard all those notifications? And why mark them as read instead of done? Perhaps it is better not to discard those notifications at all? If so, we would have to find a way to tell the user that the unsubscribe action has been successful...