Skip to content

Conversation

chrisbobbe
Copy link
Collaborator

Stacked atop #1887.


Fixes #1827.
Fixes #1878.

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

chrisbobbe commented Oct 1, 2025

cc @alya

Now, when using the toggle switch, we show the confirmation dialog, but only if you won't be able to resubscribe (see #1878):

image

Also, when using the action sheet, we show the confirmation dialog even if you will be able to resubscribe (see #1827):

image

@alya
Copy link
Collaborator

alya commented Oct 1, 2025

In general, our pattern is to always show a privacy marker or (if not convenient) a # before a channel name. It can be a separate PR, but can we add that to these confirmation dialogs?

chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this pull request Oct 1, 2025
…itle

See Alya's feedback on zulip#1890:

zulip#1890 (comment)
> In general, our pattern is to always show a privacy marker or (if
> not convenient) a `#` before a channel name. It can be a separate
> PR, but can we add that to these confirmation dialogs?

Doing this in code, rather than in the translators' source string,
because we don't want it to vary by language.
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! LGTM, and tests great. Moving over to Greg's review.

Also I see there are some conflicts now that #1887 is merged.

@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 Oct 3, 2025
@rajveermalviya rajveermalviya requested a review from gnprice October 3, 2025 16:53
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 for taking care of this, and @rajveermalviya for testing it out!

Generally this all looks good; a few comments below.

In the new variant of the dialog, the body looks redundant to me:

Unsubscribe from production help?

Are you sure you want to unsubscribe?

Can we leave the body/message out and just let the title speak for it? (/cc @alya)

return fetchedMessage?.content;
}

static Future<void> unsubscribeFromChannel(BuildContext context, {
Copy link
Member

Choose a reason for hiding this comment

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

This could use a bit of dartdoc, in particular to highlight that it may show a confirmation message.

Otherwise it sounds like it just unconditionally unsubscribes (and then if that request fails shows an error dialog, in common with other ZulipAction methods).

Comment on lines 278 to 280
await tester.tap(find.byWidget(cancelButton));
await tester.pump();
check(connection.lastRequest).isNull();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
await tester.tap(find.byWidget(cancelButton));
await tester.pump();
check(connection.lastRequest).isNull();
await tester.tap(find.byWidget(cancelButton));
await tester.pump(duration: Duration.zero);
check(connection.lastRequest).isNull();

Or perhaps better yet, pumpAndSettle().

Otherwise if we were to have a bug where "cancel" didn't work and instead resulted in going ahead and making the request, I think this test could easily be defeated if the request happened to come only after an await somewhere.

Comment on lines 141 to 143
await ZulipAction.unsubscribeFromChannel(context,
channelId: channel.streamId,
// Only show the confirmation dialog when you wouldn't be able to
// resubscribe.
alwaysAsk: false);
Copy link
Member

Choose a reason for hiding this comment

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

As a bonus, the above-mentioned dartdoc should obviate the need for this comment.

gnprice pushed a commit to chrisbobbe/zulip-flutter that referenced this pull request Oct 3, 2025
…itle

See Alya's feedback on zulip#1890:

zulip#1890 (comment)
> In general, our pattern is to always show a privacy marker or (if
> not convenient) a `#` before a channel name. It can be a separate
> PR, but can we add that to these confirmation dialogs?

Doing this in code, rather than in the translators' source string,
because we don't want it to vary by language.
…itle

See Alya's feedback on zulip#1890:

zulip#1890 (comment)
> In general, our pattern is to always show a privacy marker or (if
> not convenient) a `#` before a channel name. It can be a separate
> PR, but can we add that to these confirmation dialogs?

Doing this in code, rather than in the translators' source string,
because we don't want it to vary by language.
Fixes zulip#1827.

(That is, always confirm when unsubscribing via the action sheet --
I've added a test that we *don't* always confirm in the "All
channels" page, since that could be annoying, as mentioned in the
issue.)
@chrisbobbe chrisbobbe force-pushed the pr-more-unsubscribe-dialogs branch from 156f4d4 to 912f243 Compare October 3, 2025 23:51
@chrisbobbe
Copy link
Collaborator Author

Thanks for the review! Revision pushed, this time atop #1893 which I've just updated.

@chrisbobbe
Copy link
Collaborator Author

Re: #1890 (review) , here's what the dialog looks like with just the title, no body text:

Light Dark
image image

@gnprice
Copy link
Member

gnprice commented Oct 4, 2025

Thanks! Looks good; merging.

@gnprice gnprice merged commit 912f243 into zulip:main Oct 4, 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.

Add warning when unsubscribing from private channel using toggle Confirmation dialog on channel-unsubscribe from action sheet, for any channel
4 participants