Closed techanvil closed 5 months ago
@techanvil the change here looks rather small but looks like there is definitely room for improvement at this viewport in general. Any ideas how we could better adapt this to smaller viewports?
Hey @aaemnnosttv, having dug into this a bit, I think the most appropriate fix would be to slightly reduce the width of the Title column (currently 50%) to allow more space for the metric columns. It would need to be reduced to about 44% and this could be applied only at the tablet viewport of 601-960px (or across all viewports for simplicity/consistency's sake).
Title column width 44%, viewport width 601px:
We could apply CSS overflow and ellipses rules, and add a tooltip to the headers. The obvious disadvantage being the text is no longer fully visible and the user would need to interact with the tooltip to read it.
We could arguably reduce the font, but this also seems a bit of an excessive fix.
Font reduced to 12px:
I did spend some time looking into hyphenation of the word "pageviews" as an option, and had initially thought to suggest this as the proposed fix, but having slept on it I have realised that it's not such a great idea as it would mean compromising the current view by hyphenating "pageviews" over a relatively wide range of viewports (from 601px up to 827px in my testing) for the sake of fixing a mild overlap problem that occurs at a narrower range of viewports (the existing overlap occurs between 601px and ~660px).
I'll leave my findings on hyphenation here for the sake of completion:
The approach I was considering is to allow the word "pageviews" to be hyphenated to avoid the overflow.
I can see that we have applied CSS hyphenation to the table headers as a general fix to avoid overflowing - as seen here in commit https://github.com/google/site-kit-wp/pull/749/commits/ac63a441cafa554fea3663f5646db02521e53e12.
Looking at the table in other languages it can be seen in action, for example here in German:
Note the overflow having unticked the hyphen: auto
rule in devtools:
The problem with the English version is that "pageviews" is not a standard word and the browser doesn't know how to hyphenate it.
The approach I was therefore considering is to let the browser know that "pageviews" can be hyphenated by inserting a soft hyphen into the word, i.e. 'Page\u00ADviews'
. We could create a utility function to keep the code clean and reusable rather than inlining this funky string. It works as expected - and should gracefully degrade where not supported.
At 601px:
When the screen is wide enough (827px in this case):
Interested to hear your thoughts!
Thanks @techanvil! I had no idea soft hyphens were a thing!
I feel like the problem is rooted in showing more than 2 columns in a relatively small space. That is, if it were just Title and one more metric, it would be fine but we're cramming in a few and the column headings are hard to fit well, especially when you start considering i18n.
I'd be interested to see how feasible it would be to use icons to represent the headings (other than Title). E.g.
These are just ideas from the icon set but then we could also keep the current names as tooltips for accessibility and clarity as to what it means.
@sebastianmantel any suggestions for what we could do here?
@aaemnnosttv we can change the font style of those parameters to 12px [body-small] and that will fix the issue. WDYT?
Closing as this is covered by the more recent #7563, although the findings of this issue will still be relevant.
Bug Description
On the "Top content..." widget, the Pageviews and Unique Pageviews table headers overlap at a 601px wide viewport.
Steps to reproduce
Screenshots
Version 1.79.0 RC1:
Notice how the overlap has increased slightly compared to the pre-GM2+ styling.
Version 1.78.0:
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Test Coverage
QA Brief
Changelog entry