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

Migrated PostSettingsInputDialogFragment to ViewBinding #20941

Conversation

neeldoshii
Copy link
Contributor

Description

This pull request migrates the AddCategoryFragment to use ViewBinding, improving type safety and eliminating the need for findViewById calls.

Fixes

Screenshots/ Video

PostSettingsInputDialogFragment.webm

Steps to reproduce

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

@ParaskP7 ParaskP7 self-requested a review June 10, 2024 10:35
@ParaskP7 ParaskP7 added this to the Future milestone Jun 10, 2024
@neeldoshii neeldoshii marked this pull request as draft June 10, 2024 18:48
@neeldoshii neeldoshii force-pushed the Migrated-`PostSettingsInputDialogFragment`-to-ViewBinding branch from dc5b518 to 8528c20 Compare June 11, 2024 01:30
@neeldoshii neeldoshii marked this pull request as ready for review June 11, 2024 01:30
@neeldoshii neeldoshii force-pushed the Migrated-`PostSettingsInputDialogFragment`-to-ViewBinding branch from 3c62fbf to 57cfb46 Compare June 11, 2024 06:20
Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @neeldoshii !

Thank you so much for your contribution to JP/WPAndroid with this PR! 🥇

I have reviewed and tested this PR as per the instructions, along with triggering CI on it via a draft PR, which I just pushed on the main repo, everything works as expected, good job! 🌟


I have left couple of suggestions (💡) for you to consider. I am not going to approve this PR, but also, I don't want to block it, thus I'll just add a comment review. I am NOT going to merge this PR yet to give you some time to apply any of my suggestions.

@neeldoshii neeldoshii force-pushed the Migrated-`PostSettingsInputDialogFragment`-to-ViewBinding branch from fb445cc to 0c09e9e Compare June 11, 2024 11:57
@@ -94,34 +93,32 @@ public void onDismiss(DialogInterface dialog) {
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder =
new MaterialAlertDialogBuilder(new ContextThemeWrapper(getActivity(), R.style.PostSettingsTheme));
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
LayoutInflater layoutInflater = requireActivity().getLayoutInflater();
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor (🔍): Although this change is perfectly valid, consider avoid adding an unrelated change on a single commit. If you need to make this change, add a separate targeted commit on top of the main set of commits on a PR. Then, explaining the reasoning behind that change, even maybe group other such changes to make this change more impactful. How does this sound? 🙏

PS: No need for you to do anything here, this is just for educational purposes only.

@ParaskP7 ParaskP7 self-requested a review June 12, 2024 12:16
@ParaskP7
Copy link
Contributor

Another tip from my side @neeldoshii , when you update your PR, enter into the habit of merging your changes with the latest change from trunk. This way, when I try to update my debug version of either the WordPress or Jetpack apps it won't make it hard on me, asking me to uninstall and install the app again, just because the version of the app on this PR is older (see version.properties).

Also, this way, you are making sure that new changes from trunk aren't affecting your changes and everything is tested with the most sync version of the app(s).

Does that make sense to you? 😊

FYI: As you can understand, uninstalling and installing the app, then trying to login before testing such small changes can reduce a developer's productivity while reviewing a PR.

@neeldoshii
Copy link
Contributor Author

neeldoshii commented Jun 13, 2024

FYI: Btw, I am not sure why you are doing that, but feel free to add a separate commit with any change that is suggested during a PR review. Instead, if you keep rebasing your single commit it creates a problem where I also have to rebase the draft PR for CI. Also, in general, after any PR gets open, the guidance is to not rebase and force-push any more, as this makes it difficult to review the changes, as a review ideally would have to be done from scratch. Just adding extra commit on top is perfectly fine. Does that make sense to you? 🙏

Sure @ParaskP7, I understand. 👍 Previously, I was rebasing and squashing commits to keep the commit history clean and make it easier to revert changes if needed. However, I see your point about the difficulties it creates for reviewing and CI processes. From now on, I'll avoid rebasing after a PR is open and will add any changes as separate commits instead. Thanks for the guidance! 🙏

Another tip from my side @neeldoshii , when you update your PR, enter into the habit of merging your changes with the latest change from trunk. This way, when I try to update my debug version of either the WordPress or Jetpack apps it won't make it hard on me, asking me to uninstall and install the app again, just because the version of the app on this PR is older (see version.properties).

Understood! 👍


While merging the branch to upstream to the recent changes. I messed up which caused pushing the changes of commits behind from upstream. Can I perform git reset and force push now to clean this? What do you think is.better to fix this now?

@ParaskP7
Copy link
Contributor

👋 @neeldoshii and thanks for being so cooperative! 🙏

While merging the branch to upstream to the recent changes. I messed up which caused pushing the changes of commits behind from upstream. Can I perform git reset and force push now to clean this? What do you think is.better to fix this now?

Yes, no worries, please start over with a clean set. 👍

@neeldoshii neeldoshii force-pushed the Migrated-`PostSettingsInputDialogFragment`-to-ViewBinding branch from 19499d6 to d73aa4d Compare June 13, 2024 09:29
@neeldoshii neeldoshii force-pushed the Migrated-`PostSettingsInputDialogFragment`-to-ViewBinding branch from d73aa4d to 3400278 Compare June 13, 2024 09:31
Copy link

sonarcloud bot commented Jun 13, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ParaskP7
Copy link
Contributor

👋 @neeldoshii !

Can I perform git reset and force push now to clean this? What do you think is.better to fix this now?

I am still waiting for you on that, correct? 🤔

@neeldoshii
Copy link
Contributor Author

neeldoshii commented Jun 17, 2024

👋 @neeldoshii !

Can I perform git reset and force push now to clean this? What do you think is.better to fix this now?

I am still waiting for you on that, correct? 🤔

Hi @ParaskP7, I already did. Ready for review!

@ParaskP7
Copy link
Contributor

Hi @ParaskP7, I already did. Ready for review!

Awesome @neeldoshii , thanks for the heads-up, will do the review asap! 👍

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @neeldoshii !

Looking at your updates I am not seeing you applying at least this suggestion of mine, changing mBinding to binding. Unfortuantely, I can't merge this as it is breaking our coding guidelines in general. Can you deal with it please? 🙏

@neeldoshii
Copy link
Contributor Author

👋 @neeldoshii !

Looking at your updates I am not seeing you applying at least this suggestion of mine, changing mBinding to binding. Unfortuantely, I can't merge this as it is breaking our coding guidelines in general. Can you deal with it please? 🙏

Hi @ParaskP7, nice catch thanks. I have updated the requested changes.

@ParaskP7
Copy link
Contributor

Hi @ParaskP7, nice catch thanks. I have updated the requested changes.

Thanks @neeldoshii , will do the review asap! 👍

@ParaskP7 ParaskP7 self-requested a review June 18, 2024 08:42
Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

🎉 @neeldoshii , everything is looking good, your second contribution to JP/WPAndroid is about to become history and soon merged into trunk, thanks so much for this work! 🥇

@ParaskP7 ParaskP7 merged commit 3b1e418 into wordpress-mobile:trunk Jun 18, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants