-
Notifications
You must be signed in to change notification settings - Fork 295
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
Make "New" metric badge layout more consistent between Data Blocks and Report Tables. #7001
Comments
@techanvil thanks for raising this! definitely makes sense to fix this so it aligns with how the new badges are displayed on the main dashboard. +1 on following the design from the main dashboard. |
@techanvil Seems good, but is there any reason not to have the "should fit badge"/ If we need it not to break other |
Hey @tofumatt, maybe I wasn't clear enough in the IB - the I've updated the IB to specify that |
@techanvil Ah, yes, I did understand that, but I'm wondering why we can't have that styling/behaviour always be present for the |
Hey @tofumatt, thanks for clarifying. It's a good suggestion, I've looked into it and have determined it is possible to do this in a way that avoids the conditional styling, we just need to pass in a prop to tell the component it should render a hidden badge to allow it to match the with-badge layout. I've updated the IB and PoC, please see what you think. |
@techanvil I think this is better, but I still wonder about needing to pass the boolean at all. Is it possible to use the "with-badge" layout all of the time and render a hidden badge when a component isn't passed? I'd just love it if we didn't need to pass that prop unless we are actually sending it our own badge 🤔 |
The problem with this is we don't always want to show an empty space above the title where a badge would be. We only want to do so for Data Blocks which are displayed next to ones with a badge, which means those in the GA4 Search Traffic and Overall Page Metrics widgets; the An additional point to consider is the "New" badges will be removed in time, but we may yet find other cases where a badge would be useful, it generally seems quite a good idea to have a flexible component in this regard. But really this is a bit of a moot point as, AFAICT, the fact we use |
QA Update:
|
Hi @wpdarren, thanks for raising this, it's a good question. The design choices here stem from the first issue where we moved the "New" badges above the titles in the Top Content widget (or, in more generic terms, the Reviewing that issue, #6904, the AC specified that the positioning should follow this design in Figma, with the "New" badges right-aligned to match the titles. Realising that the "New" button placement now looked inconsistent for the other widgets (the badge still flowing to the right of the titles), we created this issue to bring the remaining widgets in line with the Top Content widget (again in more generic terms this meant updating the However, when looking at the title alignment in these widgets, it's not right-aligned like the Top Content widget, rather the Search Funnel widget has centre-aligned titles and the Overall Page Metrics widget has left-aligned. Clearly right-aligning the badges won't look good here, so we've followed the principle taken for the Top Content widget to align the badges with their titles. Personally I think this is the right approach stylistically as I don't think a centre-aligned badge will look so good with a left or right-aligned title below it. However if you want we can double check this with Mariya or Sigal. What do you think? |
@techanvil I am happy to go with what you have said. Will get this into approval. |
QA Update: ✅Verified:
Side note: I did notice a few styling issues on mobile, which initially I thought were related to the badge, but I have been able to recreate them in a previous version of Site Kit, so will submit a ticket for them. |
As @wpdarren has spotted a regression caused by this issue I'm moving it back to Execution for a fix.
|
QA Update: ✅Verified:
|
LGTM 👍 |
Feature Description
Since the implementation of #6904, the "New" badges in Report Tables display above the metric titles. However, the badges in Data Blocks still display beside/below the titles, which is a bit inconsistent, particularly so at narrower viewport sizes. This is most evident on the Entity Dashboard. To illustrate:
The new Report Table layout:
The Data Block layout:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Within
assets/js/components/DataBlock/index.js
:badge
prop to accept a boolean or React node. If the valuetrue
is passed, render a hiddenBadge
in order to allow the layout to align with a badge-containing Data Block.badge
above the renderedtitle
.Within
assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/Overview/index.js
andassets/js/modules/analytics/components/dashboard/DashboardOverallPageMetricsWidgetGA4.js
:true
for thebadge
prop to theDataBlock
components which don't have a "New" badge.Make additional DOM and CSS changes as necessary to bring the with-badge layout more in line with Report Tables as per the AC. Note, though, that due to the way Data Blocks are designed, it doesn't make sense to try to right-align the badges/titles, rather they should be left or center-aligned (for the default vs "button" case) as per the existing design.
Finish off this PR: #7008
Test Coverage
QA Brief
ga4Reporting
feature flag is enabled.QA Update
Changelog entry
The text was updated successfully, but these errors were encountered: