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.

feat(web): move AI configuration into the AI Team sidebar group (#63)

Croff32a1a9631d16
diff --git a/apps/web/src/components/layout/AppSidebar.tsx b/apps/web/src/components/layout/AppSidebar.tsx
index dc5d8ff8..b1582784 100644
--- a/apps/web/src/components/layout/AppSidebar.tsx
+++ b/apps/web/src/components/layout/AppSidebar.tsx
@@ -53,8 +53,8 @@ export default function AppSidebar({
const isGod = mounted && session?.user.role === 'god';
// Settings mode is on whenever the route matches one of the settings nav items.
- // Members and the AI Team Schedules page are not in those groups, so they keep
- // the main sidebar.
+ // Members and the AI Team pages are not in those groups, so they keep the main
+ // sidebar.
const settingsNav = useSettingsNavGroups(currentProjectKey);
const settingsMode = settingsNav.groups.some((g) => g.items.some((i) => i.active));
const onApiDocs = pathname.endsWith('/api');
diff --git a/apps/web/src/components/layout/GodSidebar.tsx b/apps/web/src/components/layout/GodSidebar.tsx
index 1460b78f..bc45c13b 100644
--- a/apps/web/src/components/layout/GodSidebar.tsx
+++ b/apps/web/src/components/layout/GodSidebar.tsx
@@ -1,9 +1,9 @@
'use client';
import { usePathname } from 'next/navigation';
-import { ArrowLeft, Shield } from 'lucide-react';
+import { ArrowLeft, Plug, Shield } from 'lucide-react';
import { godPath } from '@/utils/paths';
-import { GOD_GROUPS, godSectionsIn } from '@/utils/godSections';
+import { GOD_GROUPS, godIntegrationsIn, godSectionsIn } from '@/utils/godSections';
import {
Sidebar,
SidebarContent,
@@ -18,14 +18,14 @@ import {
SidebarRail,
SidebarSeparator,
} from '@/components/ui/sidebar';
-import IntegrationsNav from '@/components/layout/IntegrationsNav';
import SidebarNavItem from '@/components/layout/SidebarNavItem';
+import SidebarNavSubmenu from '@/components/layout/SidebarNavSubmenu';
import SidebarBrandFooter from '@/components/brand/SidebarBrandFooter';
// The sidebar in god mode. It mirrors the project settings sidebar — a list of
-// sections plus a way back, with the integration sections folded into a collapsible
-// item — but the header shows a static "God mode" badge instead of the project
-// switcher: nothing here is scoped to a project.
+// sections plus a way back, with the integration sections folded into one item —
+// but the header shows a static "God mode" badge instead of the project switcher:
+// nothing here is scoped to a project.
export default function GodSidebar() {
const pathname = usePathname();
@@ -64,26 +64,37 @@ export default function GodSidebar() {
</SidebarGroupContent>
</SidebarGroup>
- {GOD_GROUPS.map((group) => (
- <SidebarGroup key={group}>
- <SidebarGroupLabel>{group}</SidebarGroupLabel>
- <SidebarGroupContent>
- <SidebarMenu>
- {godSectionsIn(group).map((section) => (
- <SidebarNavItem
- key={section.slug}
- href={godPath(section.slug)}
- icon={section.icon}
- label={section.label}
- active={pathname.startsWith(`/god/${section.slug}`)}
- disabled={false}
- />
- ))}
- <IntegrationsNav group={group} pathname={pathname} />
- </SidebarMenu>
- </SidebarGroupContent>
- </SidebarGroup>
- ))}
+ {GOD_GROUPS.map((group) => {
+ const integrations = godIntegrationsIn(group).map((section) => ({
+ key: section.slug,
+ href: godPath(section.slug),
+ icon: section.icon,
+ label: section.label,
+ active: pathname.startsWith(`/god/${section.slug}`),
+ }));
+ return (
+ <SidebarGroup key={group}>
+ <SidebarGroupLabel>{group}</SidebarGroupLabel>
+ <SidebarGroupContent>
+ <SidebarMenu>
+ {godSectionsIn(group).map((section) => (
+ <SidebarNavItem
+ key={section.slug}
+ href={godPath(section.slug)}
+ icon={section.icon}
+ label={section.label}
+ active={pathname.startsWith(`/god/${section.slug}`)}
+ disabled={false}
+ />
+ ))}
+ {integrations.length > 0 && (
+ <SidebarNavSubmenu icon={Plug} label="Integrations" items={integrations} />
+ )}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+ );
+ })}
</SidebarContent>
<SidebarFooter>
diff --git a/apps/web/src/components/layout/IntegrationsNav.tsx b/apps/web/src/components/layout/IntegrationsNav.tsx
deleted file mode 100644
index 68ca6dae..00000000
--- a/apps/web/src/components/layout/IntegrationsNav.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-'use client';
-
-import Link from 'next/link';
-import { ChevronRight, Plug } from 'lucide-react';
-import { godPath } from '@/utils/paths';
-import { godIntegrationsIn, type GodGroup } from '@/utils/godSections';
-import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
-import {
- SidebarMenuButton,
- SidebarMenuItem,
- SidebarMenuSub,
- SidebarMenuSubButton,
- SidebarMenuSubItem,
-} from '@/components/ui/sidebar';
-
-// The integration sections of a group, folded into one collapsible item. It starts
-// open when the current page is one of them, so a reload keeps the section visible.
-export default function IntegrationsNav({
- group,
- pathname,
-}: {
- group: GodGroup;
- pathname: string;
-}) {
- const sections = godIntegrationsIn(group);
- if (sections.length === 0) return null;
-
- const isActive = (slug: string) => pathname.startsWith(`/god/${slug}`);
- const open = sections.some((s) => isActive(s.slug));
-
- return (
- <Collapsible defaultOpen={open} className="group/collapsible">
- <SidebarMenuItem>
- <CollapsibleTrigger asChild>
- <SidebarMenuButton tooltip="Integrations">
- <Plug />
- <span>Integrations</span>
- <ChevronRight className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
- </SidebarMenuButton>
- </CollapsibleTrigger>
- <CollapsibleContent>
- <SidebarMenuSub>
- {sections.map((section) => (
- <SidebarMenuSubItem key={section.slug}>
- <SidebarMenuSubButton asChild isActive={isActive(section.slug)}>
- <Link href={godPath(section.slug)}>
- <section.icon />
- <span>{section.label}</span>
- </Link>
- </SidebarMenuSubButton>
- </SidebarMenuSubItem>
- ))}
- </SidebarMenuSub>
- </CollapsibleContent>
- </SidebarMenuItem>
- </Collapsible>
- );
-}
diff --git a/apps/web/src/components/layout/SidebarAiTeamNav.tsx b/apps/web/src/components/layout/SidebarAiTeamNav.tsx
index c9324f25..38ffb732 100644
--- a/apps/web/src/components/layout/SidebarAiTeamNav.tsx
+++ b/apps/web/src/components/layout/SidebarAiTeamNav.tsx
@@ -1,7 +1,7 @@
import { usePathname } from 'next/navigation';
-import { MessagesSquare } from 'lucide-react';
-import { aiChatPath, aiTeamPath } from '@/utils/paths';
-import { AI_TEAM_SECTIONS } from '@/utils/settingsSections';
+import { MessagesSquare, SlidersHorizontal } from 'lucide-react';
+import { aiChatPath, aiSectionPath, aiTeamPath } from '@/utils/paths';
+import { AI_SECTIONS, AI_TEAM_SECTIONS } from '@/utils/settingsSections';
import { usePermissions } from '@/hooks/usePermissions';
import {
SidebarGroup,
@@ -10,17 +10,26 @@ import {
SidebarMenu,
} from '@/components/ui/sidebar';
import SidebarNavItem from '@/components/layout/SidebarNavItem';
+import SidebarNavSubmenu from '@/components/layout/SidebarNavSubmenu';
-// The AI Team sidebar group: the chat plus the AI Team sections the viewer may
-// read. Renders nothing when none of them are readable.
+// The AI Team sidebar group: the chat, the AI Team sections the viewer may read,
+// and the "Configure" item holding the AI configuration sections. Renders nothing
+// when none of them are readable.
export default function SidebarAiTeamNav({ projectKey }: { projectKey: string | null }) {
const pathname = usePathname();
const { can } = usePermissions();
const disabled = !projectKey;
const sections = AI_TEAM_SECTIONS.filter((s) => can(s.resource, 'read'));
+ const configureItems = AI_SECTIONS.filter((s) => can(s.resource, 'read')).map((s) => ({
+ key: s.slug,
+ href: projectKey ? aiSectionPath(projectKey, s.slug) : '#',
+ icon: s.icon,
+ label: s.label,
+ active: pathname.endsWith(`/${s.slug}`),
+ }));
const canChat = can('ai_agents', 'read');
- if (!canChat && sections.length === 0) return null;
+ if (!canChat && sections.length === 0 && configureItems.length === 0) return null;
return (
<SidebarGroup>
@@ -46,6 +55,9 @@ export default function SidebarAiTeamNav({ projectKey }: { projectKey: string |
disabled={disabled}
/>
))}
+ {configureItems.length > 0 && (
+ <SidebarNavSubmenu icon={SlidersHorizontal} label="Configure" items={configureItems} />
+ )}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
diff --git a/apps/web/src/components/layout/SidebarNavSubmenu.tsx b/apps/web/src/components/layout/SidebarNavSubmenu.tsx
new file mode 100644
index 00000000..344dfea3
--- /dev/null
+++ b/apps/web/src/components/layout/SidebarNavSubmenu.tsx
@@ -0,0 +1,34 @@
+'use client';
+
+import type { LucideIcon } from 'lucide-react';
+import { useSidebar } from '@/components/ui/sidebar';
+import SidebarNavSubmenuCollapsible from '@/components/layout/SidebarNavSubmenuCollapsible';
+import SidebarNavSubmenuMenu from '@/components/layout/SidebarNavSubmenuMenu';
+
+export type SidebarNavSubmenuItem = {
+ key: string;
+ href: string;
+ icon: LucideIcon;
+ label: string;
+ active: boolean;
+};
+
+// A sidebar item holding a sub-list of links. Collapsed to icons there is no room
+// for a sub-list, so it becomes a dropdown; the mobile sidebar is a sheet at full
+// width, never icon-sized.
+export default function SidebarNavSubmenu({
+ icon,
+ label,
+ items,
+}: {
+ icon: LucideIcon;
+ label: string;
+ items: SidebarNavSubmenuItem[];
+}) {
+ const { state, isMobile } = useSidebar();
+
+ if (state === 'collapsed' && !isMobile)
+ return <SidebarNavSubmenuMenu icon={icon} label={label} items={items} />;
+
+ return <SidebarNavSubmenuCollapsible icon={icon} label={label} items={items} />;
+}
diff --git a/apps/web/src/components/layout/SidebarNavSubmenuCollapsible.tsx b/apps/web/src/components/layout/SidebarNavSubmenuCollapsible.tsx
new file mode 100644
index 00000000..d9fa127f
--- /dev/null
+++ b/apps/web/src/components/layout/SidebarNavSubmenuCollapsible.tsx
@@ -0,0 +1,51 @@
+import Link from 'next/link';
+import { ChevronRight, type LucideIcon } from 'lucide-react';
+import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
+import {
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SidebarMenuSub,
+ SidebarMenuSubButton,
+ SidebarMenuSubItem,
+} from '@/components/ui/sidebar';
+import type { SidebarNavSubmenuItem } from '@/components/layout/SidebarNavSubmenu';
+
+// The expanded form of SidebarNavSubmenu. It starts open when the current page is
+// one of its items, so a reload keeps the sub-list visible.
+export default function SidebarNavSubmenuCollapsible({
+ icon: Icon,
+ label,
+ items,
+}: {
+ icon: LucideIcon;
+ label: string;
+ items: SidebarNavSubmenuItem[];
+}) {
+ return (
+ <Collapsible asChild defaultOpen={items.some((i) => i.active)} className="group/collapsible">
+ <SidebarMenuItem>
+ <CollapsibleTrigger asChild>
+ <SidebarMenuButton>
+ <Icon />
+ <span>{label}</span>
+ <ChevronRight className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
+ </SidebarMenuButton>
+ </CollapsibleTrigger>
+ <CollapsibleContent>
+ <SidebarMenuSub>
+ {items.map((item) => (
+ <SidebarMenuSubItem key={item.key}>
+ <SidebarMenuSubButton asChild isActive={item.active}>
+ <Link href={item.href}>
+ <item.icon />
+ <span>{item.label}</span>
+ </Link>
+ </SidebarMenuSubButton>
+ </SidebarMenuSubItem>
+ ))}
+ </SidebarMenuSub>
+ </CollapsibleContent>
+ </SidebarMenuItem>
+ </Collapsible>
+ );
+}
diff --git a/apps/web/src/components/layout/SidebarNavSubmenuMenu.tsx b/apps/web/src/components/layout/SidebarNavSubmenuMenu.tsx
new file mode 100644
index 00000000..2874d9d6
--- /dev/null
+++ b/apps/web/src/components/layout/SidebarNavSubmenuMenu.tsx
@@ -0,0 +1,46 @@
+import Link from 'next/link';
+import type { LucideIcon } from 'lucide-react';
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuTrigger,
+} from '@/components/ui/dropdown-menu';
+import { SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
+import type { SidebarNavSubmenuItem } from '@/components/layout/SidebarNavSubmenu';
+
+// The icon-collapsed form of SidebarNavSubmenu: the items fly out to the side.
+export default function SidebarNavSubmenuMenu({
+ icon: Icon,
+ label,
+ items,
+}: {
+ icon: LucideIcon;
+ label: string;
+ items: SidebarNavSubmenuItem[];
+}) {
+ return (
+ <SidebarMenuItem>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <SidebarMenuButton tooltip={label} isActive={items.some((i) => i.active)}>
+ <Icon />
+ <span>{label}</span>
+ </SidebarMenuButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="min-w-48 rounded-lg" align="start" side="right">
+ <DropdownMenuLabel className="text-xs text-muted-foreground">{label}</DropdownMenuLabel>
+ {items.map((item) => (
+ <DropdownMenuItem key={item.key} asChild className="gap-2">
+ <Link href={item.href}>
+ <item.icon />
+ <span>{item.label}</span>
+ </Link>
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </SidebarMenuItem>
+ );
+}
diff --git a/apps/web/src/hooks/useNavigationCommands.tsx b/apps/web/src/hooks/useNavigationCommands.tsx
index c5e58d3c..0dcbb2fc 100644
--- a/apps/web/src/hooks/useNavigationCommands.tsx
+++ b/apps/web/src/hooks/useNavigationCommands.tsx
@@ -15,6 +15,7 @@ import {
import { useSession } from '@/lib/auth-client';
import {
aiChatPath,
+ aiSectionPath,
aiTeamPath,
apiDocsPath,
dashboardsPath,
@@ -28,7 +29,7 @@ import {
projectPath,
} from '@/utils/paths';
import { ACCOUNT_SECTIONS, accountPath } from '@/utils/accountSections';
-import { AI_TEAM_SECTIONS } from '@/utils/settingsSections';
+import { AI_SECTIONS, AI_TEAM_SECTIONS } from '@/utils/settingsSections';
import { GOD_SECTIONS } from '@/utils/godSections';
import { usePermissions } from '@/hooks/usePermissions';
import { useProjectFeatures } from '@/hooks/useProjectFeatures';
@@ -69,6 +70,16 @@ export function useNavigationCommands(projectKey: string | null): CommandSection
if (can(s.resource, 'read'))
add(`nav.ai-team.${s.slug}`, s.label, <s.icon />, aiTeamPath(key, s.slug), 'ai team');
}
+ for (const s of AI_SECTIONS) {
+ if (can(s.resource, 'read'))
+ add(
+ `nav.ai.${s.slug}`,
+ s.label,
+ <s.icon />,
+ aiSectionPath(key, s.slug),
+ 'ai team configure',
+ );
+ }
add('nav.members', 'Members', <Users />, membersPath(key), 'team people invite');
add(
'nav.notifications',
diff --git a/apps/web/src/hooks/useSettingsNavGroups.ts b/apps/web/src/hooks/useSettingsNavGroups.ts
index be9ea479..ef276305 100644
--- a/apps/web/src/hooks/useSettingsNavGroups.ts
+++ b/apps/web/src/hooks/useSettingsNavGroups.ts
@@ -1,15 +1,7 @@
import { usePathname } from 'next/navigation';
import { Shield, type LucideIcon } from 'lucide-react';
+import { rolesPath, settingsPath } from '@/utils/paths';
import {
- aiAgentsPath,
- agentSkillsPath,
- agentToolsPath,
- integrationsPath,
- rolesPath,
- settingsPath,
-} from '@/utils/paths';
-import {
- AI_SECTIONS,
AUTOMATION_SECTIONS,
CONFIGURATION_SECTIONS,
GENERAL_SECTIONS,
@@ -38,15 +30,6 @@ export type SettingsNavGroup = {
items: SettingsNavItem[];
};
-// The route each AI section slug navigates to (AI items are their own nav routes,
-// not /settings/:slug pages).
-const AI_SECTION_PATH: Record<string, (key: string) => string> = {
- 'ai-agents': aiAgentsPath,
- integrations: integrationsPath,
- 'agent-skills': agentSkillsPath,
- 'agent-tools': agentToolsPath,
-};
-
// `project` is only passed by the Shell, which calls this above its own context
// provider; everything else reads the project from the context.
export function useSettingsNavGroups(
@@ -59,27 +42,21 @@ export function useSettingsNavGroups(
const pathname = usePathname();
const { can, isOwner } = usePermissions(project);
- // The readable sections of one group as nav items. `activeBase` is the path
- // segment the slug is appended to when matching the current route.
- const toItems = (
- sections: SettingsSection[],
- hrefFor: (key: string, slug: string) => string,
- activeBase: string,
- ): SettingsNavItem[] =>
+ // The readable sections of one group as nav items.
+ const toItems = (sections: SettingsSection[]): SettingsNavItem[] =>
sections
.filter((s) => can(s.resource, 'read'))
.map((s) => ({
key: s.slug,
- href: projectKey ? hrefFor(projectKey, s.slug) : '#',
+ href: projectKey ? settingsPath(projectKey, s.slug) : '#',
icon: s.icon,
label: s.label,
- active: pathname.endsWith(`${activeBase}/${s.slug}`),
+ active: pathname.endsWith(`/settings/${s.slug}`),
}));
- const aiItems = toItems(AI_SECTIONS, (key, slug) => AI_SECTION_PATH[slug](key), '');
- const generalItems = toItems(GENERAL_SECTIONS, settingsPath, '/settings');
- const workflowItems = toItems(CONFIGURATION_SECTIONS, settingsPath, '/settings');
- const automationItems = toItems(AUTOMATION_SECTIONS, settingsPath, '/settings');
+ const generalItems = toItems(GENERAL_SECTIONS);
+ const workflowItems = toItems(CONFIGURATION_SECTIONS);
+ const automationItems = toItems(AUTOMATION_SECTIONS);
// Roles is owner-only and sits in the Project group; Members lives in the main
// sidebar, not here.
@@ -97,7 +74,6 @@ export function useSettingsNavGroups(
const groups: SettingsNavGroup[] = [
{ key: 'general', label: 'Project', items: [...generalItems, ...rolesItems] },
- { key: 'ai', label: 'AI Team', items: aiItems },
{ key: 'workflow', label: 'Workflow', items: workflowItems },
{ key: 'automation', label: 'Automation', items: automationItems },
].filter((g) => g.items.length > 0);
diff --git a/apps/web/src/utils/godSections.ts b/apps/web/src/utils/godSections.ts
index a9697666..ed8ce20b 100644
--- a/apps/web/src/utils/godSections.ts
+++ b/apps/web/src/utils/godSections.ts
@@ -14,7 +14,7 @@ import {
// (one slug per page under /god/<slug>), so adding one is an entry here plus a page.
// `group` is the sidebar heading a section sits under; GOD_GROUPS gives the order.
// A section with `integration: true` is not listed under its group directly: it sits
-// inside the collapsible "Integrations" item at the end of the group.
+// inside the "Integrations" item at the end of the group.
export const GOD_GROUPS = ['Management', 'Instance'] as const;
export type GodGroup = (typeof GOD_GROUPS)[number];
diff --git a/apps/web/src/utils/paths.ts b/apps/web/src/utils/paths.ts
index d8b60310..b65a5ec8 100644
--- a/apps/web/src/utils/paths.ts
+++ b/apps/web/src/utils/paths.ts
@@ -49,6 +49,17 @@ export const agentSkillsPath = (key: string) => `${projectPath(key)}/agent-skill
export const agentToolsPath = (key: string) => `${projectPath(key)}/agent-tools`;
+// The AI configuration sections (see AI_SECTIONS) keyed by slug. Each is its own
+// top-level route rather than a /settings/:slug page.
+const AI_SECTION_PATH: Record<string, (key: string) => string> = {
+ 'ai-agents': aiAgentsPath,
+ integrations: integrationsPath,
+ 'agent-skills': agentSkillsPath,
+ 'agent-tools': agentToolsPath,
+};
+
+export const aiSectionPath = (key: string, slug: string) => AI_SECTION_PATH[slug](key);
+
export const mcpServerPath = (key: string) => `${projectPath(key)}/mcp`;
export const apiDocsPath = (key: string) => `${projectPath(key)}/api`;
diff --git a/apps/web/src/utils/settingsSections.ts b/apps/web/src/utils/settingsSections.ts
index 1b639593..15b35f63 100644
--- a/apps/web/src/utils/settingsSections.ts
+++ b/apps/web/src/utils/settingsSections.ts
@@ -19,8 +19,9 @@ import type { PermissionResource } from '@/lib/api';
// The sidebar group a section is listed under: the project-level general
// settings, workflow configuration, automation/integrations, or the AI section
-// (agents, providers, skills). 'ai-team' sections are listed in the main sidebar's
-// AI Team group next to the chat, not in the project settings sidebar.
+// (agents, providers, skills). 'ai-team' and 'ai' sections are listed in the main
+// sidebar's AI Team group — 'ai-team' next to the chat, 'ai' inside the
+// "Configure" item — not in the project settings sidebar.
export type SettingsGroup = 'general' | 'configuration' | 'automation' | 'ai' | 'ai-team';
// The project settings sections, each mounted as its own page at
@@ -123,9 +124,9 @@ export const SETTINGS_SECTIONS: SettingsSection[] = [
},
];
-// The AI section items are their own nav routes (not /settings/:section pages), but
-// reuse the SettingsSection shape for their page header and permission resource.
-// They sit in the AI sidebar group and are all gated by the ai_agents resource.
+// The AI configuration items are their own nav routes (not /settings/:section
+// pages), but reuse the SettingsSection shape for their page header and permission
+// resource. They sit in the "Configure" item of the main sidebar's AI Team group.
export const AI_AGENTS_SECTION: SettingsSection = {
slug: 'ai-agents',
label: 'Agents',
@@ -163,10 +164,10 @@ export const AGENT_TOOLS_SECTION: SettingsSection = {
group: 'ai',
};
-// The AI section's nav items, in sidebar order.
+// The "Configure" nav items, in sidebar order.
export const AI_SECTIONS: SettingsSection[] = [
- AI_AGENTS_SECTION,
INTEGRATIONS_SECTION,
+ AI_AGENTS_SECTION,
AGENT_SKILLS_SECTION,
AGENT_TOOLS_SECTION,
];