-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-4827] chore: sidebar content wrapper and code refactor #7840
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from "./app-switcher"; | ||
| export * from "./project-navigation-root"; | ||
| export * from "./sidebar-content-wrapper"; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||
| "use client"; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| type TSidebarContentWrapperProps = { | ||||||||||||||||||||
| children: React.ReactNode; | ||||||||||||||||||||
| }; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const SidebarContentWrapper = ({ children }: TSidebarContentWrapperProps) => ( | ||||||||||||||||||||
| <div className="flex flex-col gap-3 overflow-x-hidden scrollbar-sm h-full w-full overflow-y-auto vertical-scrollbar px-3 pt-3"> | ||||||||||||||||||||
| {children} | ||||||||||||||||||||
| </div> | ||||||||||||||||||||
|
Comment on lines
+7
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix flex/height: When used between a header and a footer in a column flex container, this middle section should flex, not be Apply this diff: -export const SidebarContentWrapper = ({ children }: TSidebarContentWrapperProps) => (
- <div className="flex flex-col gap-3 overflow-x-hidden scrollbar-sm h-full w-full overflow-y-auto vertical-scrollbar px-3 pt-3">
+export const SidebarContentWrapper = ({ children }: TSidebarContentWrapperProps) => (
+ <div className="flex flex-col gap-3 overflow-x-hidden scrollbar-sm flex-1 min-h-0 w-full overflow-y-auto vertical-scrollbar px-3 pt-3">
{children}
</div>
);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| ); | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,15 @@ | ||||||||||||||||||
| import { useState } from "react"; | ||||||||||||||||||
| import { observer } from "mobx-react"; | ||||||||||||||||||
| // ui | ||||||||||||||||||
| import packageJson from "package.json"; | ||||||||||||||||||
| import { useTranslation } from "@plane/i18n"; | ||||||||||||||||||
| import { Tooltip } from "@plane/propel/tooltip"; | ||||||||||||||||||
| import { Button } from "@plane/ui"; | ||||||||||||||||||
|
Comment on lines
+4
to
7
|
||||||||||||||||||
| import packageJson from "package.json"; | |
| import { useTranslation } from "@plane/i18n"; | |
| import { Tooltip } from "@plane/propel/tooltip"; | |
| import { Button } from "@plane/ui"; | |
| import { useTranslation } from "@plane/i18n"; | |
| import { Tooltip } from "@plane/propel/tooltip"; | |
| import { Button } from "@plane/ui"; | |
| import packageJson from "package.json"; |
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.
Bug: Modal Rendering Inside Positioned Container
The PaidPlanUpgradeModal component is now rendered inside a positioned div container with specific styling (border, background, padding, height). Previously, it was rendered at the top level in a React fragment. This change could cause modal positioning or z-index issues since modals should typically be rendered at the DOM tree's top level, not inside positioned containers, even when using portals.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,12 @@ import { useOutsideClickDetector } from "@plane/hooks"; | |
| // components | ||
| import { AppSidebarToggleButton } from "@/components/sidebar/sidebar-toggle-button"; | ||
| import { SidebarDropdown } from "@/components/workspace/sidebar/dropdown"; | ||
| import { HelpMenu } from "@/components/workspace/sidebar/help-menu"; | ||
| // hooks | ||
| import { useAppTheme } from "@/hooks/store/use-app-theme"; | ||
| import { useAppRail } from "@/hooks/use-app-rail"; | ||
| import useSize from "@/hooks/use-window-size"; | ||
| // plane web components | ||
| import { SidebarContentWrapper } from "@/plane-web/components/sidebar"; | ||
| import { WorkspaceEditionBadge } from "@/plane-web/components/workspace/edition-badge"; | ||
|
|
||
| type TSidebarWrapperProps = { | ||
|
|
@@ -40,7 +40,7 @@ export const SidebarWrapper: FC<TSidebarWrapperProps> = observer((props) => { | |
| }, [windowSize]); | ||
|
|
||
| return ( | ||
| <div ref={ref} className="flex flex-col h-full w-full"> | ||
| <div ref={ref} className="relative flex flex-col h-full w-full"> | ||
| <div className="flex flex-col gap-3 px-3"> | ||
| {/* Workspace switcher and settings */} | ||
| {!shouldRenderAppRail && <SidebarDropdown />} | ||
|
|
@@ -56,17 +56,9 @@ export const SidebarWrapper: FC<TSidebarWrapperProps> = observer((props) => { | |
| {/* Quick actions */} | ||
| {quickActions} | ||
| </div> | ||
| <div className="flex flex-col gap-3 overflow-x-hidden scrollbar-sm h-full w-full overflow-y-auto vertical-scrollbar px-3 pt-3 pb-0.5"> | ||
| {children} | ||
| </div> | ||
| <SidebarContentWrapper>{children}</SidebarContentWrapper> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainEnsure the middle section flexes; otherwise the bottom badge may be pushed off-screen. After switching to 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Show the referenced file around the snippet
echo "=== apps/web/core/components/sidebar/sidebar-wrapper.tsx ==="
sed -n '1,240p' apps/web/core/components/sidebar/sidebar-wrapper.tsx || true
echo
# 2) Search the repo for SidebarContentWrapper definition/usage
echo "=== rg matches for SidebarContentWrapper ==="
rg -n "SidebarContentWrapper" || true
echo
# 3) If a definition file is found, print its contents (attempt common patterns)
echo "=== Possible wrapper component files (searching for 'Sidebar' files) ==="
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!**/build/**' "Sidebar" || true
echo
# 4) Search for components in the same directory
echo "=== Files in apps/web/core/components/sidebar ==="
ls -la apps/web/core/components/sidebar || true
echo
# 5) If a file named sidebar-content-wrapper.* exists, print it
if [ -f apps/web/core/components/sidebar/sidebar-content-wrapper.tsx ]; then
echo "=== apps/web/core/components/sidebar/sidebar-content-wrapper.tsx ==="
sed -n '1,240p' apps/web/core/components/sidebar/sidebar-content-wrapper.tsx || true
fi
# 6) Grep for patterns of flex-1 or min-h-0 in the sidebar components
echo "=== Search for 'flex-1' and 'min-h-0' in sidebar dir ==="
rg -n "flex-1|min-h-0|h-full" apps/web/core/components/sidebar || trueLength of output: 4850 Length of output: 1815 Make SidebarContentWrapper use flex-1 + min-h-0 (not h-full) apps/web/ce/components/sidebar/sidebar-content-wrapper.tsx — replace the root div's "h-full w-full" with "flex-1 min-h-0" (e.g. "flex-1 min-h-0 flex flex-col gap-3 overflow-x-hidden scrollbar-sm overflow-y-auto vertical-scrollbar px-3 pt-3") so the middle section can shrink and the WorkspaceEditionBadge stays visible. |
||
| {/* Help Section */} | ||
| <div className="flex items-center justify-between p-3 border-t border-custom-border-200 bg-custom-sidebar-background-100 h-12"> | ||
| <WorkspaceEditionBadge /> | ||
| <div className="flex items-center gap-2"> | ||
| {!shouldRenderAppRail && <HelpMenu />} | ||
| {!isAppRailEnabled && <AppSidebarToggleButton />} | ||
| </div> | ||
| </div> | ||
| <WorkspaceEditionBadge /> | ||
| </div> | ||
| ); | ||
| }); | ||
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.
Bug: Sidebar Content Padding Issue
Missing
pb-0.5class in the SidebarContentWrapper. The original div in sidebar-wrapper.tsx hadpb-0.5for bottom padding, but the new SidebarContentWrapper component omits this class, which could affect the bottom spacing of the scrollable content.