-
Notifications
You must be signed in to change notification settings - Fork 291
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
Update Selection Panels to be in-view aware #9631
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be removed when #9630 will be merged.
Build files for 0c3c078 are ready:
|
Size Change: +401 B (+0.02%) Total Size: 1.88 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant work on this, @ankitrox, thank you! Please see the following notes:
- In the QAB, it might be worth specifying the following AC:
The flicker that PR #7779 fixed in the Metrics Selection Panel should not return as a result of these changes.
- Additionally, I think it might also be worth doing a
QA:Eng
on this one in addition to general QA to ensure the following AC is met:
An observable result of this is that the panels should not trigger any API requests upon page load, unless the request is explicitly determined to be required.
- I've left a few comments in the code, please take a look, thank you!
Please let me know if you have any questions, thanks!
} ) } | ||
<InViewProvider | ||
value={ { | ||
key: 'WPDashboardApp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key: 'WPDashboardApp', | |
key: 'MetricsSelectionPanel', |
<InViewProvider | ||
value={ { | ||
key: 'AudienceSelectionPanel', | ||
value: isOpen, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be a good idea to enforce a boolean value here, since core/ui
getValue
can return undefined
if it can't find the key?
value: isOpen, | |
value: !! isOpen, |
.dispatch( MODULES_ANALYTICS_4 ) | ||
.receiveError( error, storeFunctionName, args ); | ||
|
||
afterEach( async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand what you're doing here, but this feels quite unorthodox compared to how we usually compose tests, namely:
- We usually do not do assertions in
beforeEach
orafterEach
. - All test cases usually read as natural language, e.g. "it should do something".
Could you possibly enlighten why we can't stick to the previous it.each()
approach which was much cleaner?
describe( 'should display an error message', () => { | ||
const error = { | ||
code: 'test_error', | ||
message: 'Error message.', | ||
data: {}, | ||
}; | ||
|
||
beforeEach( () => { | ||
provideModules( registry ); | ||
provideModuleRegistrations( registry ); | ||
} ); | ||
|
||
afterEach( async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above.
/** | ||
* Selection Panel | ||
* | ||
* Site Kit by Google, Copyright 2023 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nitpicky, but as this is a newer component, should we update the year?
* Site Kit by Google, Copyright 2023 Google LLC | |
* Site Kit by Google, Copyright 2024 Google LLC |
Summary
Addresses issue:
useInViewSelect()
hook where applicable #9312Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist