Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[GIT-57 | WEB-5912] fix: app sidebar ux and responsiveness (#8560)

Anmol Singh Bhatia8fa08b250612
diff --git a/apps/web/core/components/workspace/sidebar/project-navigation.tsx b/apps/web/core/components/workspace/sidebar/project-navigation.tsx
index 8f50d39515..95914de569 100644
--- a/apps/web/core/components/workspace/sidebar/project-navigation.tsx
+++ b/apps/web/core/components/workspace/sidebar/project-navigation.tsx
@@ -43,7 +43,7 @@ export const ProjectNavigation = observer(function ProjectNavigation(props: TPro
const { workItem: workItemIdentifierFromRoute } = useParams();
// store hooks
const { t } = useTranslation();
- const { toggleSidebar } = useAppTheme();
+ const { isExtendedProjectSidebarOpened, toggleExtendedProjectSidebar, toggleSidebar } = useAppTheme();
const { getPartialProjectById } = useProject();
const { allowPermissions } = useUserPermissions();
const {
@@ -62,6 +62,10 @@ export const ProjectNavigation = observer(function ProjectNavigation(props: TPro
if (window.innerWidth < 768) {
toggleSidebar();
}
+ // close the extended sidebar if it is open
+ if (isExtendedProjectSidebarOpened) {
+ toggleExtendedProjectSidebar(false);
+ }
};
const baseNavigation = useCallback(
diff --git a/apps/web/core/components/workspace/sidebar/projects-list-item.tsx b/apps/web/core/components/workspace/sidebar/projects-list-item.tsx
index e633cca8cc..9f95ccb908 100644
--- a/apps/web/core/components/workspace/sidebar/projects-list-item.tsx
+++ b/apps/web/core/components/workspace/sidebar/projects-list-item.tsx
@@ -260,6 +260,8 @@ export const SidebarProjectsListItem = observer(function SidebarProjectsListItem
if (!project) return null;
+ const isAccordionMode = projectPreferences.navigationMode === "ACCORDION";
+
const handleItemClick = () => {
if (projectPreferences.navigationMode === "ACCORDION") {
setIsProjectListOpen(!isProjectListOpen);
@@ -267,13 +269,11 @@ export const SidebarProjectsListItem = observer(function SidebarProjectsListItem
router.push(defaultTabUrl);
}
// close the extended sidebar if it is open
- if (isExtendedProjectSidebarOpened) {
+ if (isExtendedProjectSidebarOpened && !isAccordionMode) {
toggleExtendedProjectSidebar(false);
}
};
- const isAccordionMode = projectPreferences.navigationMode === "ACCORDION";
-
const shouldHighlightProject = URLProjectId === project?.id && projectPreferences.navigationMode !== "ACCORDION";
return (