Skip to content

[BpkFloatingNotification] [ISO-1654] Add critical floating notification type#4323

Open
Copilot wants to merge 11 commits intomainfrom
copilot/add-critical-type-floating-notification
Open

[BpkFloatingNotification] [ISO-1654] Add critical floating notification type#4323
Copilot wants to merge 11 commits intomainfrom
copilot/add-critical-type-floating-notification

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

  • Remove $bpk-critical-background-day: #e70866; local variable from BpkFloatingNotification.module.scss
  • Replace background-color: $bpk-critical-background-day with background-color: tokens.$bpk-status-danger-spot-day in the &--critical block (uses a proper semantic status token rather than a cross-component private token, to avoid unpredictable theming)
  • Add CriticalWithIcon Storybook example (critical notification with icon)
  • Add CriticalWithCta Storybook example (critical notification with CTA)
  • All 13 tests pass

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

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

skyscanner-backpack-bot bot commented Mar 25, 2026

Browser support

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

Generated by 🚫 dangerJS against 02dc863

@mariia-shyn mariia-shyn changed the title [BpkFloatingNotification] Add critical type [BpkFloatingNotification] [ISO-1654] Add critical floating notification type Mar 25, 2026
…er-error-day

Co-authored-by: mariia-shyn <206853533+mariia-shyn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Skyscanner/backpack/sessions/8ecf1b22-dd87-4bbf-a8a5-6176ca2ba3d6
}

&--critical {
background-color: tokens.$bpk-private-info-banner-error-day;
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.

We should not use a component token from another component. When we do this it will make theming unpredictable.

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.

Copilot please use $bpk-status-danger-spot-day for the background color.

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.

Updated in b09f27b to use tokens.$bpk-status-danger-spot-day — a proper semantic status token rather than the cross-component private token.

Co-authored-by: gert-janvercauteren <728889+gert-janvercauteren@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Skyscanner/backpack/sessions/b87498a9-d2e1-4a93-bcb7-7fd55fb89daa
@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@mariia-shyn
Copy link
Copy Markdown

Copilot add 2 more examples: critical with icon and critical with cta

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

Copilot add 2 more examples: critical with icon and critical with cta

Added in e3cf115CriticalWithIcon and CriticalWithCta story examples are now exported from stories.tsx.

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@mariia-shyn mariia-shyn marked this pull request as ready for review March 27, 2026 12:40
Copilot AI review requested due to automatic review settings March 27, 2026 12:40
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 a new “critical” variant to BpkFloatingNotification, enabling consumers to render a more urgent-looking floating notification using a semantic status token.

Changes:

  • Introduced NOTIFICATION_TYPES and a new type prop (default/critical) to apply a critical modifier class.
  • Added --critical styling using tokens.$bpk-status-danger-spot-day and updated snapshots/tests accordingly.
  • Added README usage plus new Storybook examples for critical (base, with icon, with CTA).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/bpk-component-floating-notification/src/BpkFloatingNotification.tsx Adds NOTIFICATION_TYPES + type prop and applies the critical modifier class.
packages/bpk-component-floating-notification/src/BpkFloatingNotification.module.scss Adds &--critical styling using semantic danger token.
packages/bpk-component-floating-notification/src/BpkFloatingNotification-test.tsx Adds snapshot coverage for the critical type.
packages/bpk-component-floating-notification/src/snapshots/BpkFloatingNotification-test.tsx.snap Stores new snapshot output for the critical type.
packages/bpk-component-floating-notification/index.ts Re-exports NOTIFICATION_TYPES from the package entrypoint.
packages/bpk-component-floating-notification/README.md Documents how to use the new critical type.
examples/bpk-component-floating-notification/examples.tsx Adds critical examples (base, with icon, with CTA).
examples/bpk-component-floating-notification/stories.tsx Exposes the new critical examples in Storybook.

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


import BpkIconHeart from '../../bpk-component-icon/sm/heart';

import BpkFloatingNotification from './BpkFloatingNotification';
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 you help add an accessibility test for rendering critical style in packages/bpk-component-floating-notification/src/accessibility-test.tsx

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

considering a critical notification may need interrupt, should we use assertive aria-live for BpkAriaLive when NOTIFICATION_TYPES.critical ? As-is, screen-reader users receive the same deferred announcement for critical and default variants.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

<BpkAriaLive
aria-hidden
politenessSetting={
type === NOTIFICATION_TYPES.critical ? 'assertive' : 'polite'
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 supposed we could use POLITENESS_SETTINGS.assertive and POLITENESS_SETTINGS.polite here rather than hardcode

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

import { CSSTransition } from 'react-transition-group';

import BpkAriaLive from '../../bpk-component-aria-live';
import { POLITENESS_SETTINGS } from '../../bpk-component-aria-live/src/BpkAriaLive';
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.

Suggested change
import { POLITENESS_SETTINGS } from '../../bpk-component-aria-live/src/BpkAriaLive';
import BpkAriaLive, { POLITENESS_SETTINGS } from '../../bpk-component-aria-live';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have this error when trying to import POLITENESS_SETTINGS.
Screenshot 2026-04-01 at 11 56 25

should I use ARIA_LIVE_POLITENESS_SETTINGS?

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.

Aha, sorry for the mistake, yes, you can use ARIA_LIVE_POLITENESS_SETTINGS

@skyscanner-backpack-bot
Copy link
Copy Markdown

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

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.

5 participants