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
Inconsistent layout between similar tiles in zero states #7761
Comments
AC ✅ |
IB ✅ |
Hi @10upsimon, apologies as I should have looked more closely at this one while reviewing the IB. Having picked it up for execution, I've realised there's actually quite a bit more to the issue. It appears the IB as specced covers the second AC point, but not the first. What we're trying to achieve here, by way of that first point, is to align the content so it starts at a consistent height regardless of the tile state. This is illustrated in the "Narrow viewport" designs in Figma and there is related discussion on Slack. Narrow viewport design on Figma: Here's how things can look at the moment (artificially expanded to two rows for the sake of illustration): As mentioned on Slack, we need to keep in mind that the title can potentially wrap onto three (or maybe even more) rows, and the idea is for the content to align to the height of the longest (tallest) title. Tracing back through the Slack conversations, we can see that @asvinb and @nfmohit have synced about this, and one potential angle that has been flagged is to try using CSS subgrid. It's clear this issue will be significantly more complicated than the current spec and estimate, so we should move this back to IB and remove it from the current sprint. Would you like to pick this up again to continue working on the IB? I realise you're busy with a design doc so may not have capacity in which case someone else can pick it up. I'm quite interested myself, although it could be a bit of a complex one so I also need to be careful not to overcommit with Audience Segmentation design work underway. Cc @bethanylang |
@asvinb can I grab this IB update? |
Hi @asvinb, nice work so far on the IB, it's an interesting solution, although there are a few unhandled cases which I've noticed. Ideally, it would be nice to be able to modify the markup to avoid the nested subgrids, but realistically I don't see that this is particularly achievable - I think it would be much more complex than the nested solution you've proposed. There are however some scenarios where the POC is not holding up, having applied it locally I've noticed that the CTA banners and error state layouts are now misaligned: It would be worth exploring these further to ensure these cases can be managed with this solution. There are also a couple of grammatical oddities in the way the IB is written, probably just a translation hiccup - I'm talking about the text that I have made bold here:
I think this is what you mean, please correct me if I am wrong:
|
Thanks @techanvil . 👍 for the tweaks to the IB. Agree with the different edge cases. I'll try to replicate and update the IB. |
@techanvil Gist updated. Please note that the gist is mostly showing that it should be possible to align the items using subgrid and the approach to take. There is also a note that the estimate is quite big even though we have a "working" POC because we need to cater for all the different scenarios. I agree with you, there are things which can be fixed during implementation now that the approach looks good. |
Great, thanks @asvinb. All makes sense. IB LGTM, great work! ✅ |
QA Update
|
Hey @mohitwp, I saw this and mentioned it in the PR with some possible ways to make this gap smaller but this was beyond the original IB. I'll discuss with the team today as to whether this new gap is acceptable or if we want to do additional refactoring to reduce the gap and update here with the outcome of that discussion. |
QA Update ✅
|
Feature Description
As reported by @aaemnnosttv in Bug Bash (Asana task):
Ideally the areas of the tile would be aligned across tiles regardless of the length of the titles or other elements
Also
Text should be aligned to bottom to address.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/sass/components/key-metrics/_googlesitekit-km-widget-tile.scss
:height
of.googlesitekit-km-widget-tile--error
to100%
.The suggested solution is to use CSS subgrid (supported by all major browsers. https://caniuse.com/?search=subgrid). However it is not so straightforward since the elements we need to align are deeply nested relative to the parent container for all the key metric widgets which is 4 levels down. So we need to have nested subgrids. The code should do the following:
.googlesitekit-widget-area--mainDashboardKeyMetricsPrimary .googlesitekit-widget-area-widgets .mdc-layout-grid__inner
element.auto 1fr auto 1fr
)auto 1fr
)..googlesitekit-km-widget-tile__title-container
.googlesitekit-km-widget-tile__body
.mdc-layout-grid__inner
) as follows:grid-template-columns: subgrid;
grid-template-rows: subgrid;
grid-column: 1 / -1;
grid-row: 1 / -1;
SASS POC lines to be added to
assets/sass/components/key-metrics/_googlesitekit-km-widget-tile.scss
:https://gist.github.com/asvinb/c9334396216a4b0063ca277b912c2853
Bumped the estimate to polish the POC add enough time to QA all the possible scenarios across breakpoints.
Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: