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

Fix part of #4865 and Fix #4986 : Move all fragment arguments, activity intent extras, and saved instance state over to protos #5248

Open
wants to merge 184 commits into
base: develop
Choose a base branch
from

Conversation

Vishwajith-Shettigar
Copy link
Collaborator

@Vishwajith-Shettigar Vishwajith-Shettigar commented Nov 28, 2023

Explanation

Fixes #4986
Move all fragment arguments, activity extras, and saved instance state bundle usage over to using protos entirely.

Fix part of #4865
Introduce a ProfileID decorator to pack ProfileId into all Intents so that it can be easily accessed by underlying fragments and child classes. Some classes already use this utility where it was not easy to add profileId to the intent proto bundle.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

@Vishwajith-Shettigar Vishwajith-Shettigar marked this pull request as ready for review November 30, 2023 05:47
@Vishwajith-Shettigar Vishwajith-Shettigar marked this pull request as draft November 30, 2023 05:47
@Vishwajith-Shettigar
Copy link
Collaborator Author

@adhiamboperes, PTAL.

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

@Vishwajith-Shettigar, there is one unresolved comment. PTAL.

Copy link

oppiabot bot commented May 14, 2024

Unassigning @adhiamboperes since the review is done.

Copy link

oppiabot bot commented May 14, 2024

Hi @Vishwajith-Shettigar, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

@Vishwajith-Shettigar
Copy link
Collaborator Author

@adhiamboperes, I have addressed all of your comments, PTAL.
Thank you.

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @Vishwajith-Shettigar, this LGTM!

Copy link

oppiabot bot commented May 15, 2024

Assigning @BenHenning for code owner reviews. Thanks!

Copy link

oppiabot bot commented May 22, 2024

Hi @Vishwajith-Shettigar, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label May 22, 2024
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label May 22, 2024
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Apologies for the delayed review.

Thanks @Vishwajith-Shettigar! Had a few high-level comments before taking a deeper pass.

}

// Represents the parameters needed to create MarkChaptersCompletedTestActivity.
message MarkChaptersCompletedTestActivityParams{
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Please make sure there are spaces before opening curly braces here & elsewhere in this proto.


// Arguments required when creating a StateFragment.
message StateFragmentArguments {

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Nit here & above & elsewhere: please remove extra starting newline for formatting consistency.

// Arguments required when creating a MarkChaptersCompletedFragment.
message MarkChaptersCompletedFragmentArguments{
// The ID of the profile that wants to mark chapters as completed.
int32 internal_profile_id = 1;
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Here & elsewhere in this proto: could we perhaps use ProfileId instead? That's the structure meant for passing around a profile ID rather than exposing internal_profile_id directly.

"CurrentUserProfileIdIntentDecorator.profile_id_bundle_key"

/** Decorator that allows an activity to wrap a user's [ProfileId] within its intent. */
object CurrentUserProfileIdIntentDecorator {
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Per my comment in the proto file, is this actually needed if we're including ProfileId directly in the params & arguments used to create activities & fragments?

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.

Move all fragment arguments, activity intent extras, and saved instance state over to protos
3 participants