Skip to content

fix(frontend): Make the sidebar banner and switcher menu fit the rail - #6018

Merged
mmabrouk merged 3 commits into
release/v0.112.1from
fix/sidebar-rail-alignment
Aug 13, 2026
Merged

fix(frontend): Make the sidebar banner and switcher menu fit the rail#6018
mmabrouk merged 3 commits into
release/v0.112.1from
fix/sidebar-rail-alignment

Conversation

@ashrafchowdury

Copy link
Copy Markdown
Contributor

Context

Two problems in the sidebar rail, both from hardcoded widths and a stale colour token.

The "Star Agenta" banner had no visible edge. It painted itself with --ag-c-F5F7FA, and the warm recolour repointed that legacy token at #f6f5f3, which is the exact value of --ag-shell-rail-bg. The card and the ground behind it were the same colour, so the card read as loose text on the rail.

The project switcher menu ignored the rail entirely. It was a fixed 220px panel anchored to a trigger whose width follows the resizable rail, so on a narrow rail the menu hung out over the content area, and on a wide rail it stopped well short of the button it belongs to.

Changes

The banner card now uses colorBgElevated plus the --ag-shell-line hairline. That is the same "white card on warm ground" language the rail already uses for its selected nav pill, and it costs nothing in dark mode, where the old token already resolved to colorBgElevated. Its container was a fixed 215px box centred with mx-auto, which drifted further from the nav rows the wider the rail got. It is now full width with an inset, so it tracks the rail at any size.

The switcher menu takes its width from the trigger. antd pins the popup root's min-width to the trigger width, so w-full on the panel makes it exactly as wide as the button, never wider. Collapsed, the trigger is icon sized, so the panel falls back to a fixed readable width.

The panel also needed box-border. Preflight is off in this repo (oss/tailwind.config.ts:443), so box-sizing is not border-box by default and w-full plus a 1px border overflowed its container by 2px.

Two padding fixes put the switcher on the same column as the nav icons. The trigger's own px-1.5 was stacking on its wrapper's px-2, landing the avatar at 14px while every nav icon sits at 20px. The menu's rows had the same problem one pixel out, from the panel padding sitting inside the card's border.

Measured on the running app, rail at 302px:

before after
switcher avatar 14 20 (nav icon column)
menu panel 8 to 228, past a 200px rail 8 to 294, exactly the trigger
menu row icons 21 20

Tests / notes

  • Verified in the browser against the live DOM rather than by eye. Every number above is a getBoundingClientRect() reading, checked at several rail widths to confirm nothing is pinned to one size.
  • Dark mode is unchanged in fill. --ag-c-F5F7FA already mapped to colorBgElevated there, so the only difference is the added hairline.
  • pnpm eslint --fix and prettier on the four touched files. tsc --noEmit is clean for them.
  • The banner card sits inset from the nav rows rather than flush with them. That is deliberate, not a leftover from the fixed-width version.

What to QA

  • Open any page with the sidebar expanded. The "Star Agenta" banner reads as a card with a visible border, not as text floating on the rail.
  • Drag the rail wider and narrower. The banner keeps its inset on both sides at every width, with no fixed-width jump.
  • Click the project switcher at the bottom of the rail. The menu is exactly as wide as the button and stays inside the rail. Drag the rail to a narrow width and open it again. It still does not spill over the content area.
  • Check the left column. The switcher avatar, the menu's project avatars, and the menu's row icons line up with the Home and Settings icons above them.
  • Collapse the rail and open the switcher. The menu is still wide enough to read.
  • Regression: switch the theme to dark from the same menu. The banner and the menu both keep a visible edge against the rail.

🤖 Generated with Claude Code

The banner used --ag-c-F5F7FA, which the warm recolor repointed at the same
value as the rail ground (#f6f5f3), so the card had no edge at all. Give it
the elevated surface plus the shell hairline, the same language the rail's
selected nav pill already uses.

The container was also a fixed 215px centred box, so it drifted further from
the nav rows the wider the resizable rail got. Make it track the rail instead.
The menu was a fixed 220px panel, so on a narrow rail it hung out over the
content area and on a wide one it sat well short of the trigger. antd pins the
popup root's min-width to the trigger, so w-full makes it exactly as wide as
the button at any rail width; collapsed keeps a readable fixed width.

box-border because preflight is off here — w-full plus a border overflowed 2px.
The trigger's own px-1.5 stacked on the wrapper padding and left the avatar 6px
inside the nav icon column; px-3 puts it on the column, and trimming the panel
padding does the same for the menu's own rows.
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 13, 2026
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Error Error Aug 13, 2026 4:48pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 3957bdb2-33fd-4489-8228-c37454045d75

📥 Commits

Reviewing files that changed from the base of the PR and between af089c1 and 690e95f.

📒 Files selected for processing (2)
  • web/oss/src/components/SidebarBanners/SidebarBanner.tsx
  • web/oss/src/components/SidebarBanners/index.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/oss/src/components/SidebarBanners/SidebarBanner.tsx
  • web/oss/src/components/SidebarBanners/index.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Style
    • Improved sidebar project and organization switcher alignment and spacing.
    • Adjusted dropdown widths and trigger padding for a more consistent layout.
    • Updated the sidebar footer and banners to use the available width.
    • Refined banner backgrounds, borders, padding, dismiss controls, and description text sizing.

Walkthrough

The PR updates sidebar switcher spacing and widths, expands the main sidebar footer to full width, and standardizes banner styling and container sizing.

Changes

Sidebar layout updates

Layer / File(s) Summary
Project and organization switcher layout
web/oss/src/components/Sidebar/components/ProjectOrgSwitcher/index.tsx
The project and organization panels use shared spacing. The dropdown uses trigger width when expanded and a fixed 220px width when collapsed. Expanded triggers use increased horizontal padding.
Main sidebar footer width
web/oss/src/components/Sidebar/scopes/mainScope.tsx
The non-collapsed footer wrapper now uses the full available width.
Sidebar banner layout and styling
web/oss/src/components/SidebarBanners/SidebarBanner.tsx, web/oss/src/components/SidebarBanners/index.tsx
Both banner paths use shared styling. Banner descriptions use 12px text. The banner wrapper uses full width with fixed horizontal padding.

Estimated code review effort: 2 (Simple) | ~15 minutes

Mergeability Score: ⚪ Minimal · up to 690e9

This PR makes localized sidebar layout and styling fixes so the banner and project switcher fit the rail across widths; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the responsive sidebar banner and switcher menu changes.
Description check ✅ Passed The description directly explains the sidebar sizing, styling, alignment, testing, and QA changes.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sidebar-rail-alignment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ashrafchowdury
ashrafchowdury changed the base branch from main to release/v0.112.1 August 13, 2026 16:29
@ashrafchowdury

Copy link
Copy Markdown
Contributor Author

Fixed

  • Banner color BG fixed issue
  • Made both the banner and the project selector responsive to respect the sidebar size - when drag resized
image

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b013b071-d7e6-415e-abe4-4b147464b2c5

📥 Commits

Reviewing files that changed from the base of the PR and between 728f39f and af089c1.

📒 Files selected for processing (4)
  • web/oss/src/components/Sidebar/components/ProjectOrgSwitcher/index.tsx
  • web/oss/src/components/Sidebar/scopes/mainScope.tsx
  • web/oss/src/components/SidebarBanners/SidebarBanner.tsx
  • web/oss/src/components/SidebarBanners/index.tsx

Comment thread web/oss/src/components/SidebarBanners/index.tsx Outdated
Comment thread web/oss/src/components/SidebarBanners/SidebarBanner.tsx
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-08-13T17:48:58.079Z

…button

Review follow-up. The dismiss button washed itself with bg-black/5 on hover and
focus, which is invisible against the elevated surface the card now uses in dark
mode. Swap it for colorFillTertiary, and take the title and icon colour from
colorText rather than the gray-900 scale.

Also make the banner wrapper's box-border explicit. The app only gets border-box
from antd's '.ant-layout *' reset, and that does not reach portalled trees, so a
w-full element with padding should not rely on inheriting it.
@ashrafchowdury
ashrafchowdury changed the base branch from release/v0.112.1 to main August 13, 2026 16:47
@mmabrouk
mmabrouk changed the base branch from main to release/v0.112.1 August 13, 2026 17:48
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2026
@mmabrouk
mmabrouk merged commit c4c8f0e into release/v0.112.1 Aug 13, 2026
67 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants