From fae8418fa2b0e1a8ac9275d3cdde8e6c30fe43d3 Mon Sep 17 00:00:00 2001 From: claude_code Date: Mon, 22 Jun 2026 02:14:46 +0300 Subject: [PATCH] feat(editor): add dictation mic to page byline next to the info icon The editor dictation button previously lived only in the fixed toolbar, which is hidden by default (gated by the per-user editorToolbar preference), so dictation was effectively unavailable in the editor. Add the same dictation control to the always-rendered page byline row, right next to the Details "i" icon, so voice input stays reachable. It is shown only when workspace dictation is enabled, the page is editable, and the editor is in edit mode. Reuses the existing DictationGroup/MicButton and its caret-insertion logic. Co-Authored-By: Claude Opus 4.8 --- .../src/features/editor/full-editor.tsx | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/apps/client/src/features/editor/full-editor.tsx b/apps/client/src/features/editor/full-editor.tsx index a2c48891..ba95aba6 100644 --- a/apps/client/src/features/editor/full-editor.tsx +++ b/apps/client/src/features/editor/full-editor.tsx @@ -14,8 +14,11 @@ import { UnstyledButton, } from "@mantine/core"; import { IconInfoCircle } from "@tabler/icons-react"; -import { useAtom } from "jotai"; -import { userAtom } from "@/features/user/atoms/current-user-atom.ts"; +import { useAtom, useAtomValue } from "jotai"; +import { + userAtom, + workspaceAtom, +} from "@/features/user/atoms/current-user-atom.ts"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { useTranslation } from "react-i18next"; import { IContributor } from "@/features/page/types/page.types.ts"; @@ -24,7 +27,11 @@ import { PageEditMode } from "@/features/user/types/user.types.ts"; import { useAsideTriggerProps } from "@/hooks/use-toggle-aside.tsx"; import { DeletedPageBanner } from "@/features/page/trash/components/deleted-page-banner.tsx"; import clsx from "clsx"; -import { currentPageEditModeAtom } from "@/features/editor/atoms/editor-atoms.ts"; +import { + currentPageEditModeAtom, + pageEditorAtom, +} from "@/features/editor/atoms/editor-atoms.ts"; +import { DictationGroup } from "@/features/editor/components/fixed-toolbar/groups/dictation-group"; const MemoizedTitleEditor = React.memo(TitleEditor); const MemoizedPageEditor = React.memo(PageEditor); @@ -65,6 +72,8 @@ export function FullEditor({ canComment, }: FullEditorProps) { const [user] = useAtom(userAtom); + const workspace = useAtomValue(workspaceAtom); + const isDictationEnabled = workspace?.settings?.ai?.dictation === true; const fullPageWidth = user.settings?.preferences?.fullPageWidth; const editorToolbarEnabled = user.settings?.preferences?.editorToolbar ?? false; @@ -104,6 +113,9 @@ export function FullEditor({ c.id !== creator?.id, @@ -207,6 +232,9 @@ function PageByline({ creator, contributors }: PageBylineProps) { + {/* Shown only in edit mode when workspace dictation is enabled, so + dictation stays reachable even when the fixed toolbar is hidden. */} + {showDictation && editor && } ); }