-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-4328] feat: sidebar revamp #7217
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
Merged
Merged
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 1fa5430
chore: extended sidebar wrapper added
anmolsinghbhatia bbab8f3
chore: resizeable sidebar component added
anmolsinghbhatia 12c1ae6
chore: appsidebar root component
anmolsinghbhatia ed86b80
chore: updated sidebar and applied necessary changes across codebase
anmolsinghbhatia 124b474
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia a07cff0
chore: code refactor
anmolsinghbhatia 3ea03fb
preview sync
anmolsinghbhatia 7205b72
chore: code refactor
anmolsinghbhatia 3cdfac2
chore: code refactor
anmolsinghbhatia 8e27078
chore: breadcrumb changes
anmolsinghbhatia 257ad6f
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia 71c5616
chore: sidebar improvements and fixes
anmolsinghbhatia e74ecf2
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia 322cdaf
chore: enhancements and fixes
anmolsinghbhatia 5fdb10f
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia ab9c323
fix: peek sidebar leave
anmolsinghbhatia c2457a4
chore: code refactor
anmolsinghbhatia 7642e4b
chore: code refactor
anmolsinghbhatia 5b09c4b
chore: code refactor
anmolsinghbhatia b426dc6
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia 4f92a11
chore: icons added
anmolsinghbhatia 6fbeb76
chore: add dock variable and toggle function to theme store
anmolsinghbhatia 3bc896c
chore: code refactor
anmolsinghbhatia 1fde83b
chore: code refactor
anmolsinghbhatia e360638
chore: code refactor
anmolsinghbhatia 8299bfa
chore: theme and workspace store updated
anmolsinghbhatia cc0e2cf
chore: workspace content wrapper and apprail context
anmolsinghbhatia b304500
chore: workspace and project wrapper updated
anmolsinghbhatia c4f4e31
chore: app rail component
anmolsinghbhatia a388c05
chore: content wrapper
anmolsinghbhatia 49a74fa
chore: sidebar component updated
anmolsinghbhatia 28202c1
chore: layout changes and code refactoring
anmolsinghbhatia 49ecef6
chore: code refactor
anmolsinghbhatia 787cf54
chore: code refactor
anmolsinghbhatia 41cc642
chore: code refactor
anmolsinghbhatia 121fec7
chore: code refactor
anmolsinghbhatia 1e3ad14
chore: code refactor
anmolsinghbhatia cc7e2f5
chore: code refactor
anmolsinghbhatia 59f9d47
chore: appsidebar toggle button
anmolsinghbhatia bcee463
chore: code refactor
anmolsinghbhatia 0a5b37f
chore: workspace menu improvements
anmolsinghbhatia 220d812
chore: sidebar spacing and padding improvements
anmolsinghbhatia 5c2d1e9
chore: settings layout improvement
anmolsinghbhatia db0a62d
chore: enhancements
anmolsinghbhatia 1d56fb7
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia ee16f1a
chore: extended sidebar code refactor
anmolsinghbhatia dc51f84
chore: code refactor
anmolsinghbhatia 572ea72
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia b0a70ab
fix: merge conflict
anmolsinghbhatia 6876ed8
fix: merge conflict
anmolsinghbhatia 604b5e2
chore: code refactor
anmolsinghbhatia 63f07bd
Merge branch 'preview' of github.com:makeplane/plane into feat-sideba…
anmolsinghbhatia 8ca8a24
chore: code refactor
anmolsinghbhatia d6dd7b8
chore: code refactor
anmolsinghbhatia b8c2729
chore: code refactor
anmolsinghbhatia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
apps/web/app/(all)/[workspaceSlug]/(projects)/_sidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| </> | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar-wrapper.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.