refactor(fuselage): SidebarV2Banner divider, elevated surface & flexible layout#2079
Open
ggazzo wants to merge 4 commits into
Open
refactor(fuselage): SidebarV2Banner divider, elevated surface & flexible layout#2079ggazzo wants to merge 4 commits into
ggazzo wants to merge 4 commits into
Conversation
Remove the built-in border-bottom from SidebarV2Banner so consumers place a SidebarV2Divider explicitly where a separator is wanted. Update the sidebar story to show the explicit divider. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: fd14433 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Change the default variant background from surface(sidebar) to surface(tint) so the banner is visually distinct from the sidebar instead of blending in, matching the legacy Sidebar banner's elevated surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- content column grows to full width so children span the banner
- render addon/close column only when addon or onClose is provided
- add closePlacement prop ('center' | 'top') to align the close button
with the banner header
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ull-width In closePlacement='top' mode, position the addon/close column absolutely (top-right) instead of as a flex column, so the content spans the full banner width below the header. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Several improvements to
SidebarV2Banner, driven by reusing it for a persistent media player in Rocket.Chat.1. Explicit divider
The component hard-coded a
border-bottom, forcing a separator on every banner regardless of placement — a bottom-pinned banner ends up with the divider on the wrong side and can't turn it off. Removed it; place aSidebarV2Dividerexplicitly where a separator is wanted.2. Elevated default surface
The default variant used
surface(sidebar)— the same color as the sidebar container — so the banner blended in with no contrast (the legacySidebarbanner used an elevated surface; V2 regressed this). Changed the default background tosurface(tint).3. Flexible layout
addonoronCloseis provided — content is truly full-width when there's no close button.closePlacement?: 'center' | 'top'(default'center') aligns the close button with the banner header instead of centering it vertically, for banners with taller content below the title.Changes
variables.scss: default banner bgsurface(sidebar)→surface(tint).Sidebar.styles.scss: dropborder-bottom; contentflex: 1 1 auto;--close-topmodifier.SidebarBanner.tsx:closePlacementprop; conditional addon column.Sidebar.stories.tsx: explicitSidebarV2Dividerafter the banner.Migration
Consumers relying on the implicit divider add one explicitly:
How to test
Storybook → Navigation/SidebarV2 → Default. Banner renders on an elevated (tint) surface, flush, divider from the explicit
SidebarV2Divider. ToggleclosePlacement/ omitonCloseto see the flexible layout.🤖 Generated with Claude Code