mirror of
https://github.com/temetro/temetro.git
synced 2026-08-19 14:46:29 +00:00
frontend: make AI kill-switch a true clinic-wide master switch
The "Enable AI assistant" toggle already disabled the AI for everyone (including owners/admins) at the policy layer, but the copy read as an employee-only control and the Analysis surface stayed visible. Clarify that the master switch covers admins too, and close the gaps: hide the Analysis nav/command entry and redirect /analysis (alongside the chat home) to /patients when AI is disabled. The employee-only toggle remains the secondary option that keeps AI for owners/admins. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,12 @@ export function DashboardSidebar() {
|
||||
const isCollapsed = state === "collapsed";
|
||||
|
||||
// Hide clinical nav from non-clinical roles (e.g. reception). See lib/roles.ts.
|
||||
// Also drop the AI "New chat" entry when the clinic's AI kill-switch applies.
|
||||
// Also drop the AI surfaces ("New chat" + "Analysis") when the clinic's AI
|
||||
// kill-switch applies — a full disable hides them for owners/admins too.
|
||||
const dashboardRoutes: Route[] = visibleNavItems(role)
|
||||
.filter((item) => aiAllowed || item.id !== "new-chat")
|
||||
.filter(
|
||||
(item) => aiAllowed || (item.id !== "new-chat" && item.id !== "analysis"),
|
||||
)
|
||||
.map((item) => ({
|
||||
id: item.id,
|
||||
title: t(item.labelKey),
|
||||
|
||||
Reference in New Issue
Block a user