From 1bcb4e75c4cf88165b3d003a95d573f48cd85d47 Mon Sep 17 00:00:00 2001 From: Taki Koutsomitis Date: Thu, 10 Sep 2026 15:31:27 -0400 Subject: [PATCH] Show the assistant to all signed-in users --- components/Notebook/NoteEditorLayout.tsx | 5 ++--- hooks/useNotebookChatSocket.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/Notebook/NoteEditorLayout.tsx b/components/Notebook/NoteEditorLayout.tsx index 660334a2c..e163dc046 100644 --- a/components/Notebook/NoteEditorLayout.tsx +++ b/components/Notebook/NoteEditorLayout.tsx @@ -111,7 +111,7 @@ export function NoteEditorLayout({ onAgentChatDockedChange }: NoteEditorLayoutPr searchParams?.get('tab') === 'details' ? 'details' : 'document' ); - // ---- AI assistant chat (gated to hub editors and moderators) ---- + // ---- AI assistant chat ---- const [isAgentChatOpen, setIsAgentChatOpen] = useState(false); // Flipped when the server denies access (the gate can change server-side); // hides the entry point while this note is open. @@ -142,9 +142,8 @@ export function NoteEditorLayout({ onAgentChatDockedChange }: NoteEditorLayoutPr const isChangelog = isChangelogNote(note); const isChangelogAccessDenied = isChangelog && !user?.isModerator; - const isHubEditorOrModerator = Boolean(user?.moderator) || (user?.editorOfHubs?.length ?? 0) > 0; const showAgentChat = - isHubEditorOrModerator && + Boolean(user) && !agentChatUnavailable && // Changelogs are moderator-only: the page renders Note Not Found in place // of the document, so the assistant must not mount over it. diff --git a/hooks/useNotebookChatSocket.ts b/hooks/useNotebookChatSocket.ts index fa2f12f6d..c64421792 100644 --- a/hooks/useNotebookChatSocket.ts +++ b/hooks/useNotebookChatSocket.ts @@ -7,7 +7,7 @@ import { useReconnectingSocket, type SocketStatus } from './useReconnectingSocke /** * Server-defined close codes that mean reconnecting is pointless for this - * chat: unauthenticated (4401), not editor/moderator (4403), chat/note not + * chat: unauthenticated (4401), Research AI access blocked (4403), chat/note not * found or not yours (4404). REST polling remains the fallback, and the REST * layer surfaces the matching access error to the UI. */