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:
Khalid Abdi
2026-06-18 19:53:31 +03:00
parent 9a913147fb
commit 67cafdac3d
4 changed files with 20 additions and 9 deletions
+4 -1
View File
@@ -76,7 +76,10 @@ export function CommandPaletteProvider({ children }: { children: ReactNode }) {
// Filtered by role so reception can't jump to clinical pages, and by
// the AI kill-switch so the disabled chat isn't listed.
items: visibleNavItems(role)
.filter((item) => aiAllowed || item.id !== "new-chat")
.filter(
(item) =>
aiAllowed || (item.id !== "new-chat" && item.id !== "analysis"),
)
.flatMap((item) =>
item.subs?.length
? item.subs.map((sub) => ({