Skip to content

[BpkScrollableCalendarGridList][BpkCalendarDate] Add minScrollable and isAnnotated props#4774

Open
Jan Bock (jan-bock) wants to merge 9 commits into
mainfrom
GOOSE-925-multicity-datetrail-refactor
Open

[BpkScrollableCalendarGridList][BpkCalendarDate] Add minScrollable and isAnnotated props#4774
Jan Bock (jan-bock) wants to merge 9 commits into
mainfrom
GOOSE-925-multicity-datetrail-refactor

Conversation

@jan-bock

@jan-bock Jan Bock (jan-bock) commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds `minScrollable?: Date` to `BpkScrollableCalendarGridList` — when set to a date earlier than `minDate`, extends the scrollable/rendered month range back to that date while `minDate` continues to flow through to each grid as the selection/blocking boundary unchanged; `initialScrollOffset` remains relative to `minDate` so the calendar opens at the selected date
  • Adds `isAnnotated?: boolean` to `BpkCalendarDate` — when `true`, applies an inset accent-colour ring (`box-shadow: 0 0 0 2px $bpk-core-accent-day inset`) suppressed on all selection states (`--selected`, `--start`, `--end`, `--single`, `--sameDay`); defaults to `false`
  • Both props are optional and backwards compatible — omitting them produces identical behaviour to before

Context

FSC (global-components) uses these components in a multi-city date picker where the scroll window must extend earlier than the selectable minimum (to show dates from other legs) and individual dates need a visual indicator. Previously FSC worked around the missing props by passing a modified `minDate` and re-blocking dates in a wrapper, and applying local SCSS via `className`. This PR moves both hacks into Backpack as first-class props.

Test plan

  • New test in `BpkScrollableCalendarGridList-test.tsx` asserts that with `minScrollable` earlier than `minDate`, buttons before `minDate` are disabled
  • New snapshot test in `BpkCalendarDate-test.tsx` asserts `isAnnotated` adds the `bpk-calendar-date--annotated` class
  • New test asserts the class is absent by default
  • All 1705 existing tests pass, 1 new snapshot written

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 30, 2026 13:04
…d isAnnotated props

Adds minScrollable?: Date to BpkScrollableCalendarGridList so consumers
can extend the scrollable render range earlier than minDate without
affecting the selection/blocking boundary — removes the need for FSC to
hack minDate and re-block dates in a wrapper.

Adds isAnnotated?: boolean to BpkCalendarDate which applies an inset
ring box-shadow (accent colour) when true — removes the need for FSC to
apply local SCSS via className for multi-city leg date indicators.

Both props are optional and default to existing behaviour.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jan-bock Jan Bock (jan-bock) force-pushed the GOOSE-925-multicity-datetrail-refactor branch from a7985fe to e49a7c4 Compare June 30, 2026 13:20
@jan-bock Jan Bock (jan-bock) added minor Non breaking change ai: claude labels Jun 30, 2026
@jan-bock Jan Bock (jan-bock) self-assigned this Jun 30, 2026

Copilot AI left a comment

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.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds new optional props to extend scroll range in the scrollable calendar and to visually annotate individual dates, enabling FSC’s multi-city date picker use-cases without wrappers/overrides.

Changes:

  • Add minScrollable?: Date to extend the rendered month range earlier than minDate while keeping minDate as the blocking boundary.
  • Add isAnnotated?: boolean to BpkCalendarDate with a new --annotated style and corresponding tests/snapshots.

Reviewed changes

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

Show a summary per file
File Description
packages/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.tsx Adds minScrollable and adjusts the computed start month anchor.
packages/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList-test.tsx Adds a test intended to validate minScrollable behavior.
packages/bpk-component-calendar/src/BpkCalendarDate.tsx Adds isAnnotated prop and applies bpk-calendar-date--annotated class.
packages/bpk-component-calendar/src/BpkCalendarDate.module.scss Adds annotated ring styling suppressed for --selected.
packages/bpk-component-calendar/src/snapshots/BpkCalendarDate-test.tsx.snap Updates snapshots for the new annotated variant.
packages/bpk-component-calendar/src/BpkCalendarDate-test.tsx Adds tests for annotated class presence/absence.

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

Comment thread packages/bpk-component-calendar/src/BpkCalendarDate.module.scss Outdated
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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

@skyscanner-backpack-bot

skyscanner-backpack-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Browser support

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

Generated by 🚫 dangerJS against 1451634

- Use startDate (derived from scrollAnchor) instead of minDate in the
  months useMemo dependency array so the list recomputes when minScrollable
  changes independently of minDate
- Extend --annotated :not() selector to suppress the inset ring on all
  filled selection states (--start, --end, --single, --sameDay) not just
  --selected

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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

Jan Bock (jan-bock) and others added 2 commits June 30, 2026 15:49
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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

Jan Bock (jan-bock) and others added 3 commits June 30, 2026 16:17
…enders

CalendarContainer passes props through to BpkCalendar which hardcodes
DateComponent in composeCalendar — the custom component was never
reaching the grid. Use withCalendarState + composeCalendar directly.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Use dynamic dates relative to today so the calendar opens on the
  current month (not Apr 2020 which is in the past)
- Pass preventKeyboardFocus to suppress the --focused inset ring
  which was visually indistinct from --annotated in the demo

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4774 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

ai: claude minor Non breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants