Remove the separate, un-toggleable `settings.ai.generative` workspace flag
(and its write-side alias `generativeAi`) along with the dead "Ask AI"
generative editor menu, and re-gate the AI page-title generation on the
general AI chat flag (`settings.ai.chat`) — the same toggle that enables
the chat agent and the chat stream endpoint.
Why: the `generative` flag had no UI toggle (its switch was already removed,
leaving orphaned i18n strings), so the title-generation button was
unreachable on self-hosted. The "Ask AI" menu was dead — its atom was never
rendered. Consolidating onto the AI chat flag makes the title button follow
the one AI switch users actually have.
Changes:
- server: title-gen endpoint gate generative -> chat (ai-chat.controller.ts);
remove generativeAi from update DTO and workspace service (update block,
delete line, cloud default now { ai: { chat: true } }); fix repo comment;
migrate generate-page-title spec assertions generative -> chat.
- client: title-gen gate -> settings.ai.chat (full-editor.tsx); remove the
dead Ask AI button + showAiMenu wiring from bubble-menu; remove AskAiGroup
usage/import and commented block from fixed-toolbar; delete ask-ai-group.tsx;
remove showAiMenuAtom; drop generative/generativeAi from workspace types.
- i18n: remove 3 orphaned generative-AI keys from all 12 locales.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
651 B
TypeScript
18 lines
651 B
TypeScript
import { atom } from "jotai";
|
|
import { Editor } from "@tiptap/core";
|
|
import { PageEditMode } from "@/features/user/types/user.types.ts";
|
|
|
|
export const pageEditorAtom = atom<Editor | null>(null);
|
|
|
|
export const titleEditorAtom = atom<Editor | null>(null);
|
|
|
|
export const readOnlyEditorAtom = atom<Editor | null>(null);
|
|
|
|
export const yjsConnectionStatusAtom = atom<string>("");
|
|
|
|
export const showLinkMenuAtom = atom(false);
|
|
|
|
// Current page's edit mode — initialized from the user's saved preference on
|
|
// first load, can be toggled locally without persisting to the server.
|
|
export const currentPageEditModeAtom = atom<PageEditMode>(PageEditMode.Edit);
|