Spaces:
Running
Running
Fabio Antonini Claude Sonnet 4.6 commited on
Commit ·
ad2e396
1
Parent(s): 6cecbb6
fix: sidebar UX — move Projects under Agent, remove duplicate + in New chat
Browse files- Rename nav.agent_projects to "Projects" / "Progetti" (shorter label)
- Move the Projects collapsible section directly below the Agente Documentale
link instead of at the bottom of the nav
- Remove leading "+ " from agent.new_chat i18n keys — the button already
renders a Plus icon, causing a double "+" in the UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
frontend/src/components/layout/Sidebar.tsx
CHANGED
|
@@ -113,11 +113,10 @@ export default function Sidebar() {
|
|
| 113 |
|
| 114 |
{/* Main nav */}
|
| 115 |
<nav className="flex-1 space-y-0.5 overflow-y-auto">
|
| 116 |
-
{links.map(({ to, label, icon: Icon }) => (
|
| 117 |
<NavLink
|
| 118 |
key={to}
|
| 119 |
to={to}
|
| 120 |
-
end={to === "/agent"}
|
| 121 |
className={({ isActive }) =>
|
| 122 |
cn(
|
| 123 |
"flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
|
@@ -132,7 +131,24 @@ export default function Sidebar() {
|
|
| 132 |
</NavLink>
|
| 133 |
))}
|
| 134 |
|
| 135 |
-
{/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
<div className="pt-1">
|
| 137 |
<button
|
| 138 |
onClick={() => setAgentExpanded(v => !v)}
|
|
@@ -186,6 +202,25 @@ export default function Sidebar() {
|
|
| 186 |
)}
|
| 187 |
</div>
|
| 188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
{user?.role === "admin" && (
|
| 190 |
<>
|
| 191 |
<div className="my-2 border-t" />
|
|
|
|
| 113 |
|
| 114 |
{/* Main nav */}
|
| 115 |
<nav className="flex-1 space-y-0.5 overflow-y-auto">
|
| 116 |
+
{links.filter(l => l.to !== "/agent").slice(0, links.findIndex(l => l.to === "/agent")).map(({ to, label, icon: Icon }) => (
|
| 117 |
<NavLink
|
| 118 |
key={to}
|
| 119 |
to={to}
|
|
|
|
| 120 |
className={({ isActive }) =>
|
| 121 |
cn(
|
| 122 |
"flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
|
|
|
| 131 |
</NavLink>
|
| 132 |
))}
|
| 133 |
|
| 134 |
+
{/* Agente Documentale link */}
|
| 135 |
+
<NavLink
|
| 136 |
+
to="/agent"
|
| 137 |
+
end
|
| 138 |
+
className={({ isActive }) =>
|
| 139 |
+
cn(
|
| 140 |
+
"flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
| 141 |
+
isActive
|
| 142 |
+
? "bg-primary/10 text-primary"
|
| 143 |
+
: "text-muted-foreground hover:bg-muted hover:text-foreground"
|
| 144 |
+
)
|
| 145 |
+
}
|
| 146 |
+
>
|
| 147 |
+
<Bot className="h-4 w-4" />
|
| 148 |
+
{t("nav.agent")}
|
| 149 |
+
</NavLink>
|
| 150 |
+
|
| 151 |
+
{/* Agent projects sub-section — directly under Agente Documentale */}
|
| 152 |
<div className="pt-1">
|
| 153 |
<button
|
| 154 |
onClick={() => setAgentExpanded(v => !v)}
|
|
|
|
| 202 |
)}
|
| 203 |
</div>
|
| 204 |
|
| 205 |
+
{/* Remaining main nav links (RAG, Compliance, …) */}
|
| 206 |
+
{links.filter(l => l.to !== "/agent").slice(links.findIndex(l => l.to === "/agent")).map(({ to, label, icon: Icon }) => (
|
| 207 |
+
<NavLink
|
| 208 |
+
key={to}
|
| 209 |
+
to={to}
|
| 210 |
+
className={({ isActive }) =>
|
| 211 |
+
cn(
|
| 212 |
+
"flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
| 213 |
+
isActive
|
| 214 |
+
? "bg-primary/10 text-primary"
|
| 215 |
+
: "text-muted-foreground hover:bg-muted hover:text-foreground"
|
| 216 |
+
)
|
| 217 |
+
}
|
| 218 |
+
>
|
| 219 |
+
<Icon className="h-4 w-4" />
|
| 220 |
+
{t(label)}
|
| 221 |
+
</NavLink>
|
| 222 |
+
))}
|
| 223 |
+
|
| 224 |
{user?.role === "admin" && (
|
| 225 |
<>
|
| 226 |
<div className="my-2 border-t" />
|
frontend/src/i18n/en.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"nav": {
|
| 7 |
"projects": "Cases",
|
| 8 |
"agent": "Document Agent",
|
| 9 |
-
"agent_projects": "
|
| 10 |
"rag": "AI Consultant",
|
| 11 |
"compliance": "ENFSI Compliance",
|
| 12 |
"admin": "Administration",
|
|
@@ -85,7 +85,7 @@
|
|
| 85 |
"analyze_document": "Analyze document",
|
| 86 |
"project": "Project",
|
| 87 |
"new_project": "New project",
|
| 88 |
-
"new_chat": "
|
| 89 |
"no_projects": "No projects yet",
|
| 90 |
"no_chats": "No chats yet",
|
| 91 |
"no_documents": "No documents yet",
|
|
|
|
| 6 |
"nav": {
|
| 7 |
"projects": "Cases",
|
| 8 |
"agent": "Document Agent",
|
| 9 |
+
"agent_projects": "Projects",
|
| 10 |
"rag": "AI Consultant",
|
| 11 |
"compliance": "ENFSI Compliance",
|
| 12 |
"admin": "Administration",
|
|
|
|
| 85 |
"analyze_document": "Analyze document",
|
| 86 |
"project": "Project",
|
| 87 |
"new_project": "New project",
|
| 88 |
+
"new_chat": "New chat",
|
| 89 |
"no_projects": "No projects yet",
|
| 90 |
"no_chats": "No chats yet",
|
| 91 |
"no_documents": "No documents yet",
|
frontend/src/i18n/it.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"nav": {
|
| 7 |
"projects": "Perizie",
|
| 8 |
"agent": "Agente Documentale",
|
| 9 |
-
"agent_projects": "Progetti
|
| 10 |
"rag": "Consulente IA",
|
| 11 |
"compliance": "Conformità ENFSI",
|
| 12 |
"admin": "Amministrazione",
|
|
@@ -85,7 +85,7 @@
|
|
| 85 |
"analyze_document": "Analizza documento",
|
| 86 |
"project": "Progetto",
|
| 87 |
"new_project": "Nuovo progetto",
|
| 88 |
-
"new_chat": "
|
| 89 |
"no_projects": "Nessun progetto",
|
| 90 |
"no_chats": "Nessuna chat",
|
| 91 |
"no_documents": "Nessun documento",
|
|
|
|
| 6 |
"nav": {
|
| 7 |
"projects": "Perizie",
|
| 8 |
"agent": "Agente Documentale",
|
| 9 |
+
"agent_projects": "Progetti",
|
| 10 |
"rag": "Consulente IA",
|
| 11 |
"compliance": "Conformità ENFSI",
|
| 12 |
"admin": "Amministrazione",
|
|
|
|
| 85 |
"analyze_document": "Analizza documento",
|
| 86 |
"project": "Progetto",
|
| 87 |
"new_project": "Nuovo progetto",
|
| 88 |
+
"new_chat": "Nuova chat",
|
| 89 |
"no_projects": "Nessun progetto",
|
| 90 |
"no_chats": "Nessuna chat",
|
| 91 |
"no_documents": "Nessun documento",
|