-
Notifications
You must be signed in to change notification settings - Fork 384
Show discard or keep alert after tapping outside of the PR reviewers,… #2633
base: master
Are you sure you want to change the base?
Conversation
… assignees, milestones, labels modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, but looks good. Can we maybe add some tests? 😇
Let me know if there's anything I can help with. Congrats on the contribution!
@@ -323,10 +335,22 @@ final class IssueManagingContextController: NSObject, ContextMenuDelegate { | |||
|
|||
let selected = controller.selected | |||
guard controller.selectionChanged(newValues: selected) else { return } | |||
|
|||
if controller.wasDismissedByDone { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this logic in a function, as it seems to be repeated from lines 312-320?
@@ -30,6 +30,8 @@ PeopleSectionControllerDelegate { | |||
private var owner: String | |||
private var repo: String | |||
|
|||
var wasDismissedByDone: Bool = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this variable be included in the delegate
maybe? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you talking about ContextMenuDelegate
? Maybe we can modify its functions signatures to add this flag:
public protocol ContextMenuDelegate: class {
func contextMenuWillDismiss(viewController: UIViewController, animated: Bool, doneTapped: Bool)
func contextMenuDidDismiss(viewController: UIViewController, animated: Bool, doneTapped: Bool)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good! Would maybe make it didTapDone
(or maybe even viaButton: Button
or similar, do be able to differentiate?)
A bit tricky as the ContextMenu
is a separate pod and will probably not always contain a Done
.
@julienbodet still on this? Sent with GitHawk |
@Huddie yep still on it. I addressed most of comments but I didn’t push yet. Sent with GitHawk |
… assignees, milestones, labels modal
This my first contribution to GitHawk :) Thanks for the awesome project!
I implemented the feature from #2582. Now after tapping outside the modal for PR reviewers, assignees, milestone or labels, an alert appears asking to keep or discard the changes, if any.