zulip-flutter icon indicating copy to clipboard operation
zulip-flutter copied to clipboard

login: Support logging out of an account

Open chrisbobbe opened this issue 1 year ago • 3 comments

Screenshots coming soon. :)

Fixes: #463

chrisbobbe avatar Sep 17 '24 22:09 chrisbobbe

imageimage

chrisbobbe avatar Sep 17 '24 22:09 chrisbobbe

This implements the logic where per-account routes on the nav are removed on logout, but it doesn't animate their exits; they just disappear suddenly. I think that's probably fine, and I didn't find a way to add the animation in.

To test a scenario where there are per-account routes when the logout happens, you can add a button to the "under construction" screen and copy-paste _logOutAccount into its press handler.

chrisbobbe avatar Sep 17 '24 22:09 chrisbobbe

Marked as a draft because in particular I think this may be lacking some test coverage that we'll want; for example, of the various if (maybeAccount == null) return;s added in PerAccountStore. But in that example, at least, I'm not sure if there might be a nicer way to write the app code. I added those early returns to avoid having ApiConnection.send get called after the ApiConnection was closed, which is a goal, as I think we discussed in the office on Friday.

chrisbobbe avatar Sep 17 '24 22:09 chrisbobbe

Thanks for the review! Revision pushed.

chrisbobbe avatar Oct 12 '24 01:10 chrisbobbe

Thanks for the review! Revision pushed.

chrisbobbe avatar Oct 17 '24 23:10 chrisbobbe

Do the screenshots need to be updated for this one?

alya avatar Oct 18 '24 17:10 alya

Do the screenshots need to be updated for this one?

Ah right! Actually the UI hasn't changed from what's shown in the screenshots in the PR description. I remember us talking in the office about making it look better, but I don't remember if we settled on something different. If there are changes to make, how about doing them as a followup?

chrisbobbe avatar Oct 18 '24 21:10 chrisbobbe

In the interest of getting things merged efficiently, maybe let's split this PR up

Sounds good. I just sent #1007 for those first several commits, and I'll send a followup with the remaining ones (implementing logout) as a followup. Then as mentioned in my previous comment, maybe any UI changes can be a followup to that.

chrisbobbe avatar Oct 18 '24 21:10 chrisbobbe