-
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
Create ChipTabGroup
component
#9378
Comments
ChipTabGroup
component
@zutigrm, could you please remove all technical details from AC and leave only requirements that the new component should match. |
@eugene-manuilov AC updated. Thanks |
Great! Thanks, @zutigrm. AC ✔️ |
Thanks, @zutigrm. Mostly looks good, but let's rename Also, the estimate seems to be very high, can you break down the estimate in a comment to have each component an estimate? Something like this:
|
Updated, thanks.
|
Thanks, @zutigrm. IB looks good and |
QA Update ⚠Tested this in storybook and here are my observations: ITEM 1: ITEM 2: ITEM 3: ITEM 4: ITEM 5: ITEM 6:
Current Selection > Content Performance appear on 3 lines:
![Image](https://github.com/user-attachments/assets/32bf57e2-2f86-4e74-b2f1-2e1ed4bcb13b)
ITEM 7: ITEM 8: ITEM 9: On mobile, the groups should be aligned to start on the same line as the top text. ITEM 10: Nothing wrong with that but the position looks weird. It sits just below the different items and when you change groups, it moves around. I think it's a better experience if it sits on top of the bottom section. 9378metric.jumping.movITEM 11: Font weight for 'Settings' is currently 600 but based on figma, it's 400. |
Hi @kelvinballoo thanks for your observations,
This will be implemented in the separate ticket that is already planned for new badge and dots
This is code related, nothing visual yet
We do not expect to be in the same order, they will be computed and listed in the code with same priority. Items 4-11, and 'Top earning content' this will be finalised in the current issue I am working on #9385 which extends this ticket and replaces the selection panel which will be available for proper testing directly from the dashboard (except for new badge and dots which will be done in #9386). CUrrent issue is more about |
QA Update ✅Thanks @zutigrm , since all the required issues will be fixed under #9385, I will verify those there. As for this ticket, verifying the storybook, the following were concluded per the QAB:
Moving ticket to approval. |
Feature Description
New
ChipTabGroup
component should be implemented, to support the selection panel layout updates. Said component should handle group switching, and styles, but it will not contain the implementation of full metrics selection and lists. That will be handled in separate issue.As part of this issue
assets/js/components/SelectionPanel/SelectionPanelItems.js
should be used as a starting point for creating a key metrics specificSelectionPanelItems
which will be rendering theChipTabGroup
component instead of the current markdown. A new story for the saidSelectionPanelItems
should be added, to visually test and develop new component. It shouldn't replace the usage of genericSelectionPanelItems
in this issue.Basic group filtering should be implemented as part of this issue
Check New Metric Grouping Logic Within Sidebar/Selection Panel - Tabbed Functionality section and more particularly
Implementation of tabbed containers and tab functionality
sub-section of the design docDo not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
ChipTabGroup
component is createdCurrent selection
group chip will be listing the selected items, functionality will be expanded on in 9385 , so for now it can display an empty list.SelectionPanelItems
component is also added to render theChipTabGroup
componentImplementation of tabbed containers and tab functionality
sub-section of the design docChipTabGroup
component within new key metrics specific selection panel items is added, together with the stories, excluding "new" badge implementation. It should support group chip switching only (filtering all KMW items by the active group), rest of the functionality, and implementation of new panel will come in later issueImplementation Brief
Add
assets/js/components/KeyMetrics/ChipTabGroup/Chip.js
slug
andlabel
, which will be extracted from the group object -{SLUG: '...', LABEL: '...'}
isActive
, a boolean valueselectedCount
, number of selected metric items from the current group, if any.onClick
, a callback function. It should accept group slug as an argument, so it can switch the active group in the parent's component stateButton
component with classgooglesitekit-chip-tab-group__chip-item
for examplelabel
prop for label.selectedCount
value astrailingIcon
prop. You can wrap it inspan
and pass the value within parentheses()
onClick
prop, pass theonClick
callback prop, including theslug
prop as an argumentisActive
prop matches the currentslug
, render an extra class in the button, for examplegooglesitekit-chip-tab-group__chip-item--active
assets/sass/components/key-metrics/_googlesitekit-chip-tab-group.scss
to include needed styling for bothChip
andTabGroup
componentsAdd
assets/js/components/KeyMetrics/ChipTabGroup/TabGroup.js
metricItems
- an array of metric item objects to render. This component is not concerned with filtering, and active group selection logic, it will only receive final list that should be output.div.googlesitekit-chip-tab-group__tab-item
for examplemetricItems
and renderMetricItem
component for each item, passing the needed propsAdd
assets/js/components/KeyMetrics/ChipTabGroup/index.js
allMetricItems
- will hold the array of metric objects retrieved fromKEY_METRICS_WIDGETS
listCurrent selection
, following the same structure how other existing groups are defined, for example{SLUG: 'currentSelection', LABEL: 'Current selection'}
isActive
value will be passed to theChip
component. By defaultCurrent selection
slug should be used as initial value.Chip
component asonClick
prop. It should accept a group slug as argument and update the localisActive
stateallMetricItems
prop by thegroup
property, only the items which fulfil this criteriaitem.group === isActive
should be returned, and assigned to a new variable, sayactiveMetricItems
activeMetricItems
will be passed to theTabGroup
component as themetricItems
propselectedCount
variable, for now assign it value0
- this functionality will be implemented as part of the 9385div
with classgooglesitekit-chip-tab-group
for exampleCurrent selection
being the first item in the array, and other groups should follow the order from the design.Chip
component for each item, using the current group asgroup
prop, and other props previously defined aboveAdd
assets/js/components/KeyMetrics/MetricsSelectionPanel/SelectionPanelItems.js
assets/js/components/SelectionPanel/SelectionPanelItems.js
as a starting pointChipTabGroup
component instead of the current markup.KEY_METRICS_WIDGETS
for theallMetricItems
propTest Coverage
assets/js/components/SelectionPanel/SelectionPanelItems.js
component, which should render the new selection panel layoutQA Brief
?path=/story/key-metrics-chiptabgroup--default
Current selection
is not implemented in this issue, it will not show selection. Note that currently it will show graphic that is going to be shown and used in full screen variation that will be implemented in different issue.Changelog entry
The text was updated successfully, but these errors were encountered: