-
Notifications
You must be signed in to change notification settings - Fork 11
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
[ENHANCEMENT] Refactor feature chart methods to be more generic and reusable #964
Comments
The same applies to the |
jcscottiii
added a commit
that referenced
this issue
Dec 27, 2024
**Background:** When backfilling usage data, the feature usage chart displayed only a few data points, not the complete set. Network inspection revealed that multiple pages of data were successfully retrieved. **Repro:** 1. Navigate to: https://website-webstatus-dev.corp.goog/features/flexbox?showUsageChart **Solution:** This change aligns the feature usage chart pagination with the feature support chart's implementation: https://github.com/GoogleChrome/webstatus.dev/blob/b84a9ac02c2455dd6e5043615fc2a084f6980a46/frontend/src/static/js/components/webstatus-feature-page.ts#L621-L650 **Testing:** Comprehensive unit tests will be included with the refactor outlined in #964. To validate the pagination logic, this commit increases the number of data points displayed to over 100, enabling testing through Playwright. To optimize Playwright test performance, the initial data load specifically filters for the feature used in the feature page test, mitigating delays associated with loading excessive fake data.
github-merge-queue bot
pushed a commit
that referenced
this issue
Dec 30, 2024
**Background:** When backfilling usage data, the feature usage chart displayed only a few data points, not the complete set. Network inspection revealed that multiple pages of data were successfully retrieved. **Repro:** 1. Navigate to: https://website-webstatus-dev.corp.goog/features/flexbox?showUsageChart **Solution:** This change aligns the feature usage chart pagination with the feature support chart's implementation: https://github.com/GoogleChrome/webstatus.dev/blob/b84a9ac02c2455dd6e5043615fc2a084f6980a46/frontend/src/static/js/components/webstatus-feature-page.ts#L621-L650 **Testing:** Comprehensive unit tests will be included with the refactor outlined in #964. To validate the pagination logic, this commit increases the number of data points displayed to over 100, enabling testing through Playwright. To optimize Playwright test performance, the initial data load specifically filters for the feature used in the feature page test, mitigating delays associated with loading excessive fake data.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per @jcscottiii's comments on #944:
We should leverage generics since this is similar to createFeatureSupportDataFromMap.
A main generic method like:
Then each method could be simplified to something like this:
Also, could you add some unit tests for these two methods during that refactor PR please?
One test should create a component with test support data. Another with test usage data. Each test should call the method and assert things like:
A similar refactoring + unit tests should be done for generateFeatureUsageChartOptions and generateFeatureSupportChartOptions
I think the method signature could be something like:
_startUsageMetricsTask and _startMetricsTask could be refactored.
something like this:
The text was updated successfully, but these errors were encountered: