Skip to content

Conversation

@chrisbobbe
Copy link
Collaborator

@chrisbobbe chrisbobbe commented Sep 19, 2025

Fixes #1548.
Fixes #1032.

Screenshots coming soon!

@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Sep 19, 2025
@chrisbobbe
Copy link
Collaborator Author

Light Dark
image image
image image

Copy link
Member

@rajveermalviya rajveermalviya left a 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.

/// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
/// If testing on iOS, uses [expectDestructiveActionButton] to check whether
/// If testing on iOS, use [expectDestructiveActionButton] to check whether

?

@rajveermalviya rajveermalviya added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Sep 22, 2025
Copy link
Member

@gnprice gnprice left a 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).

Comment on lines +164 to +166
contextMenuItemBgDanger: const Color(0xffc0070a), // TODO(#831) red/550
contextMenuItemIcon: const Color(0xff4f42c9),
contextMenuItemIconDanger: const Color(0xffac0508), // TODO(#831) red/600
Copy link
Member

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.

Comment on lines 378 to +382
return ZulipMenuItemButton(
style: destructive
? ZulipMenuItemButtonStyle.menuDestructive
: ZulipMenuItemButtonStyle.menu,
Copy link
Member

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?

Comment on lines 1616 to 1617
class DeleteButton extends MessageActionSheetMenuItemButton {
DeleteButton({super.key, required super.message, required super.pageContext});
Copy link
Member

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.

Comment on lines 254 to 258
Future<void> deleteMessage(
ApiConnection connection, {
required int messageId,
}) {
return connection.delete('updateMessage', (_) {}, 'messages/$messageId', {});
Copy link
Member

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 🙂

@chrisbobbe chrisbobbe force-pushed the pr-delete-message-button branch from 91e1875 to a22be95 Compare September 23, 2025 18:33
@chrisbobbe
Copy link
Collaborator Author

Thanks! Revision pushed.

@gnprice
Copy link
Member

gnprice commented Sep 23, 2025

Thanks! Would you add a test case like this one too?

  • one showing that if you dismiss the confirmation dialog, nothing happens (no request to the server).

Otherwise all LGTM.

@chrisbobbe chrisbobbe force-pushed the pr-delete-message-button branch from a22be95 to e812d51 Compare September 24, 2025 00:47
@chrisbobbe
Copy link
Collaborator Author

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.
@gnprice
Copy link
Member

gnprice commented Sep 24, 2025

Thanks! Looks good; merging.

@gnprice gnprice force-pushed the pr-delete-message-button branch from e812d51 to f89ecb2 Compare September 24, 2025 21:15
@gnprice gnprice merged commit f89ecb2 into zulip:main Sep 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration review Added by maintainers when PR may be ready for integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support deleting a message completely dialog: Styling for action-button text when the action is destructive

3 participants