site-kit-wp: Key metrics layout broken at 960px
Bug Description
The key metrics setup CTA has a broken layout between 960-974px
Steps to reproduce
- Use a fresh site
- Go to SK dashboard after connecting GA (with data)
- See KMW setup CTA
- Adjust browser width to 960px up to ~974px
- See below
Note that to reliably reproduce the issue it may be necessary to view the site using a browser with always-visible scrollbars.
If using a Mac, set the system setting “Show scroll bars” to “Always”, and when using Chrome’s responsive devtool view ensure the device type is set to Desktop ensure the scrollbar is present.
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The layout should be adjusted to display as designed across viewports
Implementation Brief
- Provide a version of the
useWindowWidth()hook that usesglobal.innerWidthinstead ofdocument.documentElement.clientWidthto determine the window width. - Replace usage of the currently used hook with the new one throughout the codebase.
- See the PoC PR https://github.com/google/site-kit-wp/pull/9996, with additional details in this comment below: https://github.com/google/site-kit-wp/issues/9911#issuecomment-2580049312.
Test Coverage
- Add test coverage for the new
useWindowWidth()hook. - Fix any failing tests.
QA Brief
- Use a fresh site
- Go to SK dashboard after connecting GA (with data)
- See KMW setup CTA
- Adjust browser width to 960px up to ~974px. The banner should not break in these widths.
Changelog entry
- Fix key metrics setup CTA layout at 960px.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15
QA Update ✅
Was able to simulate it on my Mac OS on Chrome, Chrome emulator and Firefox. After switching to develop branch, the issues are no more.
https://github.com/user-attachments/assets/6ce1b04d-d2ca-440a-a619-2d6888c805a3