-
Couldn't load subscription status.
- Fork 347
msglist: Support deleting a message completely #1861
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
Conversation
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.
Thanks @chrisbobbe! All LGTM, and tests great. One nit below.
test/widgets/dialog_checks.dart
Outdated
| /// Checks for a suggested-action dialog matching an expected title and message. | ||
| /// Fails if none is found. | ||
| /// | ||
| /// If testing on iOS, uses [expectDestructiveActionButton] to check whether |
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.
nit:
| /// If testing on iOS, uses [expectDestructiveActionButton] to check whether | |
| /// If testing on iOS, use [expectDestructiveActionButton] to check whether |
?
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.
Thanks @chrisbobbe, and thanks @rajveermalviya for the previous review!
Just a few nits below. Let's also have a couple of quick tests for this:
- one test case showing it does the thing;
- one showing that if you dismiss the confirmation dialog, nothing happens (no request to the server).
| contextMenuItemBgDanger: const Color(0xffc0070a), // TODO(#831) red/550 | ||
| contextMenuItemIcon: const Color(0xff4f42c9), | ||
| contextMenuItemIconDanger: const Color(0xffac0508), // TODO(#831) red/600 |
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.
Ah neat — I like this way of concisely recording what color from the palette these are linked to.
| return ZulipMenuItemButton( | ||
| style: destructive | ||
| ? ZulipMenuItemButtonStyle.menuDestructive | ||
| : ZulipMenuItemButtonStyle.menu, |
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.
nit: maybe make this param required now?
lib/widgets/action_sheet.dart
Outdated
| class DeleteButton extends MessageActionSheetMenuItemButton { | ||
| DeleteButton({super.key, required super.message, required super.pageContext}); |
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.
nit: make private?
Or if not, then give a more explicit name: e.g. DeleteMessageButton.
lib/api/route/messages.dart
Outdated
| Future<void> deleteMessage( | ||
| ApiConnection connection, { | ||
| required int messageId, | ||
| }) { | ||
| return connection.delete('updateMessage', (_) {}, 'messages/$messageId', {}); |
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.
Looks like a copy-paste-o here 🙂
91e1875 to
a22be95
Compare
|
Thanks! Revision pushed. |
|
Thanks! Would you add a test case like this one too?
Otherwise all LGTM. |
a22be95 to
e812d51
Compare
|
Yep! Done; revision pushed (forgot to comment yesterday saying that). |
…fault But only when we're simulating recent servers, as the comment says. (FL 291 removed realmDeleteOwnMessagePolicy and added realmCanDeleteOwnMessageGroup, so to be representative, tests should always specify one but not the other.)
Fixes zulip#1032. See Apple's HIG document: https://developer.apple.com/design/human-interface-guidelines/alerts And note that Android doesn't vary the button styles in these ways; see the description of zulip#1032.
Fixes zulip#1548. For the confirmation dialog, we considered following web by including a button linking to /help/delete-a-message#delete-a-message-completely but decided not to because there wasn't a natural way to make it subtle/low-attention.
|
Thanks! Looks good; merging. |
e812d51 to
f89ecb2
Compare




Fixes #1548.
Fixes #1032.
Screenshots coming soon!