Skip to content

fix(ui): constrain organization menu width when sidebar is collapsed - #4845

Open
hbilal9 wants to merge 1 commit into
Dokploy:canaryfrom
hbilal9:fix/collapsed-sidebar-org-menu
Open

fix(ui): constrain organization menu width when sidebar is collapsed#4845
hbilal9 wants to merge 1 commit into
Dokploy:canaryfrom
hbilal9:fix/collapsed-sidebar-org-menu

Conversation

@hbilal9

@hbilal9 hbilal9 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Closes #4840

When the sidebar is collapsed, the Organizations dropdown renders as a cramped, partially-broken popover: the org name column collapses to nothing, the row action buttons (star/edit/delete) get crammed together, and the Add organization item wraps onto two lines.

Cause

The organization DropdownMenuContent in apps/dokploy/components/layouts/side.tsx has no width constraint. The popover therefore sizes against its trigger, and with the sidebar collapsed the trigger is only the narrow icon rail. Inside the menu, each org name span uses min-w-0 flex-1 truncate — classes that assume a constrained container — so with no width floor the flex layout squeezes the name to zero and the content implodes.

With the sidebar expanded the trigger is ~16rem wide, which is why the layout only accidentally looked correct in that state.

Fix

Apply the same width pattern already used by the user-nav dropdown (user-nav.tsx):

w-(--radix-dropdown-menu-trigger-width) min-w-64

min-w-64 (16rem) matches SIDEBAR_WIDTH, so the menu renders at the same width whether the sidebar is collapsed or expanded. A slightly larger floor than user-nav's min-w-56 because org rows carry a logo, name, and three action buttons.

Verification

  • Reproduced on a live v0.29.12 instance (collapsed sidebar → broken popover, matching the issue screenshot).
  • One-line class change; biome check clean on the file.
  • Same pattern as the existing user-nav.tsx dropdown and the stock shadcn sidebar team-switcher.

The organization DropdownMenuContent has no width constraint, so when
the sidebar is collapsed the popover sizes against the narrow icon-rail
trigger. The org name span (min-w-0 flex-1 truncate) collapses to
nothing, cramming the row actions together and wrapping the Add
organization item.

Apply the same width pattern used by the user-nav dropdown:
w-(--radix-dropdown-menu-trigger-width) with a minimum width. Use
min-w-64 to match SIDEBAR_WIDTH (16rem) so the menu renders at the
same width in both sidebar states.

Closes Dokploy#4840
@hbilal9
hbilal9 requested a review from Siumauricio as a code owner July 18, 2026 07:10
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. pr-open labels Jul 18, 2026
@hbilal9

hbilal9 commented Jul 18, 2026

Copy link
Copy Markdown
Author

Note for review: the earlier sidebar overflow fix (#4755) is already included in v0.29.12 — SidebarContent at that tag has overflow-y-auto overflow-x-hidden and no group-data-[collapsible=icon]:overflow-hidden. The issue still reproduces on v0.29.12, so this is a separate problem: the overflow change fixed content clipping inside the sidebar container, while the org dropdown renders in a portal and was collapsing because its DropdownMenuContent has no width floor. This PR addresses that remaining cause.

AminDhouib added a commit to DevinoSolutions/dokploy-community that referenced this pull request Jul 18, 2026
port: fix(ui): constrain organization menu width when sidebar is collapsed (upstream Dokploy#4845)
@hbilal9

hbilal9 commented Jul 20, 2026

Copy link
Copy Markdown
Author

Hi @Siumauricio, gentle bump when you get a chance. This closes #4840 (org dropdown rendering broken when the sidebar is collapsed) — reproducible on v0.29.12, and it is a separate cause from the earlier overflow fix in #4755. It is a one-line width constraint on the dropdown, matching the pattern already used in user-nav.tsx. The CI checks are pending a first-time workflow-run approval on my side. Glad to adjust anything. Thanks for the great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-open size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organization sidebar menu not properly rendered when sidebar is collapsed

1 participant