Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

fix(web): open General and the current project's team from the project switcher (#743)

Croff96a8e2ba87cb
diff --git a/apps/web/src/components/layout/ProjectSwitcher.tsx b/apps/web/src/components/layout/ProjectSwitcher.tsx
index 749a1e08..d3910608 100644
--- a/apps/web/src/components/layout/ProjectSwitcher.tsx
+++ b/apps/web/src/components/layout/ProjectSwitcher.tsx
@@ -54,6 +54,7 @@ export default function ProjectSwitcher({
const workspaceTeams = workspace
? teams.filter((team) => team.workspaceId === workspace.id)
: teams;
+ const currentTeam = workspaceTeams.find((team) => team.id === current?.teamId);
return (
<SidebarMenu>
@@ -76,6 +77,7 @@ export default function ProjectSwitcher({
workspaces={workspaces}
workspace={workspace}
teams={workspaceTeams}
+ currentTeam={currentTeam}
scope={scope}
onScopeChange={setScope}
onPickWorkspace={(workspaceId) => {
diff --git a/apps/web/src/components/layout/ProjectSwitcherMenu.tsx b/apps/web/src/components/layout/ProjectSwitcherMenu.tsx
index 9cf5ab30..dca7331b 100644
--- a/apps/web/src/components/layout/ProjectSwitcherMenu.tsx
+++ b/apps/web/src/components/layout/ProjectSwitcherMenu.tsx
@@ -18,6 +18,7 @@ export default function ProjectSwitcherMenu({
workspaces,
workspace,
teams,
+ currentTeam,
scope,
onScopeChange,
onPickWorkspace,
@@ -30,6 +31,7 @@ export default function ProjectSwitcherMenu({
workspaces: WorkspaceSummary[];
workspace?: WorkspaceSummary;
teams: Team[];
+ currentTeam?: Team;
scope: ProjectSwitcherScope;
onScopeChange: (scope: ProjectSwitcherScope) => void;
onPickWorkspace: (workspaceId: number) => void;
@@ -73,6 +75,7 @@ export default function ProjectSwitcherMenu({
workspaces={workspaces}
workspace={workspace}
teams={teams}
+ currentTeam={currentTeam}
scope={scope}
onScopeChange={onScopeChange}
onPickWorkspace={onPickWorkspace}
diff --git a/apps/web/src/components/layout/ProjectSwitcherNav.tsx b/apps/web/src/components/layout/ProjectSwitcherNav.tsx
index 3ddeafa1..8b8447cf 100644
--- a/apps/web/src/components/layout/ProjectSwitcherNav.tsx
+++ b/apps/web/src/components/layout/ProjectSwitcherNav.tsx
@@ -5,7 +5,7 @@ import { useTranslations } from 'next-intl';
import { WorkspaceRailActions } from '@/cloud';
import type { Team } from '@/lib/api/endpoints/teams';
import type { WorkspaceSummary } from '@/lib/api/endpoints/workspaces';
-import { manageTeamsPath, workspacePath } from '@/utils/paths';
+import { manageTeamsPath, teamPath, workspacePath } from '@/utils/paths';
import { Button } from '@/components/ui/button';
import type { ProjectSwitcherScope } from './ProjectSwitcher';
import ProjectSwitcherNavScopes from './ProjectSwitcherNavScopes';
@@ -15,6 +15,7 @@ export default function ProjectSwitcherNav({
workspaces,
workspace,
teams,
+ currentTeam,
scope,
onScopeChange,
onPickWorkspace,
@@ -23,6 +24,7 @@ export default function ProjectSwitcherNav({
workspaces: WorkspaceSummary[];
workspace?: WorkspaceSummary;
teams: Team[];
+ currentTeam?: Team;
scope: ProjectSwitcherScope;
onScopeChange: (scope: ProjectSwitcherScope) => void;
onPickWorkspace: (workspaceId: number) => void;
@@ -60,14 +62,17 @@ export default function ProjectSwitcherNav({
)}
<div className="mt-auto flex flex-col gap-0.5 border-t pt-2">
<Button asChild variant="ghost" size="sm" className="justify-start font-normal">
- <Link href={manageTeamsPath()} onClick={onClose}>
+ <Link
+ href={currentTeam ? teamPath(currentTeam.ref) : manageTeamsPath()}
+ onClick={onClose}
+ >
<Users />
{t('manageTeams')}
</Link>
</Button>
{workspace?.role && (
<Button asChild variant="ghost" size="sm" className="justify-start font-normal">
- <Link href={workspacePath(workspace.id)} onClick={onClose}>
+ <Link href={workspacePath(workspace.id, 'info')} onClick={onClose}>
<Settings2 />
{t('projectPicker.workspaceSettings')}
</Link>