Skip to content

Build your personal knowledge base with Trilium Notes

feat(transcription): turn meeting transcription on in the settings

Elian Doranc0547884696f
diff --git a/.claude/skills/working-with-transcription/SKILL.md b/.claude/skills/working-with-transcription/SKILL.md
index 85dccaf895..fb00c3cf7b 100644
--- a/.claude/skills/working-with-transcription/SKILL.md
+++ b/.claude/skills/working-with-transcription/SKILL.md
@@ -5,7 +5,7 @@ description: Use when working on Trilium's meeting transcription — the desktop
# Working with transcription
-Desktop transcribes a meeting on the user's machine: no audio leaves it, and none is kept unless the user turns on "Keep recordings for troubleshooting". Standalone has only a prototype (`apps/standalone/transcription-poc/`, see its README).
+Desktop transcribes a meeting on the user's machine, once the synced option `transcriptionEnabled` ("Meeting transcription" in the header of Options → Transcription, off by default while the feature is in beta) is on; until then the launcher renders nothing and the page shows only that switch: no audio leaves it, and none is kept unless the user turns on "Keep recordings for troubleshooting". Standalone has only a prototype (`apps/standalone/transcription-poc/`, see its README).
## The pipeline
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index e1be197d14..59e04c97a6 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -4636,7 +4636,9 @@
"troubleshooting_title": "Troubleshooting",
"keep_recordings": "Keep recordings for troubleshooting",
"keep_recordings_description": "Keeps the audio of everyone in the meeting, with the settings used and the transcript as it was produced, so that a problem with a recording can be reported and reproduced. It takes about 230 MB per hour of meeting, is never deleted automatically and is not encrypted, even for protected notes. Recording other participants can require their consent where you or they are.",
- "saved_in": "Saved in"
+ "saved_in": "Saved in",
+ "enabled": "Meeting transcription",
+ "enabled_description": "Adds the Transcribe meeting button to the launch bar, which transcribes what you say into your microphone and what the other participants say through your speakers. Recognition runs entirely on this device, so no audio leaves it."
},
"resources_options": {
"list_title": "Resources",
diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
index cb6f513962..35a00c98af 100644
--- a/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
@@ -11,7 +11,16 @@ const mocks = vi.hoisted(() => ({
showError: vi.fn(),
requireResources: vi.fn(),
transcriptionModel: null as string | null,
- speakersEnabled: true
+ speakersEnabled: true,
+ transcriptionEnabled: true
+}));
+
+vi.mock("../react/hooks", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("../react/hooks")>()),
+ useTriliumOptionBool: (name: string) => [
+ name === "transcriptionEnabled" && mocks.transcriptionEnabled,
+ vi.fn()
+ ]
}));
vi.mock("../../services/date_notes", () => ({
@@ -48,6 +57,7 @@ beforeEach(() => {
vi.clearAllMocks();
mocks.transcriptionModel = null;
mocks.speakersEnabled = true;
+ mocks.transcriptionEnabled = true;
vi.useFakeTimers({ now: new Date(2026, 9, 13, 14, 30), toFake: [ "Date" ] });
});
@@ -149,6 +159,13 @@ describe("toggleRecording", () => {
});
describe("RecordMeetingButton", () => {
+ it("shows nothing while transcription is turned off in the settings", () => {
+ mocks.transcriptionEnabled = false;
+ const container = renderInto(<RecordMeetingButton launcherNote={{} as FNote} />);
+ expect(container.querySelector(".record-meeting-launcher")).toBeNull();
+ expect(container.querySelector("button")).toBeNull();
+ });
+
it("marks the launcher as beta", () => {
const container = renderInto(<RecordMeetingButton launcherNote={{} as FNote} />);
expect(container.querySelector(".record-meeting-launcher .record-meeting-beta-badge")?.textContent)
diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
index 08ea00fe58..58c27c9dd2 100644
--- a/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
@@ -13,6 +13,7 @@ import noteCreateService from "../../services/note_create";
import options from "../../services/options";
import toast from "../../services/toast";
import { Badge } from "../react/Badge";
+import { useTriliumOptionBool } from "../react/hooks";
import {
LaunchBarActionButton,
LauncherNoteProps,
@@ -21,11 +22,13 @@ import {
/**
* Launcher button that records a meeting: the first click creates the meeting note and starts the
- * recording, the second stops it. Desktop only, since the main process does the recording.
+ * recording, the second stops it. Desktop only, since the main process does the recording, and
+ * shown only while `transcriptionEnabled` is on.
*/
export default function RecordMeetingButton({ launcherNote }: LauncherNoteProps) {
const { icon, title } = useLauncherIconAndTitle(launcherNote);
const { status, error } = useTranscriptionState();
+ const [ isEnabled ] = useTriliumOptionBool("transcriptionEnabled");
const handleClick = useCallback(() => {
void toggleRecording(status);
}, [ status ]);
@@ -36,6 +39,10 @@ export default function RecordMeetingButton({ launcherNote }: LauncherNoteProps)
}
}, [ error ]);
+ if (!isEnabled) {
+ return null;
+ }
+
return (
<div className="record-meeting-launcher">
<LaunchBarActionButton
diff --git a/apps/client/src/widgets/type_widgets/options/transcription.spec.tsx b/apps/client/src/widgets/type_widgets/options/transcription.spec.tsx
index 3ed09e95ea..8187053fa3 100644
--- a/apps/client/src/widgets/type_widgets/options/transcription.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/options/transcription.spec.tsx
@@ -32,7 +32,8 @@ vi.mock("../../react/hooks", async (importOriginal) => ({
vi.mock("./components/OptionsPageHeader", () => ({
- default: ({ badge }: { badge?: ComponentChildren }) => <div className="header-stub">{badge}</div>
+ default: ({ badge, below }: { badge?: ComponentChildren; below?: ComponentChildren }) =>
+ <div className="header-stub">{badge}{below}</div>
}));
import TranscriptionSettings from "./transcription";
@@ -43,7 +44,9 @@ beforeEach(() => {
mocks.electron = true;
mocks.stored = "parakeet-fp32";
mocks.saved = [];
- mocks.bools = { transcriptionSpeakersEnabled: true, transcriptionKeepRecordings: false };
+ mocks.bools = {
+ transcriptionEnabled: true, transcriptionSpeakersEnabled: true, transcriptionKeepRecordings: false
+ };
mocks.savedBools = [];
mocks.getRecordingsDirectory.mockReset().mockResolvedValue("/data/transcription-recordings");
window.electronApi = {
@@ -123,9 +126,27 @@ describe("TranscriptionSettings", () => {
expect(host.querySelector(".directory-location-path")?.textContent).toBe("/data/transcription-recordings");
});
- it("marks the page as beta", () => {
+ it("marks the page as beta, and introduces it only through the switch below the title", () => {
open();
- expect(host.querySelector(".header-stub .ext-badge")?.textContent).toBe("common.beta");
+ const header = host.querySelector(".header-stub");
+ expect(header?.querySelector(".ext-badge")?.textContent).toBe("common.beta");
+ expect(header?.querySelector("p")).toBeNull();
+ expect(header?.textContent).toContain("transcription_options.enabled_description");
+ });
+
+ it("offers only the switch that turns transcription on while it is off", () => {
+ mocks.bools.transcriptionEnabled = false;
+ open();
+ expect(host.querySelector("select")).toBeNull();
+ expect(host.querySelector("input.switch-toggle[id^='keep-recordings-']")).toBeNull();
+
+ const toggle = findToggle("transcription-enabled");
+ expect(toggle.checked).toBe(false);
+ act(() => {
+ toggle.checked = true;
+ toggle.dispatchEvent(new Event("input", { bubbles: true }));
+ });
+ expect(mocks.savedBools).toEqual([ [ "transcriptionEnabled", true ] ]);
});
it("shows the default model for a value it does not know", () => {
diff --git a/apps/client/src/widgets/type_widgets/options/transcription.tsx b/apps/client/src/widgets/type_widgets/options/transcription.tsx
index 3118e41676..60cc8e4edf 100644
--- a/apps/client/src/widgets/type_widgets/options/transcription.tsx
+++ b/apps/client/src/widgets/type_widgets/options/transcription.tsx
@@ -15,6 +15,8 @@ import NoItems from "../../react/NoItems";
import OptionsPageHeader from "./components/OptionsPageHeader";
export default function TranscriptionSettings() {
+ const [ isEnabled, setIsEnabled ] = useTriliumOptionBool("transcriptionEnabled");
+
if (!isElectron()) {
return (
<>
@@ -28,9 +30,24 @@ export default function TranscriptionSettings() {
<>
<OptionsPageHeader
badge={<Badge text={t("common.beta")} className="transcription-beta-badge" outline />}
+ below={
+ <OptionCardSection
+ className="options-header-switch"
+ name="transcription-enabled"
+ label={t("transcription_options.enabled")}
+ description={t("transcription_options.enabled_description")}
+ >
+ <FormToggle currentValue={isEnabled} onChange={setIsEnabled} />
+ </OptionCardSection>
+ }
/>
- <RecognitionSettings />
- <TroubleshootingSettings />
+
+ {isEnabled && (
+ <>
+ <RecognitionSettings />
+ <TroubleshootingSettings />
+ </>
+ )}
</>
);
}
diff --git a/packages/commons/src/lib/options_interface.ts b/packages/commons/src/lib/options_interface.ts
index e2405e99e1..b9be46852a 100644
--- a/packages/commons/src/lib/options_interface.ts
+++ b/packages/commons/src/lib/options_interface.ts
@@ -202,6 +202,8 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi
autoFixConsistencyIssues: boolean;
vimKeymapEnabled: boolean;
codeLineWrapEnabled: boolean;
+ /** Whether meetings can be transcribed: shows the launcher and the transcription settings. */
+ transcriptionEnabled: boolean;
/** Whether a meeting transcript is shown without filler words and stutters. */
transcriptCleanupEnabled: boolean;
/**
diff --git a/packages/trilium-core/src/routes/api/options.ts b/packages/trilium-core/src/routes/api/options.ts
index c8d4918b67..0524567801 100644
--- a/packages/trilium-core/src/routes/api/options.ts
+++ b/packages/trilium-core/src/routes/api/options.ts
@@ -64,6 +64,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
"vimKeymapEnabled",
"codeLineWrapEnabled",
"transcriptCleanupEnabled",
+ "transcriptionEnabled",
"transcriptionModel",
"transcriptionSpeakersEnabled",
"transcriptionKeepRecordings",
diff --git a/packages/trilium-core/src/services/options_init.ts b/packages/trilium-core/src/services/options_init.ts
index 99852bf43b..092c24ef77 100644
--- a/packages/trilium-core/src/services/options_init.ts
+++ b/packages/trilium-core/src/services/options_init.ts
@@ -184,6 +184,7 @@ const defaultOptions: DefaultOption[] = [
{ name: "vimKeymapEnabled", value: "false", isSynced: false },
{ name: "codeLineWrapEnabled", value: "true", isSynced: false },
{ name: "transcriptCleanupEnabled", value: "true", isSynced: true },
+ { name: "transcriptionEnabled", value: "false", isSynced: true },
{ name: "transcriptionModel", value: DEFAULT_TRANSCRIPTION_MODEL, isSynced: false },
{ name: "transcriptionSpeakersEnabled", value: "true", isSynced: true },
{ name: "transcriptionKeepRecordings", value: "false", isSynced: false },