Skip to content

Conversation

@oliverabrahams
Copy link
Contributor

What does this change?

Include index of product in the Product Button click event in Carousel components by adding this attribute
data-component={at-a-glance-carousel-card-${index}}

Why?

We want to understand the number of users interacting with the cards based on where they appear in the carousel. This PR provides the index within the click event component id.

@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@oliverabrahams oliverabrahams added the feature Departmental tracking: work on a new feature label Jan 20, 2026
@oliverabrahams oliverabrahams self-assigned this Jan 20, 2026
@oliverabrahams oliverabrahams added the run_chromatic Runs chromatic when label is applied label Jan 20, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 20, 2026
product.elementId
}
css={[subgridStyles, leftBorderStyles]}
data-component={`at-a-glance-carousel-card-${index}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the data-component to be at-a-glance-carousel-card-0 for the first card as it is here? Or would it be more readable for non developers looking at the data for it to be at-a-glance-carousel-card-1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yea would be good to align with the stacked cards, are you doing index + 1 there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep stacked cards is doing index + 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants