-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix initial load issue #1284
Fix initial load issue #1284
Conversation
I think this causes a regression where we can't switch to a different account if the current account's instance is down. See #769 and #770 for more details. To prevent this, I think we can introduce two actions here: one to retry and one to switch accounts. Thoughts? |
Good call! I've made qemu-system-x86_64_YoWBgRLugG.mp4 |
I just have one small UI tweak - can we make it so that the buttons are in separate rows? Also, I think making one button the "primary" action and the other a "secondary" action would help with overall UI/UX! For the primary/secondary, I'd suggest the following:
|
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.
LGTM! Just double checking, this is ready to be merged?
@@ -4,10 +4,14 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | |||
class ErrorMessage extends StatelessWidget { | |||
final String? title; | |||
final String? message; | |||
final String? actionText; | |||
final VoidCallback? action; | |||
final List<({String text, void Function() action, bool loading})>? 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.
Interesting use of records!
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.
Yeah it's close to needing a class. 🫣
If the last screenshot looks good to you, yes! |
Pull Request Description
This PR fixes an issue where there's not an easy way to retry loading the feed if it times out due to a network issue. Note that in addition to changing the
ErrorMessage
action from "Account Settings" to "Retry", I also made the action button disabled and show a spinner when it is pressed. I did this because the main page doesn't react toAuthStatus.loading
, so there was no other indication that any action had been taken. I'm not sure exactly why that was, but I have a feeling it had something to do with the main page indicator and the feed page's indicator not quite aligning together, and most of the time only the latter is needed.Issue Being Fixed
Issue Number: #1283
Screenshots / Recordings
The demo shows first an unsuccessful retry attempt, and then a successful one.
qemu-system-x86_64_zTWK31Qo21.mp4
Checklist
semanticLabel
s where applicable for accessibility?