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

Ability to Set Post Language and Edit Existing Posts #893

Merged
merged 12 commits into from
Nov 27, 2023

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Nov 15, 2023

Pull Request Description

This is a PR which adds the ability to edit existing posts, and set the specified language for the post. It also adds a few UI changes to make the experience a bit more cohesive. The CreatePostPage was fully refactored to be able to take advantage of some of the comments mentioned in #853 (comment). This includes:

  • Removing most (if not all) other dependencies on blocs. This was done by creating a new cubit to handle the state management for this page.
  • Slight UI adjustments (mainly to community and user selectors) to match each other better
  • Reworked the draft logic to be handled within the CreatePostPage. This means we no longer need the previous draft logic outside of the CreatePostPage. This does not apply to the comment page as that still retains the original logic.
    • There is a slight minor issue where the snackbar does not show up when the post draft is saved. This could be due to the CreatePostPage being removed off the navigation stack (and thus having no context)

Notes:

  • With the addition of language selection, a new autocomplete has been added in to select and change the language.
  • When a post is editable, the reply action on the Post page will be transformed into an edit action.

Issue Being Fixed

Issue Number: #157, #892

Screenshots / Recordings

Screen.Recording.2023-11-14.at.7.34.20.PM.mov
simulator_screenshot_2B3A0A40-77E8-4DFC-B03D-E5BD1E5822FC simulator_screenshot_323109FF-592A-4FC7-ACFF-CABDF39D54E7

Checklist

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

This was referenced Nov 15, 2023
@micahmo micahmo mentioned this pull request Nov 22, 2023
@hjiangsu hjiangsu marked this pull request as ready for review November 24, 2023 21:35
@hjiangsu
Copy link
Member Author

@micahmo Feel free to review the PR if you'd like or do some testing! I think most cases were caught, but since this is a fairly big refactor, some things may have been missed (which should hopefully be caught when this is released to the nightly builds)

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Very nice, I especially like the draft refactoring!


// used create post from action sheet
/// Whether or not to pre-populate the post with the [title], [text], [image] and/or [url]
final bool? prePopulated;
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering if we might want to think about consolidating all the different ways we can prepopulate a post. Right now I think we have drafts, edits, and shares, each with different things that are saved/restored. (For example, is language selection saved with drafts?) Maybe we can have a wrapper class around a Post/View/Media/whatever, so that it can contain every possible field, and then an enum saying what kind of thing it is. Just a thought.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thats a good idea! I think we could do this in a different PR since this one already contains a pretty substantial change if thats all good with you.

Copy link
Member

Choose a reason for hiding this comment

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

Of course!

@hjiangsu hjiangsu merged commit 0e3a92f into develop Nov 27, 2023
1 check passed
@hjiangsu hjiangsu deleted the feature/edit-posts branch November 27, 2023 17:42
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.

None yet

2 participants