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

[GSoC'24] Introducing AnalyticsWidgetProvider as ancestor of all widget classes. #16545

Merged

Conversation

xenonnn4w
Copy link
Contributor

@xenonnn4w xenonnn4w commented Jun 4, 2024

Purpose / Description

Adding Up Analytical widget provider class for Widgets in AnkiDroid .

[GSoC'24] Implementation of Deck Picker Widget . #16450

Preview of affected UI areas after code changes [Functioning as Expected ]

AnalyticalWidgetProviderTest.mp4

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@xenonnn4w xenonnn4w added GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors Needs Review labels Jun 4, 2024
@david-allison
Copy link
Member

david-allison commented Jun 4, 2024

You should use this with our current classes

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Jun 4, 2024
@xenonnn4w
Copy link
Contributor Author

You should use this with our current classes

Sorry, didn't understand what you meant by that

@david-allison
Copy link
Member

Screenshot 2024-06-04 at 19 08 30

Two widget classes appear to be using this functionality and have duplicated code.
You're planning on adding a third which also uses this functionality, so the concern was extracted to a class

You should add the class which you've created into the inheritance hierarchy for the two other classes to reduce complexity

@xenonnn4w xenonnn4w requested a review from david-allison June 5, 2024 05:31
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch from 4b94e90 to 7dc5198 Compare June 5, 2024 11:25
@xenonnn4w xenonnn4w requested a review from david-allison June 5, 2024 11:33
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

LGTM, cheers

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author Needs Review labels Jun 5, 2024
@Arthur-Milchior
Copy link
Member

I don't understand you "how has this been tested" section. Can you please explain how the link refers to tests ?

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Jun 12, 2024
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch 2 times, most recently from 9806ffe to 4c36dc4 Compare June 14, 2024 16:38
@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Jun 14, 2024
@xenonnn4w xenonnn4w removed the Needs Second Approval Has one approval, one more approval to merge label Jul 6, 2024
@david-allison david-allison added the Needs Second Approval Has one approval, one more approval to merge label Jul 8, 2024
@david-allison
Copy link
Member

Pinged Arthur for re-review

@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch from 4c36dc4 to 6c4365e Compare July 11, 2024 08:05
Copy link
Member

@Arthur-Milchior Arthur-Milchior left a comment

Choose a reason for hiding this comment

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

There are some changes I don't understand. I am not 100% certain they are wrong, I may misunderstood things. But I'd really like your commit message to explain changes that don't seem to be directly related to refactoring common code.

My suspicion is that you did git pull origin main and didn't resolve properly the merge conflicts

Copy link
Member

@Arthur-Milchior Arthur-Milchior left a comment

Choose a reason for hiding this comment

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

Honestly, I'm unhappy with the recent changes.
Maybe they are correct change, maybe they are wrong change, I honestly don't know, because you don't explain what you're doing.

I spent more than an hour on it, trying to explain in details what's wrong. This should not be the case on a commit that is a month an a half old. Especially given that I already asked you the previous time to add comment and documentation, to explain to us what you're doing.

David did approve a previous version of the PR. Personally, I had some requests, but it seems globally okay. Now you made many you changes, you MUST explain why you did them. When I came back to review your PR, I was expecting to see essentially the same PR than last time, with the changes I requested and maybe change requested by David. If David approved your PR, you are not supposed to change it, or if you must, you should ask for a new review, or explain that it's really a trivial change (for example you rebased onto main, or you found a typo in a comment you wanted to fix).
You made really non trivial change. If they are really things you wanted to do, that you believed should be merged with the current PR, then you should have written it down explicitly, you should have explained what was changed so that we don't need to re-read everything, and check from scratch whether every part of the PR is okay in this new environment.

And, even if it were a fresh PR and not an update on a PR that was already reviewed, you need to save us time. I don't know Widgets very well, I don't know the details of AppWidgetManager. I should not have to know them. Android is huge, and maintainers do not have to know the entire system. The contributor that does a change, especially in the case of GSoC where it's your responsability to do this change, must assume that we know Kotlin correctly, that we have an idea of how Android generally works. But it's your role to explain what you do so that we don't have to read the whole documentation to understand the reason behind your proposed changes. And similarly, every such non trivial changes must be explained in the commit message, to help future reader of the code understand why the code is written the way it is, and maybe revert the change, or debug it, if it's not what you expected.

As far as I'm concerned, I will not accept to review another PR of yours unless every non trivial change you did are documented in the commit message, or comes with a comment or documentation near it.
If you have a doubt whether a change is trivial or not, consider it to be non-trivial. Once you document too much, we'll discuss or to ensure you comment just enough. But first, you must take the habit to comment a lot.

Finally, regarding

for some reason widget_eta and widget_due are not rendering after these changes , was investigating that onl;y

Here are my requests:

  • either you repaired it, and that's great. Please let us know
  • or it's still broken. In this case, please provide screenshot, so we understand exactly what you mean here. What is broken. Maybe we can help you. And, more importantly, either you believe the PR can still be merged, in which case explain why it's okay to merge this new class, even if it have issues. Or it can't be merged, and change the PR so that it moves to Draft, so that it's clear that there are still things wrong here. And please communicate with us, don't hesitate to ask for help. We didn't even knew there was an issue before you mentioned it as a reply to David. And if there is an issue with code we approved, it means we missed some errors, that's something that is interesting for us to know

@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch 2 times, most recently from f42ce81 to cf983bd Compare July 22, 2024 15:04
@xenonnn4w xenonnn4w removed the Needs Author Reply Waiting for a reply from the original author label Jul 22, 2024
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch from cf983bd to bd191dc Compare July 22, 2024 15:08
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Needs Review and removed Needs Second Approval Has one approval, one more approval to merge Needs Review labels Jul 22, 2024
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch from db42fc4 to 97ff2c4 Compare July 22, 2024 17:30
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch 3 times, most recently from 8681d32 to 30ce015 Compare July 23, 2024 15:29
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Looks good, cheers

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author labels Jul 23, 2024
Copy link
Member

@Arthur-Milchior Arthur-Milchior left a comment

Choose a reason for hiding this comment

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

Regarding the commit message, the way it usually work in github and most git tool is that the first line is considered to be the title, and the remaining is the body of the message.

So I'd appreciate if you could have a first line with something that looks like a title. The title will be the only thing that someone will see when they look at the history of AnkiDroidWidgetSmall.kt 's git blame for example.

It can be something as simple as:

Introducing AnalyticsWidgetProvider as ancestor of all widget classes

And then you can add a small message that explain why it's done, so that anyone looking at the commit understand more of the context.

This will ensure any widgets Timber and send analytics on enabling, disabling and updating.

@xenonnn4w xenonnn4w changed the title [GSoC'24] Analytical widget provider class for Deck Picker Widget . [GSoC'24] Introducing AnalyticsWidgetProvider as ancestor of all widget classes. Jul 25, 2024
This will ensure any widgets Timber and send analytics on enabling, disabling and updating.
@xenonnn4w xenonnn4w force-pushed the adding-Analytical-Widget-Provider branch from 7bc4ffc to 404e327 Compare July 25, 2024 02:05
@Arthur-Milchior Arthur-Milchior added this pull request to the merge queue Jul 26, 2024
Merged via the queue into ankidroid:main with commit f7d1b97 Jul 26, 2024
8 checks passed
@github-actions github-actions bot added this to the 2.19 release milestone Jul 26, 2024
@github-actions github-actions bot removed the Needs Second Approval Has one approval, one more approval to merge label Jul 26, 2024
Copy link
Contributor

Hi there @xenonnn4w! This is the OpenCollective Notice for PRs merged from 2024-07-01 through 2024-07-31

If you are interested in compensation for this work, the process with details is here:

https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid

Important

PLEASE NOTE: The process was updated in August 2024. Re-read the Payment Process page if you have not already.

We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month

Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants