Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ff89d22
chore: sidebar peek state added to theme store
anmolsinghbhatia Jun 12, 2025
1fa5430
chore: extended sidebar wrapper added
anmolsinghbhatia Jun 16, 2025
bbab8f3
chore: resizeable sidebar component added
anmolsinghbhatia Jun 16, 2025
12c1ae6
chore: appsidebar root component
anmolsinghbhatia Jun 16, 2025
ed86b80
chore: updated sidebar and applied necessary changes across codebase
anmolsinghbhatia Jun 16, 2025
124b474
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jun 16, 2025
a07cff0
chore: code refactor
anmolsinghbhatia Jun 16, 2025
3ea03fb
preview sync
anmolsinghbhatia Jun 16, 2025
7205b72
chore: code refactor
anmolsinghbhatia Jun 16, 2025
3cdfac2
chore: code refactor
anmolsinghbhatia Jun 16, 2025
8e27078
chore: breadcrumb changes
anmolsinghbhatia Jun 16, 2025
257ad6f
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jun 17, 2025
71c5616
chore: sidebar improvements and fixes
anmolsinghbhatia Jun 17, 2025
e74ecf2
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jun 18, 2025
322cdaf
chore: enhancements and fixes
anmolsinghbhatia Jun 18, 2025
5fdb10f
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jun 18, 2025
ab9c323
fix: peek sidebar leave
anmolsinghbhatia Jun 18, 2025
c2457a4
chore: code refactor
anmolsinghbhatia Jun 18, 2025
7642e4b
chore: code refactor
anmolsinghbhatia Jun 20, 2025
5b09c4b
chore: code refactor
anmolsinghbhatia Jun 20, 2025
b426dc6
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jun 27, 2025
4f92a11
chore: icons added
anmolsinghbhatia Jun 27, 2025
6fbeb76
chore: add dock variable and toggle function to theme store
anmolsinghbhatia Jun 27, 2025
3bc896c
chore: code refactor
anmolsinghbhatia Jun 27, 2025
1fde83b
chore: code refactor
anmolsinghbhatia Jun 27, 2025
e360638
chore: code refactor
anmolsinghbhatia Jun 27, 2025
8299bfa
chore: theme and workspace store updated
anmolsinghbhatia Jun 30, 2025
cc0e2cf
chore: workspace content wrapper and apprail context
anmolsinghbhatia Jun 30, 2025
b304500
chore: workspace and project wrapper updated
anmolsinghbhatia Jun 30, 2025
c4f4e31
chore: app rail component
anmolsinghbhatia Jun 30, 2025
a388c05
chore: content wrapper
anmolsinghbhatia Jun 30, 2025
49a74fa
chore: sidebar component updated
anmolsinghbhatia Jun 30, 2025
28202c1
chore: layout changes and code refactoring
anmolsinghbhatia Jun 30, 2025
49ecef6
chore: code refactor
anmolsinghbhatia Jun 30, 2025
787cf54
chore: code refactor
anmolsinghbhatia Jun 30, 2025
41cc642
chore: code refactor
anmolsinghbhatia Jun 30, 2025
121fec7
chore: code refactor
anmolsinghbhatia Jun 30, 2025
1e3ad14
chore: code refactor
anmolsinghbhatia Jun 30, 2025
cc7e2f5
chore: code refactor
anmolsinghbhatia Jun 30, 2025
59f9d47
chore: appsidebar toggle button
anmolsinghbhatia Jul 1, 2025
bcee463
chore: code refactor
anmolsinghbhatia Jul 1, 2025
0a5b37f
chore: workspace menu improvements
anmolsinghbhatia Jul 1, 2025
220d812
chore: sidebar spacing and padding improvements
anmolsinghbhatia Jul 1, 2025
5c2d1e9
chore: settings layout improvement
anmolsinghbhatia Jul 1, 2025
db0a62d
chore: enhancements
anmolsinghbhatia Jul 1, 2025
1d56fb7
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jul 1, 2025
ee16f1a
chore: extended sidebar code refactor
anmolsinghbhatia Jul 3, 2025
dc51f84
chore: code refactor
anmolsinghbhatia Jul 3, 2025
572ea72
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jul 3, 2025
b0a70ab
fix: merge conflict
anmolsinghbhatia Jul 3, 2025
6876ed8
fix: merge conflict
anmolsinghbhatia Jul 3, 2025
604b5e2
chore: code refactor
anmolsinghbhatia Jul 7, 2025
63f07bd
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia Jul 8, 2025
8ca8a24
chore: code refactor
anmolsinghbhatia Jul 8, 2025
d6dd7b8
chore: code refactor
anmolsinghbhatia Jul 8, 2025
b8c2729
chore: code refactor
anmolsinghbhatia Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions apps/web/app/(all)/[workspaceSlug]/(projects)/_sidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"use client";
import { FC, useState } from "react";
import { observer } from "mobx-react";
// plane imports
import { SIDEBAR_WIDTH } from "@plane/constants";
import { useLocalStorage } from "@plane/hooks";
// hooks
import { ResizableSidebar } from "@/components/sidebar";
import { useAppTheme } from "@/hooks/store";
import { useAppRail } from "@/hooks/use-app-rail";
// local imports
import { ExtendedAppSidebar } from "./extended-sidebar";
import { AppSidebar } from "./sidebar";

export const ProjectAppSidebar: FC = observer(() => {
// store hooks
const {
sidebarCollapsed,
toggleSidebar,
sidebarPeek,
toggleSidebarPeek,
isExtendedSidebarOpened,
isAnySidebarDropdownOpen,
} = useAppTheme();
const { storedValue, setValue } = useLocalStorage("sidebarWidth", SIDEBAR_WIDTH);
// states
const [sidebarWidth, setSidebarWidth] = useState<number>(storedValue ?? SIDEBAR_WIDTH);
// hooks
const { shouldRenderAppRail } = useAppRail();
// derived values
const isAnyExtendedSidebarOpen = isExtendedSidebarOpened;

// handlers
const handleWidthChange = (width: number) => setValue(width);

return (
<>
<ResizableSidebar
showPeek={sidebarPeek}
defaultWidth={storedValue ?? 250}
width={sidebarWidth}
setWidth={setSidebarWidth}
defaultCollapsed={sidebarCollapsed}
peekDuration={1500}
onWidthChange={handleWidthChange}
onCollapsedChange={toggleSidebar}
isCollapsed={sidebarCollapsed}
toggleCollapsed={toggleSidebar}
togglePeek={toggleSidebarPeek}
extendedSidebar={
<>
<ExtendedAppSidebar />
</>
}
isAnyExtendedSidebarExpanded={isAnyExtendedSidebarOpen}
isAnySidebarDropdownOpen={isAnySidebarDropdownOpen}
disablePeekTrigger={shouldRenderAppRail}
>
<AppSidebar />
</ResizableSidebar>
</>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { Plus, Search } from "lucide-react";
import { EUserPermissions, EUserPermissionsLevel, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { setToast, TOAST_TYPE, Tooltip } from "@plane/ui";
import { cn, copyUrlToClipboard, orderJoinedProjects } from "@plane/utils";
import { copyUrlToClipboard, orderJoinedProjects } from "@plane/utils";
// components
import { CreateProjectModal } from "@/components/project";
import { SidebarProjectsListItem } from "@/components/workspace";
// hooks
import { useAppTheme, useProject, useUserPermissions } from "@/hooks/store";
import useExtendedSidebarOutsideClickDetector from "@/hooks/use-extended-sidebar-overview-outside-click";
import { TProject } from "@/plane-web/types";
import { ExtendedSidebarWrapper } from "./extended-sidebar-wrapper";

export const ExtendedProjectSidebar = observer(() => {
// refs
Expand All @@ -27,7 +27,7 @@ export const ExtendedProjectSidebar = observer(() => {
const { workspaceSlug } = useParams();
// store hooks
const { t } = useTranslation();
const { sidebarCollapsed, extendedProjectSidebarCollapsed, toggleExtendedProjectSidebar } = useAppTheme();
const { isExtendedProjectSidebarOpened, toggleExtendedProjectSidebar } = useAppTheme();
const { getPartialProjectById, joinedProjectIds: joinedProjects, updateProjectView } = useProject();
const { allowPermissions } = useUserPermissions();

Expand Down Expand Up @@ -74,15 +74,7 @@ export const ExtendedProjectSidebar = observer(() => {
EUserPermissionsLevel.WORKSPACE
);

useExtendedSidebarOutsideClickDetector(
extendedProjectSidebarRef,
() => {
if (!isProjectModalOpen) {
toggleExtendedProjectSidebar(false);
}
},
"extended-project-sidebar-toggle"
);
const handleClose = () => toggleExtendedProjectSidebar(false);

const handleCopyText = (projectId: string) => {
copyUrlToClipboard(`${workspaceSlug}/projects/${projectId}/issues`).then(() => {
Expand All @@ -103,17 +95,11 @@ export const ExtendedProjectSidebar = observer(() => {
workspaceSlug={workspaceSlug.toString()}
/>
)}
<div
ref={extendedProjectSidebarRef}
className={cn(
"absolute top-0 h-full z-[19] flex flex-col gap-2 w-[300px] transform transition-all duration-300 ease-in-out bg-custom-sidebar-background-100 border-r border-custom-sidebar-border-200 shadow-md",
{
"translate-x-0 opacity-100 pointer-events-auto": extendedProjectSidebarCollapsed,
"-translate-x-full opacity-0 pointer-events-none": !extendedProjectSidebarCollapsed,
"left-[70px]": sidebarCollapsed,
"left-[250px]": !sidebarCollapsed,
}
)}
<ExtendedSidebarWrapper
isExtendedSidebarOpened={!!isExtendedProjectSidebarOpened}
extendedSidebarRef={extendedProjectSidebarRef}
handleClose={handleClose}
excludedElementId="extended-project-sidebar-toggle"
>
<div className="flex flex-col gap-1 w-full sticky top-4 pt-0 px-4">
<div className="flex items-center justify-between">
Expand Down Expand Up @@ -159,7 +145,7 @@ export const ExtendedProjectSidebar = observer(() => {
/>
))}
</div>
</div>
</ExtendedSidebarWrapper>
</>
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"use client";

import React, { FC } from "react";
import { observer } from "mobx-react";
// plane imports
import { EXTENDED_SIDEBAR_WIDTH, SIDEBAR_WIDTH } from "@plane/constants";
import { useLocalStorage } from "@plane/hooks";
import { cn } from "@plane/utils";
// hooks
import useExtendedSidebarOutsideClickDetector from "@/hooks/use-extended-sidebar-overview-outside-click";

type Props = {
children: React.ReactNode;
extendedSidebarRef: React.RefObject<HTMLDivElement>;
isExtendedSidebarOpened: boolean;
handleClose: () => void;
excludedElementId: string;
};

export const ExtendedSidebarWrapper: FC<Props> = observer((props) => {
const { children, extendedSidebarRef, isExtendedSidebarOpened, handleClose, excludedElementId } = props;
// store hooks
const { storedValue } = useLocalStorage("sidebarWidth", SIDEBAR_WIDTH);

useExtendedSidebarOutsideClickDetector(extendedSidebarRef, handleClose, excludedElementId);

return (
<div
id={excludedElementId}
ref={extendedSidebarRef}
className={cn(
`absolute h-full z-[19] flex flex-col py-2 transform transition-all duration-300 ease-in-out bg-custom-background-100 border-r border-custom-sidebar-border-200 p-4 shadow-sm`,
{
"translate-x-0 opacity-100": isExtendedSidebarOpened,
[`-translate-x-[${EXTENDED_SIDEBAR_WIDTH}px] opacity-0 hidden`]: !isExtendedSidebarOpened,
}
)}
style={{
left: `${storedValue ?? SIDEBAR_WIDTH}px`,
width: `${isExtendedSidebarOpened ? EXTENDED_SIDEBAR_WIDTH : 0}px`,
}}
>
{children}
</div>
);
});
29 changes: 9 additions & 20 deletions apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ import { useParams } from "next/navigation";
// plane imports
import { WORKSPACE_SIDEBAR_DYNAMIC_NAVIGATION_ITEMS_LINKS } from "@plane/constants";
import { EUserWorkspaceRoles } from "@plane/types";
import { cn } from "@plane/utils";
// hooks
import { useAppTheme, useWorkspace } from "@/hooks/store";
import useExtendedSidebarOutsideClickDetector from "@/hooks/use-extended-sidebar-overview-outside-click";
// plane-web imports
import { ExtendedSidebarItem } from "@/plane-web/components/workspace/sidebar";
import { ExtendedSidebarWrapper } from "./extended-sidebar-wrapper";

export const ExtendedAppSidebar = observer(() => {
// refs
const extendedSidebarRef = useRef<HTMLDivElement | null>(null);
// routers
const { workspaceSlug } = useParams();
// store hooks
const { sidebarCollapsed, extendedSidebarCollapsed, toggleExtendedSidebar } = useAppTheme();
const { isExtendedSidebarOpened, toggleExtendedSidebar } = useAppTheme();
const { updateSidebarPreference, getNavigationPreferences } = useWorkspace();

// derived values
Expand Down Expand Up @@ -95,24 +94,14 @@ export const ExtendedAppSidebar = observer(() => {
});
};

useExtendedSidebarOutsideClickDetector(
extendedSidebarRef,
() => toggleExtendedSidebar(true),
"extended-sidebar-toggle"
);
const handleClose = () => toggleExtendedSidebar(false);

return (
<div
ref={extendedSidebarRef}
className={cn(
"absolute top-0 h-full z-[19] flex flex-col gap-0.5 w-[300px] transform transition-all duration-300 ease-in-out bg-custom-sidebar-background-100 border-r border-custom-sidebar-border-200 p-4 shadow-md pb-6",
{
"-translate-x-full opacity-0 pointer-events-none": extendedSidebarCollapsed,
"translate-x-0 opacity-100 pointer-events-auto": !extendedSidebarCollapsed,
"left-[70px]": sidebarCollapsed,
"left-[250px]": !sidebarCollapsed,
}
)}
<ExtendedSidebarWrapper
isExtendedSidebarOpened={!!isExtendedSidebarOpened}
extendedSidebarRef={extendedSidebarRef}
handleClose={handleClose}
excludedElementId="extended-sidebar-toggle"
>
{sortedNavigationItems.map((item, index) => (
<ExtendedSidebarItem
Expand All @@ -122,6 +111,6 @@ export const ExtendedAppSidebar = observer(() => {
handleOnNavigationItemDrop={handleOnNavigationItemDrop}
/>
))}
</div>
</ExtendedSidebarWrapper>
);
});
8 changes: 5 additions & 3 deletions apps/web/app/(all)/[workspaceSlug]/(projects)/header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { observer } from "mobx-react";
import Image from "next/image";
import { useTheme } from "next-themes";
import { Home } from "lucide-react";
Expand All @@ -16,16 +17,17 @@ import { BreadcrumbLink } from "@/components/common";
// hooks
import { captureElementAndEvent } from "@/helpers/event-tracker.helper";

export const WorkspaceDashboardHeader = () => {
export const WorkspaceDashboardHeader = observer(() => {
// hooks
const { resolvedTheme } = useTheme();

const { t } = useTranslation();

return (
<>
<Header>
<Header.LeftItem>
<div>
<div className="flex items-center gap-2">
<Breadcrumbs>
<Breadcrumbs.Item
component={
Expand Down Expand Up @@ -65,4 +67,4 @@ export const WorkspaceDashboardHeader = () => {
</Header>
</>
);
};
});
15 changes: 8 additions & 7 deletions apps/web/app/(all)/[workspaceSlug]/(projects)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

import { CommandPalette } from "@/components/command-palette";
import { AuthenticationWrapper } from "@/lib/wrappers";
// plane web components
import { WorkspaceAuthWrapper } from "@/plane-web/layouts/workspace-wrapper";
import { AppSidebar } from "./sidebar";
import { ProjectAppSidebar } from "./_sidebar";

export default function WorkspaceLayout({ children }: { children: React.ReactNode }) {
return (
<AuthenticationWrapper>
<CommandPalette />
<WorkspaceAuthWrapper>
<div className="relative flex h-screen w-full overflow-hidden">
<AppSidebar />
<main className="relative flex h-full w-full flex-col overflow-hidden bg-custom-background-100">
{children}
</main>
<div className="relative flex flex-col h-full w-full overflow-hidden rounded-lg border border-custom-border-200">
<div className="relative flex size-full overflow-hidden">
<ProjectAppSidebar />
<main className="relative flex h-full w-full flex-col overflow-hidden bg-custom-background-100">
{children}
</main>
</div>
</div>
</WorkspaceAuthWrapper>
</AuthenticationWrapper>
Expand Down
Loading