From e4ec08a5ef3b25fb2f1918eec8d2c2cea0f99374 Mon Sep 17 00:00:00 2001 From: BOHA Date: Mon, 8 Jun 2026 18:38:35 +0200 Subject: [PATCH] feat(ai): move the assistant to its own "Odin" sidebar page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Promote the AI chat from a dashboard widget to a dedicated page: - new sidebar item "Odin" under the Přehled section, gated on ai.use, → /odin - new /odin route + Odin page (reuses the assistant component, with a light ai.use guard) - remove the widget from the dashboard - rebrand the assistant header "Asistent" → "Odin" and give the thread more height now that it owns the page Co-Authored-By: Claude Opus 4.8 (1M context) --- src/admin/AdminApp.tsx | 2 ++ .../components/dashboard/DashAssistant.tsx | 6 ++--- src/admin/pages/Dashboard.tsx | 4 --- src/admin/pages/Odin.tsx | 27 +++++++++++++++++++ src/admin/ui/navData.tsx | 16 +++++++++++ 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 src/admin/pages/Odin.tsx diff --git a/src/admin/AdminApp.tsx b/src/admin/AdminApp.tsx index 77d6bde..4dcd98f 100644 --- a/src/admin/AdminApp.tsx +++ b/src/admin/AdminApp.tsx @@ -12,6 +12,7 @@ import { LoadingState } from "./ui"; import Login from "./pages/Login"; import Dashboard from "./pages/Dashboard"; +const Odin = lazy(() => import("./pages/Odin")); const Users = lazy(() => import("./pages/Users")); const Attendance = lazy(() => import("./pages/Attendance")); const AttendanceHistory = lazy(() => import("./pages/AttendanceHistory")); @@ -82,6 +83,7 @@ export default function AdminApp() { )} }> } /> + } /> } /> } /> - Asistent + Odin @@ -393,8 +393,8 @@ export default function DashAssistant() { display: "flex", flexDirection: "column", gap: 1, - minHeight: 120, - maxHeight: 360, + minHeight: 200, + maxHeight: 480, overflowY: "auto", mb: 1.5, p: 1, diff --git a/src/admin/pages/Dashboard.tsx b/src/admin/pages/Dashboard.tsx index d4fcbd1..2f95e8a 100644 --- a/src/admin/pages/Dashboard.tsx +++ b/src/admin/pages/Dashboard.tsx @@ -22,7 +22,6 @@ import DashSessions from "../components/dashboard/DashSessions"; import DashTodayPlan, { type TodayPlan, } from "../components/dashboard/DashTodayPlan"; -import DashAssistant from "../components/dashboard/DashAssistant"; const API_BASE = "/api/admin"; @@ -237,9 +236,6 @@ export default function Dashboard() { - {/* AI Assistant widget */} - {hasPermission("ai.use") && } - {/* 2FA Required Banner */} {user?.require2FA && !user?.totpEnabled && ( + + Nemáte oprávnění pro AI asistenta. + + + ); + } + + return ( + + + + + + ); +} diff --git a/src/admin/ui/navData.tsx b/src/admin/ui/navData.tsx index 55025b7..712e5ad 100644 --- a/src/admin/ui/navData.tsx +++ b/src/admin/ui/navData.tsx @@ -38,6 +38,22 @@ export const menuSections: MenuSection[] = [ ), }, + { + path: "/odin", + label: "Odin", + permission: "ai.use", + end: true, + icon: ( + + + + ), + }, ], }, {