Skip to content

[CLOV-1303] [BpkThinking]: add bpk-thinking#4229

Open
IrinaWei wants to merge 7 commits intomainfrom
bpk-thinkign
Open

[CLOV-1303] [BpkThinking]: add bpk-thinking#4229
IrinaWei wants to merge 7 commits intomainfrom
bpk-thinkign

Conversation

@IrinaWei
Copy link
Contributor

@IrinaWei IrinaWei commented Feb 12, 2026

Migrate from Carhire-homepage: https://github.com/Skyscanner/carhire-homepage/tree/main/libs/cars-results/features/src/unstable_backpack/Thinking
Tested locally in carhire:
image

Remember to include the following changes:

  • Ensure the PR title includes the name of the component you are changing so it's clear in the release notes for consumers of the changes in the version e.g [Clover-123][BpkButton] Updating the colour
  • README.md (If you have created a new component)
  • Component README.md
  • Tests
  • Accessibility tests
    • The following checks were performed:
      • Ability to navigate using a keyboard only
      • Zoom functionality (Deque University explanation):
        • The page SHOULD be functional AND readable when only the text is magnified to 200% of its initial size
        • Pages must reflow as zoom increases up to 400% so that content continues to be presented in only one column i.e. Content MUST NOT require scrolling in two directions (both vertically and horizontally)
      • Ability to navigate using a screen reader only
  • Storybook examples created/updated
  • For breaking changes or deprecating components/properties, migration guides added to the description of the PR. If the guide has large changes, consider creating a new Markdown page inside the component's docs folder and link it here

Copilot AI review requested due to automatic review settings February 12, 2026 06:51
@IrinaWei IrinaWei added the minor Non breaking change label Feb 12, 2026
Copy link
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

This PR adds a new BpkThinking component to the Backpack design system, migrated from the carhire-homepage repository. The component displays an animated thinking indicator with bouncing dots and a speech bubble, designed to provide visual feedback during AI or processing operations.

Changes:

  • Introduces a new bpk-component-thinking package with TypeScript component, SCSS styles, comprehensive tests, and accessibility features
  • Adds Storybook examples demonstrating various use cases including default, custom content, and long content scenarios
  • Includes comprehensive documentation covering usage, accessibility guidelines, and animation details

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/bpk-component-thinking/src/BpkThinking.tsx Main component implementation with required accessibility label and optional custom content
packages/bpk-component-thinking/src/BpkThinking.module.scss Styles with animations, RTL support, and reduced motion preferences
packages/bpk-component-thinking/src/BpkThinking-test.tsx Unit tests covering props, rendering, and accessibility features
packages/bpk-component-thinking/src/accessibility-test.tsx Automated accessibility tests using jest-axe
packages/bpk-component-thinking/index.ts Package exports for component and types
packages/bpk-component-thinking/README.md Complete documentation with usage examples and accessibility guidelines
examples/bpk-component-thinking/stories.tsx Storybook configuration with visual test variants
examples/bpk-component-thinking/examples.tsx Example implementations demonstrating different use cases
examples/bpk-component-thinking/examples.module.scss Styling for example layouts
MIGRATION_SUMMARY.md Detailed migration documentation covering transformations and compliance

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


- Spacing: `bpk-spacing-base()`, `bpk-spacing-md()`, `bpk-spacing-xxl()`
- Colors: `$bpk-surface-contrast-day`, `$bpk-text-on-dark-day`
- Border radius: `$bpk-border-radius-lg`, `$bpk-border-radius-xs`, `$bpk-border-radius-pill`
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The documentation lists $bpk-border-radius-pill as a used design token, but this token does not appear in the SCSS file. Only $bpk-border-radius-lg and $bpk-border-radius-xs are actually used in the styles.

Suggested change
- Border radius: `$bpk-border-radius-lg`, `$bpk-border-radius-xs`, `$bpk-border-radius-pill`
- Border radius: `$bpk-border-radius-lg`, `$bpk-border-radius-xs`

Copilot uses AI. Check for mistakes.
Comment on lines 161 to 170
### Component Files (7 files):
1. `packages/bpk-component-thinking/index.ts`
2. `packages/bpk-component-thinking/README.md`
3. `packages/bpk-component-thinking/src/BpkThinking.tsx`
4. `packages/bpk-component-thinking/src/BpkThinking.module.scss`
5. `packages/bpk-component-thinking/src/BpkThinking-test.tsx`
6. `packages/bpk-component-thinking/src/accessibility-test.tsx`
7. `examples/bpk-component-thinking/examples.tsx`
8. `examples/bpk-component-thinking/examples.module.scss`
9. `examples/bpk-component-thinking/stories.tsx`
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The heading states "7 files" but lists 9 files. Update the heading to "Component Files (9 files):" to match the actual count.

Copilot uses AI. Check for mistakes.
@skyscanner-backpack-bot
Copy link

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

@skyscanner-backpack-bot
Copy link

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

IrinaWei and others added 3 commits February 12, 2026 15:57
This file is a build artifact and should not have been modified.
Restored to match main branch version.

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

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

@skyscanner-backpack-bot
Copy link

skyscanner-backpack-bot bot commented Feb 12, 2026

Browser support

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

Generated by 🚫 dangerJS against 21b1632

// OnDark variant: uses Night Sky blue (#054184) on dark backgrounds
&--on-dark {
.bpk-thinking__dots--dot {
background-color: tokens.$bpk-private-chip-on-dark-on-background-night;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should not use private color here

@skyscanner-backpack-bot
Copy link

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

* The accessibility label for the thinking component.
* This is required for screen reader support.
*/
accessibilityLabel: string;

Choose a reason for hiding this comment

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

Can we make content required and have no default value? Then we can remove the a11yLabel. IrinaWei

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

Labels

minor Non breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants