-
Notifications
You must be signed in to change notification settings - Fork 638
improve banner wrapping #6961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
improve banner wrapping #6961
Conversation
🦋 Changeset detectedLatest commit: 2ea447c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
There was a problem hiding this 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 improves the Banner component's wrapping behavior by implementing content-length-based logic and CSS container queries to better handle action button layout across different screen sizes and content scenarios.
Key changes:
- Added
getContentLength
function to determine wrapping behavior based on content length - Replaced media queries with container queries for more precise responsive control
- Introduced separate wrapping logic for banners with/without titles and dismiss buttons
Reviewed Changes
Copilot reviewed 6 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Banner.tsx | Added getContentLength function and data attribute for content-based wrapping |
Banner.module.css | Replaced media queries with container queries and refined selector specificity |
Banner.features.stories.tsx | Split existing story into short/long variants and added new short content story |
Banner.docs.json | Updated story references to match new story names |
Banner.test.ts | Updated test references and added new test for short content variant |
.changeset/lemon-islands-fold.md | Added changelog entry documenting the wrapping behavior improvements |
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/4190 |
🟢 ci completed with status |
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
Changelog
New
getContentLength
function inBanner.tsx
to help determine when action buttons should wrap in banners without titles or dismiss buttons.WithHiddenTitleAndActionsShort
,WithHiddenTitleAndActionsLong
) to demonstrate and test different wrapping scenarios when titles are hidden or absent.Banner.docs.json
to ensure documentation accurately reflects responsive wrapping behavior.Changed
Banner.module.css
now uses container queries and more targeted selectors to handle wrapping based on presence/absence of titles and dismiss buttons.getContentLength
) for responsive wrapping.Banner.module.css
to use container queries instead of broader media queries.Removed
Banner.module.css
, consolidating layout rules under container query–driven logic.demo
Screen.Recording.2025-10-08.at.1.43.15.PM.mov
Rollout strategy
Testing & Reviewing
Merge checklist