Skip to content

refactor(fuselage): SidebarV2Banner divider, elevated surface & flexible layout#2079

Open
ggazzo wants to merge 4 commits into
mainfrom
refactor/sidebar-banner-explicit-divider
Open

refactor(fuselage): SidebarV2Banner divider, elevated surface & flexible layout#2079
ggazzo wants to merge 4 commits into
mainfrom
refactor/sidebar-banner-explicit-divider

Conversation

@ggazzo

@ggazzo ggazzo commented Jul 9, 2026

Copy link
Copy Markdown
Member

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 a SidebarV2Divider explicitly 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 legacy Sidebar banner used an elevated surface; V2 regressed this). Changed the default background to surface(tint).

3. Flexible layout

  • The content column now grows to fill the available width, so children (e.g. media controls) can span the full banner width.
  • The addon/close column renders only when an addon or onClose is provided — content is truly full-width when there's no close button.
  • New 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 bg surface(sidebar)surface(tint).
  • Sidebar.styles.scss: drop border-bottom; content flex: 1 1 auto; --close-top modifier.
  • SidebarBanner.tsx: closePlacement prop; conditional addon column.
  • Sidebar.stories.tsx: explicit SidebarV2Divider after the banner.

Migration

Consumers relying on the implicit divider add one explicitly:

<SidebarV2Divider />
<SidebarV2Banner ... />

How to test

Storybook → Navigation/SidebarV2 → Default. Banner renders on an elevated (tint) surface, flush, divider from the explicit SidebarV2Divider. Toggle closePlacement / omit onClose to see the flexible layout.

🤖 Generated with Claude Code

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-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd14433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rocket.chat/fuselage Minor

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>
@ggazzo ggazzo changed the title refactor(fuselage): make SidebarV2Banner divider explicit refactor(fuselage): SidebarV2Banner explicit divider + elevated surface Jul 9, 2026
- 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>
@ggazzo ggazzo changed the title refactor(fuselage): SidebarV2Banner explicit divider + elevated surface refactor(fuselage): SidebarV2Banner divider, elevated surface & flexible layout Jul 9, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant