thunder icon indicating copy to clipboard operation
thunder copied to clipboard

Account page and management improvements

Open CTalvio opened this issue 1 year ago • 12 comments

Pull Request Description

  • Remove logout button from account page
  • Move the manage accounts button to the left (where log out used to be)
  • Enable logging out from the last account from the manage accounts modal
  • Do not display "you are browsing anonymously" placeholder when account is actually loading
  • Do not display account page before it has fully loaded (before, an empty view was momentarily displayed)
  • Change instance links in login dialogues to outline buttons
  • Add "log out" to general account actions on account setting page
  • Add "manage accounts" dialogue to account setting page (this also replaces the "you are browsing anonymously" placeholder when an anonymous account is used or is the only account available)

Issue Being Fixed

Various inconsistencies on the account page, alleviates confusion about where to find what and what the state of the account page is. Makes common actions available where one would think to look, especially when looking for account management via the settings tab. (before, you would never have found a way to log out from here, or add/remove accounts)

Screenshots / Recordings

image

image

Here's what switching accounts looked like before: Screen_recording_20240506_224508.webm

After: Screen_recording_20240506_224542.webm

Checklist

  • [ ] Did you update CHANGELOG.md?
  • [x] Did you use localized strings where applicable?
  • [ ] Did you add semanticLabels where applicable for accessibility?

CTalvio avatar May 06 '24 20:05 CTalvio

If I remove all accounts and then navigate to Settings > Account, I get an infinite spinner.

Good catch. And agreed on using a user indicator, the switchers are a bit redundant but I didn't bother figuring out something better, and what a timesave that was, as you now reveal the perfect widget exists already :D

This is super nit-picky, but do you want to match the horizontal rule in the account settings page with the ones on the Debug and Appearance page (or vice versa) just for consistency?

Yes. This would absolutely have bothered me the second I noticed.

CTalvio avatar May 06 '24 21:05 CTalvio

Hi @CTalvio, sorry for being annoying! Your latest commit does fix the account settings page from settings! But now there seems to be an issue with the profile page.

  1. If I log out of the last account, it leaves my account info there.
  2. If I refresh, it gets stuck spinning forever.

https://github.com/thunder-app/thunder/assets/7417301/51ceceba-a71c-4b88-85e5-3b0b28f453b5

micahmo avatar May 07 '24 14:05 micahmo

That seems to do the trick.

I'm not sure what the returns in those listeners were there to do?

CTalvio avatar May 07 '24 19:05 CTalvio

Oh, we can't take those out! Those returns are what supports the temporary account feature (where you can post or comment as a different user). It allows us to switch the account without reloading the whole app. When reload is false, we shouldn't rebuild parts of the app like the user page or the feed. Sorry if that makes your feature more complicated (although I'm not sure why reload is false in your case).

micahmo avatar May 07 '24 19:05 micahmo

Yeah I figured they were there for a reason... Hence my commenting on it.

The account page is leaving the old account page up because it doesn't update on changes elsewhere.

CTalvio avatar May 07 '24 20:05 CTalvio

Would it help to do just the UI changes in this PR (moving the manage button the left, removing the log out button, allowing log out of last account, allow management of account from account settings page) and worry about the bloc/reloading issues separately? I know @hjiangsu has talked about combining AuthBloc and AccountBloc which I think could help us here too!

micahmo avatar May 07 '24 20:05 micahmo

I'll poke at it some more, but if nothing else I'll obviously reverse removing those returns.

CTalvio avatar May 07 '24 21:05 CTalvio

It's behaving weird in general. Switching the account while in account settings doesn't stick, but doing so from the account page, does. Removing the returns doesn't fix that.

CTalvio avatar May 07 '24 21:05 CTalvio

This is super nit-picky, but do you want to match the horizontal rule in the account settings page with the ones on the Debug and Appearance page (or vice versa) just for consistency?

Just a note, I'm refactoring this divider widget (since we're using it a bunch now) in #1359, so whichever one of us goes first can pick up the changes from the other. 😊

micahmo avatar May 09 '24 17:05 micahmo

I was playing around with this a bit, and noticed that if you manage accounts from the account settings, it changes your entire profile (until you refresh again?). Previously, switching users in the account settings would only temporarily switch users.

Here's what I mean:

https://github.com/thunder-app/thunder/assets/30667958/a488eec1-7f74-409c-ad77-369efe1f13b7

https://github.com/thunder-app/thunder/assets/30667958/81123bb0-5704-4c7d-b4c6-24e0db57eda0

hjiangsu avatar May 11 '24 16:05 hjiangsu

It's behaving weird in general. Switching the account while in account settings doesn't stick, but doing so from the account page, does. Removing the returns doesn't fix that.

It's supposed to actually change the account, unlike working the same way as posting/commenting as a different user like it did before. But it doesn't stick for some reason, as you point out.

This is because you can now remove/add accounts from account settings.

CTalvio avatar May 12 '24 12:05 CTalvio

Mystery solved, I didn't remove the code that restores previous account upon popping out of the account settings.

As for the profile sticking around when going from logged-in to accounts removed/anonymous, due to the reload not happening for some reason, adding a logged-in check to the reload returns works around that oddity.

CTalvio avatar May 12 '24 20:05 CTalvio