Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(launch_bar): add a "Record meeting" launcher
Elian Doran8615fac94049
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 0e8b1a4edb..a88ec5e0b5 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -829,7 +829,8 @@"hoisted_note": "The note to hoist to when a launcher opens its target.","share_logo": "An image note used as the logo of the shared page. It has to sit inside the shared subtree.","share_open_graph_image_relation": "An image note served as the <code>og:image</code> of the shared page. Set the label of the same name instead to point at an address.",- "share_html": "An HTML note injected into the shared page, where <code>#shareHtmlLocation</code> on that note says. It has to sit inside the shared subtree."+ "share_html": "An HTML note injected into the shared page, where <code>#shareHtmlLocation</code> on that note says. It has to sit inside the shared subtree.",+ "meeting_recording": "Marks a note created by the \"Record meeting\" button in the launch bar, which holds the transcript of a meeting."},"attribute_editor": {"help_text_body1": "To add label, just type e.g. <code>#rock</code> or if you want to add also value then e.g. <code>#year = 2020</code>",@@ -4576,5 +4577,8 @@"excerpt": "Excerpt","excerpt_description": "You are currently seeing just a fragment of this note. Press the {{icon}} button to open the entire note in a new tab.","edit_excerpt": "Edit excerpt"+ },+ "record_meeting": {+ "note_title": "Meeting {{date}}"}}diff --git a/apps/client/src/widgets/attribute_widgets/attr_help.ts b/apps/client/src/widgets/attribute_widgets/attr_help.tsindex fc599d6b3d..193ffdce8f 100644--- a/apps/client/src/widgets/attribute_widgets/attr_help.ts+++ b/apps/client/src/widgets/attribute_widgets/attr_help.ts@@ -42,6 +42,7 @@ export const ATTR_HELP: AttrHelpMap = {searchHome: t("attribute_detail.search_home"),workspaceSearchHome: t("attribute_detail.workspace_search_home"),inbox: t("attribute_detail.inbox"),+ meetingRecording: t("attribute_detail.meeting_recording"),workspaceInbox: t("attribute_detail.workspace_inbox"),sqlConsoleHome: t("attribute_detail.sql_console_home"),bookmarkFolder: t("attribute_detail.bookmark_folder"),diff --git a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx b/apps/client/src/widgets/launch_bar/LauncherContainer.tsxindex 44da926714..3698966da0 100644--- a/apps/client/src/widgets/launch_bar/LauncherContainer.tsx+++ b/apps/client/src/widgets/launch_bar/LauncherContainer.tsx@@ -3,7 +3,7 @@ import { useCallback, useLayoutEffect, useRef, useState } from "preact/hooks";import FNote from "../../entities/fnote";import { isExperimentalFeatureEnabled } from "../../services/experimental_features";import froca from "../../services/froca";-import { isDesktop, isMobile } from "../../services/utils";+import { isDesktop, isElectron, isMobile } from "../../services/utils";import TabSwitcher from "../mobile_widgets/TabSwitcher";import { useTriliumEvent } from "../react/hooks";import { onWheelHorizontalScroll } from "../widget_utils";@@ -14,6 +14,7 @@ import HistoryNavigationButton from "./HistoryNavigation";import { LaunchBarContext } from "./launch_bar_widgets";import { CommandButton, CustomWidget, NoteLauncher, QuickSearchLauncherWidget, ScriptLauncher, TodayLauncher } from "./LauncherDefinitions";import ProtectedSessionStatusWidget from "./ProtectedSessionStatusWidget";+import RecordMeetingButton from "./RecordMeetingButton";import SidebarChatButton from "./SidebarChatButton";import SpacerWidget from "./SpacerWidget";import SyncStatus from "./SyncStatus";@@ -105,6 +106,8 @@ function initBuiltinWidget(note: FNote, isHorizontalLayout: boolean) {return <TabSwitcher launcherNote={note} />;case "sidebarChat":return isExperimentalFeatureEnabled("llm") ? <SidebarChatButton launcherNote={note} /> : undefined;+ case "recordMeeting":+ return isElectron() ? <RecordMeetingButton launcherNote={note} /> : undefined;case "colorSchemeSwitcher":return <ColorSchemeSwitcher launcherNote={note} />;default:diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsxnew file mode 100644index 0000000000..4fc6edc66e--- /dev/null+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx@@ -0,0 +1,48 @@+import { beforeEach, describe, expect, it, vi } from "vitest";++const mocks = vi.hoisted(() => ({+ getInboxNote: vi.fn(),+ createNote: vi.fn()+}));++vi.mock("../../services/date_notes", () => ({+ default: { getInboxNote: mocks.getInboxNote }+}));+vi.mock("../../services/note_create", () => ({+ default: { createNote: mocks.createNote }+}));+vi.mock("../../services/i18n", () => ({+ t: (key: string, options?: { date?: string }) => `${key} ${options?.date}`+}));++import { createMeetingNote } from "./RecordMeetingButton";++beforeEach(() => {+ vi.clearAllMocks();+ vi.useFakeTimers({ now: new Date(2026, 9, 13, 14, 30), toFake: [ "Date" ] });+});++describe("createMeetingNote", () => {+ it("creates a labeled text note titled with the date and time in the inbox", async () => {+ mocks.getInboxNote.mockResolvedValue({ noteId: "inbox", isProtected: true });++ await createMeetingNote();++ expect(mocks.createNote).toHaveBeenCalledExactlyOnceWith("inbox", {+ title: "record_meeting.note_title 2026-10-13 14:30",+ type: "text",+ isProtected: true,+ focus: "content",+ attributes: [ { type: "label", name: "meetingRecording", value: "" } ]+ });+ });++ it("creates nothing without an inbox note", async () => {+ mocks.getInboxNote.mockResolvedValue(null);+ vi.spyOn(console, "warn").mockImplementation(() => {});++ await createMeetingNote();++ expect(mocks.createNote).not.toHaveBeenCalled();+ });+});diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsxnew file mode 100644index 0000000000..bbefe15fee--- /dev/null+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx@@ -0,0 +1,51 @@+import { dayjs } from "@triliumnext/commons";+import { useCallback } from "preact/hooks";++import dateNoteService from "../../services/date_notes";+import { t } from "../../services/i18n";+import noteCreateService from "../../services/note_create";+import {+ LaunchBarActionButton,+ LauncherNoteProps,+ useLauncherIconAndTitle+} from "./launch_bar_widgets";++/** The label that identifies a note created by this launcher. */+export const MEETING_RECORDING_LABEL = "meetingRecording";++/**+ * Launcher button that starts a meeting recording. For now it only creates the meeting note in the+ * inbox and opens it.+ */+export default function RecordMeetingButton({ launcherNote }: LauncherNoteProps) {+ const { icon, title } = useLauncherIconAndTitle(launcherNote);+ const handleClick = useCallback(() => {+ void createMeetingNote();+ }, []);++ return (+ <LaunchBarActionButton+ launcherNote={launcherNote}+ icon={icon}+ text={title}+ onClick={handleClick}+ />+ );+}++/** Creates a text note titled with the current date and time in the inbox, and opens it. */+export async function createMeetingNote() {+ const inboxNote = await dateNoteService.getInboxNote();+ if (!inboxNote) {+ console.warn("Missing inbox note.");+ return;+ }++ return await noteCreateService.createNote(inboxNote.noteId, {+ title: t("record_meeting.note_title", { date: dayjs().format("YYYY-MM-DD HH:mm") }),+ type: "text",+ isProtected: inboxNote.isProtected,+ focus: "content",+ attributes: [ { type: "label", name: MEETING_RECORDING_LABEL, value: "" } ]+ });+}diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.jsonindex 1908181376..bbb9da28c5 100644--- a/apps/server/src/assets/translations/en/server.json+++ b/apps/server/src/assets/translations/en/server.json@@ -329,7 +329,8 @@"localization": "Language & Region","inbox-title": "Inbox","tab-switcher-title": "Tab Switcher",- "sidebar-chat-title": "AI Chat"+ "sidebar-chat-title": "AI Chat",+ "record-meeting-title": "Record meeting"},"notes": {"new-note": "New note",diff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.tsindex 4c9e3df198..e67fb70061 100644--- a/packages/commons/src/lib/builtin_attributes.ts+++ b/packages/commons/src/lib/builtin_attributes.ts@@ -77,6 +77,8 @@ export interface BuiltinRelation {const BUILTIN_ATTRIBUTES = [// Note tree & organisation{ type: "label", name: "inbox", valueType: "boolean" },+ // Marks a note created by the "Record meeting" launcher, which holds a meeting transcript.+ { type: "label", name: "meetingRecording", valueType: "boolean" },{ type: "label", name: "disableVersioning", valueType: "boolean" },{ type: "label", name: "versioningLimit", valueType: "number" },{ type: "label", name: "calendarRoot", valueType: "boolean" },@@ -242,7 +244,7 @@ const BUILTIN_ATTRIBUTES = [{ type: "label", name: "builtinWidget", valueType: "select", selectOptions: ["calendar", "spacer", "bookmarks", "protectedSession", "syncStatus", "backInHistoryButton","forwardInHistoryButton", "todayInJournal", "quickSearch", "mobileTabSwitcher", "sidebarChat",- "colorSchemeSwitcher"+ "colorSchemeSwitcher", "recordMeeting"] },// Dangerous together with `~script` below: it makes the launcher run its own content instead, so// neutralising only the relation would leave this as a way around it.diff --git a/packages/commons/src/lib/hidden_subtree.ts b/packages/commons/src/lib/hidden_subtree.tsindex 108bbe2ed5..02fd16845b 100644--- a/packages/commons/src/lib/hidden_subtree.ts+++ b/packages/commons/src/lib/hidden_subtree.ts@@ -59,7 +59,8 @@ export interface HiddenSubtreeItem {| "toggleZenMode"| "mobileTabSwitcher"| "sidebarChat"- | "colorSchemeSwitcher";+ | "colorSchemeSwitcher"+ | "recordMeeting";command?: keyof typeof Command;/*** If set to true, then branches will be enforced to be in the correct place.diff --git a/packages/trilium-core/src/services/hidden_subtree_launcherbar.spec.ts b/packages/trilium-core/src/services/hidden_subtree_launcherbar.spec.tsindex bd589dfc88..5105eb113b 100644--- a/packages/trilium-core/src/services/hidden_subtree_launcherbar.spec.ts+++ b/packages/trilium-core/src/services/hidden_subtree_launcherbar.spec.ts@@ -56,6 +56,7 @@ describe("buildLaunchBarConfig", () => {expect(desktopVisibleLaunchers.map((l) => l.id)).toEqual(["_lbNewNote",+ "_lbRecordMeeting","_lbSearch","_lbJumpTo","_lbNoteMap",diff --git a/packages/trilium-core/src/services/hidden_subtree_launcherbar.ts b/packages/trilium-core/src/services/hidden_subtree_launcherbar.tsindex b112778306..9a711ed1a3 100644--- a/packages/trilium-core/src/services/hidden_subtree_launcherbar.ts+++ b/packages/trilium-core/src/services/hidden_subtree_launcherbar.ts@@ -113,6 +113,13 @@ export default function buildLaunchBarConfig() {id: "_lbNewNote",...sharedLaunchers.newNote},+ {+ id: "_lbRecordMeeting",+ title: t("hidden-subtree.record-meeting-title"),+ type: "launcher",+ builtinWidget: "recordMeeting",+ icon: "bx bx-microphone"+ },{id: "_lbSearch",...sharedLaunchers.searchNotes