mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-08 20:58:45 +02:00
refactor: group settings nav into AI Provider and Orchestration sections
Adds section headers to the left sidebar navigation so future settings items slot naturally under the right category. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { ChevronLeft, ChevronRight, Cpu, Layers, Plus } from 'lucide-react';
|
import { ChevronLeft, ChevronRight, Cpu, Layers, Plus, Workflow } from 'lucide-react';
|
||||||
|
|
||||||
import type { ModelDefinition } from '@shared/domain/models';
|
import type { ModelDefinition } from '@shared/domain/models';
|
||||||
import type { PatternDefinition } from '@shared/domain/pattern';
|
import type { PatternDefinition } from '@shared/domain/pattern';
|
||||||
@@ -27,9 +27,24 @@ interface NavItem {
|
|||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const navItems: NavItem[] = [
|
interface NavGroup {
|
||||||
{ id: 'connection', label: 'Connection', icon: <Cpu className="size-4" /> },
|
label: string;
|
||||||
{ id: 'patterns', label: 'Patterns', icon: <Layers className="size-4" /> },
|
items: NavItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const navGroups: NavGroup[] = [
|
||||||
|
{
|
||||||
|
label: 'AI Provider',
|
||||||
|
items: [
|
||||||
|
{ id: 'connection', label: 'Connection', icon: <Cpu className="size-3.5" /> },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Orchestration',
|
||||||
|
items: [
|
||||||
|
{ id: 'patterns', label: 'Patterns', icon: <Workflow className="size-3.5" /> },
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function modeBadgeClasses(pattern: PatternDefinition) {
|
function modeBadgeClasses(pattern: PatternDefinition) {
|
||||||
@@ -97,25 +112,34 @@ export function SettingsPanel({
|
|||||||
<div className="flex min-h-0 flex-1">
|
<div className="flex min-h-0 flex-1">
|
||||||
{/* Left navigation */}
|
{/* Left navigation */}
|
||||||
<nav className="w-52 shrink-0 border-r border-[var(--color-border)] bg-[var(--color-surface-1)] p-3">
|
<nav className="w-52 shrink-0 border-r border-[var(--color-border)] bg-[var(--color-surface-1)] p-3">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-4">
|
||||||
{navItems.map((item) => {
|
{navGroups.map((group) => (
|
||||||
const isActive = item.id === activeSection;
|
<div key={group.label}>
|
||||||
return (
|
<span className="mb-1 block px-3 text-[10px] font-semibold uppercase tracking-wider text-zinc-600">
|
||||||
<button
|
{group.label}
|
||||||
className={`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-[13px] transition ${
|
</span>
|
||||||
isActive
|
<div className="space-y-0.5">
|
||||||
? 'bg-zinc-800 font-medium text-zinc-100'
|
{group.items.map((item) => {
|
||||||
: 'text-zinc-400 hover:bg-zinc-800/50 hover:text-zinc-300'
|
const isActive = item.id === activeSection;
|
||||||
}`}
|
return (
|
||||||
key={item.id}
|
<button
|
||||||
onClick={() => setActiveSection(item.id)}
|
className={`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-[13px] transition ${
|
||||||
type="button"
|
isActive
|
||||||
>
|
? 'bg-zinc-800 font-medium text-zinc-100'
|
||||||
<span className={isActive ? 'text-zinc-300' : 'text-zinc-500'}>{item.icon}</span>
|
: 'text-zinc-400 hover:bg-zinc-800/50 hover:text-zinc-300'
|
||||||
{item.label}
|
}`}
|
||||||
</button>
|
key={item.id}
|
||||||
);
|
onClick={() => setActiveSection(item.id)}
|
||||||
})}
|
type="button"
|
||||||
|
>
|
||||||
|
<span className={isActive ? 'text-zinc-300' : 'text-zinc-500'}>{item.icon}</span>
|
||||||
|
{item.label}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user