Skip to content
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

Add support for posting as a different user #1159

Merged

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Mar 1, 2024

Pull Request Description

This PR adds the ability to create posts under a different account than is currently selected. It does so by using a new technique whereby we can change the current account without reloading the app. When the user navigates back from the create post page, the previous account is restored and their feed is left untouched. (One drawback is that you won't see the "navigate to post" snackbar since the post might not be federated to the original account's instance.) We can hopefully use this same technique for other "temporary account" operations.

To perform the account switching, I reused the profile modal switcher, and disabled the following things.

  • Ability to add new accounts/instances
  • Ability to delete accounts
  • Ability to see or select anonymous instances

There is also handling for if the selected community is not available on the instance of the desired account.

Future tasks:

  • Add support for commenting using a different account (should be pretty similar).
  • Add support for performing other actions (upvote/save/etc) using a different account (might be a bit different).

Issue Being Fixed

Issue Number: Partly related to #341

Screenshots / Recordings

Demo 1: Show posting as a different user, show that the original user is restored and feed is untouched, see that we can view the new post

demo1.mp4

Demo 2: Show that we handle when the selected community is not yet federated to the new user's instance

demo2.mp4

Checklist

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

@ggichure
Copy link
Collaborator

ggichure commented Mar 4, 2024

Awesome. saw @hjiangsu already mentioned #341.

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

I would just like to mention again that is super cool - thanks for working on this! LGTM other than the one comment that @ggichure already mentioned.

As a side note: this prompted me to work on the comment page refactor so that we can hopefully apply this in the future as you mentioned

@hjiangsu hjiangsu merged commit 177b607 into thunder-app:develop Mar 5, 2024
1 check passed
@micahmo micahmo deleted the feature/post-as-different-user branch March 6, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants