Skip to content

Commit 198e423

Browse files
Stephen Belangerclaude
andcommitted
Use SettingSectionNav in AgentConfig, add responsive wrapper
Replace inline two-group sidebar with shared SettingSectionNav component. Outer wrapper gains flex-col md:flex-row for responsive stacking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a47f7ed commit 198e423

File tree

1 file changed

+26
-46
lines changed

1 file changed

+26
-46
lines changed

interface/src/routes/AgentConfig.tsx

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useCallback, useEffect, useState, useRef } from "react";
22
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
33
import { api, type AgentConfigResponse, type AgentConfigUpdateRequest } from "@/api/client";
4-
import { Button, SettingSidebarButton, Input, TextArea, Toggle, NumberStepper, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, cx } from "@/ui";
4+
import { Button, Input, TextArea, Toggle, NumberStepper, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, cx } from "@/ui";
5+
import {SettingSectionNav} from "@/components/SettingSectionNav";
56
import { ModelSelect } from "@/components/ModelSelect";
67
import { Markdown } from "@/components/Markdown";
78
import { motion, AnimatePresence } from "framer-motion";
@@ -146,51 +147,30 @@ export function AgentConfig({ agentId }: AgentConfigProps) {
146147
const isIdentitySection = active.group === "identity";
147148

148149
return (
149-
<div className="flex h-full relative">
150-
{/* Sidebar */}
151-
<div className="flex w-52 flex-shrink-0 flex-col border-r border-app-line/50 bg-app-darkBox/20 overflow-y-auto">
152-
{/* Identity Group */}
153-
<div className="px-3 pb-1 pt-4">
154-
<span className="text-tiny font-medium uppercase tracking-wider text-ink-faint">Identity</span>
155-
</div>
156-
<div className="flex flex-col gap-0.5 px-2">
157-
{SECTIONS.filter((s) => s.group === "identity").map((section) => {
158-
const isActive = activeSection === section.id;
159-
const hasContent = !!getIdentityField(identityQuery.data ?? { soul: null, identity: null, user: null }, section.id)?.trim();
160-
return (
161-
<SettingSidebarButton
162-
key={section.id}
163-
onClick={() => handleSectionChange(section.id)}
164-
active={isActive}
165-
>
166-
<span className="flex-1">{section.label}</span>
167-
{!hasContent && (
168-
<span className="rounded bg-amber-500/10 px-1 py-0.5 text-tiny text-amber-400/70">empty</span>
169-
)}
170-
</SettingSidebarButton>
171-
);
172-
})}
173-
</div>
174-
175-
{/* Config Group */}
176-
<div className="px-3 pb-1 pt-4 mt-2">
177-
<span className="text-tiny font-medium uppercase tracking-wider text-ink-faint">Configuration</span>
178-
</div>
179-
<div className="flex flex-col gap-0.5 px-2">
180-
{SECTIONS.filter((s) => s.group === "config").map((section) => {
181-
const isActive = activeSection === section.id;
182-
return (
183-
<SettingSidebarButton
184-
key={section.id}
185-
onClick={() => handleSectionChange(section.id)}
186-
active={isActive}
187-
>
188-
<span className="flex-1">{section.label}</span>
189-
</SettingSidebarButton>
190-
);
191-
})}
192-
</div>
193-
</div>
150+
<div className="flex h-full flex-col md:flex-row relative">
151+
<SettingSectionNav
152+
groups={[
153+
{
154+
label: "Identity",
155+
sections: SECTIONS.filter((s) => s.group === "identity").map((s) => ({
156+
id: s.id,
157+
label: s.label,
158+
badge: !getIdentityField(identityQuery.data ?? {soul: null, identity: null, user: null}, s.id)?.trim()
159+
? <span className="rounded bg-amber-500/10 px-1 py-0.5 text-tiny text-amber-400/70">empty</span>
160+
: undefined,
161+
})),
162+
},
163+
{
164+
label: "Configuration",
165+
sections: SECTIONS.filter((s) => s.group === "config").map((s) => ({
166+
id: s.id,
167+
label: s.label,
168+
})),
169+
},
170+
]}
171+
activeSection={activeSection}
172+
onSectionChange={(id) => handleSectionChange(id as SectionId)}
173+
/>
194174

195175
{/* Editor */}
196176
<div className="flex flex-1 flex-col overflow-hidden">

0 commit comments

Comments
 (0)