-
Notifications
You must be signed in to change notification settings - Fork 321
startup: Add beta-complete dialog #1797
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
base: beta-prelaunch
Are you sure you want to change the base?
startup: Add beta-complete dialog #1797
Conversation
The screenshots look good to me! It's a bit annoying that the heading might not fit on one line, but I think it's all right. |
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 for taking care of this! Generally looks good; mostly small comments.
lib/widgets/dialog.dart
Outdated
unawaited(showDialog( | ||
context: context, | ||
builder: (BuildContext context) => AlertDialog( | ||
title: Text('Time to switch to the new app'), | ||
content: SingleChildScrollView(child: Text(message)), | ||
actions: [ |
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: I like the structure I found for the welcome dialog (0e34d96 / #1590):
- turn this builder callback into the build method of a widget;
- then the logic above the
showDialog
call (well, except for a couple of locals that are part of the build logic) becomes a static method on that widget — so e.g.BetaCompleteDialog.show()
.
In particular that gives the build callback a bit more room to breathe, and separates it from the one-time logic that decides when and whether to show it.
lib/widgets/dialog.dart
Outdated
TextButton( | ||
onPressed: () { | ||
Navigator.pop(context); | ||
PlatformActions.launchUrl(context, | ||
Uri.parse('https://github.com/zulip/zulip-flutter/releases/latest')); | ||
}, | ||
child: _dialogActionText('Download official APKs (less common)')), |
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: These three very similar items can be made easier to read with a helper method; e.g.,
TextButton( | |
onPressed: () { | |
Navigator.pop(context); | |
PlatformActions.launchUrl(context, | |
Uri.parse('https://github.com/zulip/zulip-flutter/releases/latest')); | |
}, | |
child: _dialogActionText('Download official APKs (less common)')), | |
_linkButton( | |
url: 'https://github.com/zulip/zulip-flutter/releases/latest', | |
label: 'Download official APKs (less common)'), |
lib/widgets/dialog.dart
Outdated
|
||
final zulipLocalizations = ZulipLocalizations.of(context); | ||
|
||
final message = 'Since Zulip’s new Flutter app has launched, this beta app is no longer maintained. We strongly recommend uninstalling it and switching to the main Zulip application to get the latest features and bug fixes. Thank you for being a beta tester!'; |
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: wrap for readability
final message = 'Since Zulip’s new Flutter app has launched, this beta app is no longer maintained. We strongly recommend uninstalling it and switching to the main Zulip application to get the latest features and bug fixes. Thank you for being a beta tester!'; | |
final message = 'Since Zulip’s new Flutter app has launched,' | |
' this beta app is no longer maintained.' | |
' We strongly recommend uninstalling it and switching to the' | |
' main Zulip application to get the latest features and bug fixes.' | |
' Thank you for being a beta tester!'; |
(handy tip in Android Studio / IntelliJ: with cursor in the middle of a string literal, hit enter — that will insert the close-quote and open-quote to split the string, too)
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 for that tip, it worked great!
lib/widgets/dialog.dart
Outdated
|
||
final zulipLocalizations = ZulipLocalizations.of(context); | ||
|
||
final message = 'Since Zulip’s new Flutter app has launched, this beta app is no longer maintained. We strongly recommend uninstalling it and switching to the main Zulip application to get the latest features and bug fixes. Thank you for being a beta tester!'; |
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.
For the text here, how about:
Thanks for being a beta tester of the new Zulip app! This app became the main Zulip mobile app in June 2025, and this beta version is no longer maintained. We recommend uninstalling this beta after switching to the main Zulip app, in order to get the latest features and bug fixes.
lib/widgets/dialog.dart
Outdated
@@ -112,3 +116,75 @@ DialogStatus<bool> showSuggestedActionDialog({ | |||
])); | |||
return DialogStatus(future); | |||
} | |||
|
|||
bool debugDisableBetaCompleteDialog = false; | |||
void resetDebugDisableBetaCompleteDialog() { |
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: this should also start with "debug", as it's meant to be called only in debug mode
test/notifications/open_test.dart
Outdated
debugDisableBetaCompleteDialog = true; | ||
addTearDown(resetDebugDisableBetaCompleteDialog); |
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: alternatively, could dispense with the separate "reset" method:
debugDisableBetaCompleteDialog = true; | |
addTearDown(resetDebugDisableBetaCompleteDialog); | |
debugDisableBetaCompleteDialog = true; | |
addTearDown(() => debugDisableBetaCompleteDialog = false); |
test/widgets/message_list_test.dart
Outdated
debugDisableBetaCompleteDialog = true; | ||
addTearDown(resetDebugDisableBetaCompleteDialog); |
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: are these needed? I don't see ZulipApp used in this file
8685f9a
to
bbf6413
Compare
This is a cherry-pick of d6affc9 from the main branch.
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! Looks good.
One nit; and I'm also pushing a commit to try to get CI working:
0190b1f ci: Fetch 3000 commits from upstream, rather than 1000
lib/widgets/dialog.dart
Outdated
Widget _linkButton(BuildContext context, {required String url, required String label}) => | ||
TextButton( |
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: use block body for a multi-line definition like this
bbf6413
to
6ead9e8
Compare
6ead9e8
to
8986236
Compare
Thanks! Fixed that nit. |
CI failed with one lint issue and 5 test failures. At least some of those are due to using the latest upstream Flutter. So let's switch |
2ba4e8d
to
70eb175
Compare
To avoid one lint issue and 5 test failures that would happen if using the latest main.
70eb175
to
fd5138b
Compare
Fixes #1603.
cc @alya