Skip to content

feat: Add data component attributes - Phase 4: Buttons and Links#4181

Merged
Gert-Jan Vercauteren (gert-janvercauteren) merged 7 commits intomainfrom
feat/data-component-attr-phase-4
Feb 2, 2026
Merged

feat: Add data component attributes - Phase 4: Buttons and Links#4181
Gert-Jan Vercauteren (gert-janvercauteren) merged 7 commits intomainfrom
feat/data-component-attr-phase-4

Conversation

@gert-janvercauteren
Copy link
Copy Markdown
Contributor

Summary

Adds data-backpack-ds-component attributes to Buttons and Links

Phase 4 of 11

Interactive button and link elements

Related

  • Part of data-component-attr initiative
  • Depends on: Phase 1 (Foundation)
  • Original PR: feat/data-ds-tag

Type of Change

  • New feature

Testing

  • Tests updated
  • Snapshots updated

Checklist

  • Changes follow the code style of this project
  • No TypeScript errors
  • No breaking changes

Phase 4/11 of data-backpack-ds-component migration

This phase adds data-backpack-ds-component attributes to buttons and links components.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds data-backpack-ds-component attributes to button and link components as part of Phase 4 of the data component attributes initiative. This enables better component identification and tracking across the design system.

Changes:

  • Added data-backpack-ds-component attributes to all button and link components
  • Updated test snapshots to reflect the new data attributes
  • Imported getDataComponentAttribute utility across affected components

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/bpk-component-button/src/BpkButtonV2/BpkButton.tsx Added data attribute to button and anchor elements
packages/bpk-component-link/src/BpkLink.tsx Added data attribute to link component
packages/bpk-component-link/src/BpkButtonLink.tsx Added data attribute to button link component
packages/bpk-component-loading-button/src/BpkLoadingButton.tsx Added data attribute to loading button component
packages/bpk-component-card-button/src/BpkSaveButton.tsx Added data attribute to save button component
packages/bpk-component-swap-button/src/BpkSwapButton.tsx Added data attribute to swap button container
packages/bpk-component-rtl-toggle/src/BpkRtlToggle.tsx Added data attribute to RTL toggle component
packages/bpk-component-theme-toggle/src/BpkThemeToggle.tsx Added data attribute to theme toggle container
packages/bpk-component-button/src/BpkButtonV2/snapshots/BpkButton-test.tsx.snap Updated snapshots with new data attributes
packages/bpk-component-link/src/snapshots/BpkButtonLink-test.tsx.snap Updated snapshots with new data attributes
packages/bpk-component-loading-button/src/snapshots/BpkLoadingButton-test.tsx.snap Updated snapshots with new data attributes
packages/bpk-component-card-button/src/snapshots/BpkSaveButton-test.tsx.snap Updated snapshots with new data attributes
packages/bpk-component-swap-button/src/snapshots/BpkSwapButton-test.tsx.snap Updated snapshots with new data attributes
packages/bpk-component-rtl-toggle/src/snapshots/BpkRtlToggle-test.tsx.snap Updated snapshots with new data attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/bpk-component-loading-button/src/BpkLoadingButton.tsx Outdated
Comment thread packages/bpk-component-button/src/BpkButtonV2/BpkButton.tsx Outdated
Comment thread packages/bpk-component-loading-button/src/BpkLoadingButton.tsx Outdated
Comment thread packages/bpk-component-rtl-toggle/src/BpkRtlToggle.tsx
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4181 to see this build running in a browser.

* main:
  [IRN-6174] [BpkCardList] - Child components all same height (#4143)
  feat: Add data component attributes - Phase 1: Foundation (#4178)
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4181 to see this build running in a browser.

@skyscanner-backpack-bot
Copy link
Copy Markdown

skyscanner-backpack-bot Bot commented Jan 30, 2026

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against 9c3cad2

@gert-janvercauteren
Copy link
Copy Markdown
Contributor Author

Copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 30, 2026

Gert-Jan Vercauteren (@gert-janvercauteren) I've opened a new pull request, #4194, to work on those changes. Once the pull request is ready, I'll request review from you.

…orrections (#4194)

* Initial plan

* fix: Remove extra spaces in import statements (BpkButton, BpkRtlToggle)

Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com>

* fix: Remove extra space and trailing whitespace in BpkLoadingButton.tsx

* fix: Remove extra space and trailing whitespace in BpkLoadingButton.tsx

Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com>

* chore: Add .copilot-progress to .gitignore

Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com>

* Update BpkRtlToggle.tsx

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com>
Co-authored-by: Gert-Jan Vercauteren <gert-jan.vercauteren@skyscanner.net>
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4181 to see this build running in a browser.

type={submit ? 'submit' : 'button'}
disabled={disabled}
className={classNames}
className={classNames} {...getDataComponentAttribute('Button')}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could Copilot help to split the lines?

disabled={showBtnDisabled}
size={large ? SIZE_TYPES.large : SIZE_TYPES.small}
type={type}
{...getDataComponentAttribute('LoadingButton')}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I’ve noticed there's an inconsistent indentation. It’s making me wonder if our linter is thorough enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not, working on it :[

Move getDataComponentAttribute spread to its own line for better
readability in multi-line prop lists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4181 to see this build running in a browser.

Copy link
Copy Markdown
Contributor

@IrinaWei IrinaWei left a comment

Choose a reason for hiding this comment

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

LGTM

@gert-janvercauteren Gert-Jan Vercauteren (gert-janvercauteren) merged commit 34b6146 into main Feb 2, 2026
12 checks passed
@gert-janvercauteren Gert-Jan Vercauteren (gert-janvercauteren) deleted the feat/data-component-attr-phase-4 branch February 2, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants