Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat(notes): add new note and search notes buttons to sidebar
Gabriel Steine3d38491d64e
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsxindex a39ba3b32..29cdc4533 100644--- a/src/components/ControlPanel.tsx+++ b/src/components/ControlPanel.tsx@@ -745,6 +745,7 @@ export default function ControlPanel() {setSettingsSection(section);setShowSettings(true);}}+ onOpenSearch={() => setShowSearch(true)}meetingRecordingRequest={meetingRecordingRequest}onMeetingRecordingRequestHandled={handleMeetingRecordingRequestHandled}isMeetingMode={isMeetingMode}diff --git a/src/components/notes/PersonalNotesView.tsx b/src/components/notes/PersonalNotesView.tsxindex 4f5caf810..433aad2e8 100644--- a/src/components/notes/PersonalNotesView.tsx+++ b/src/components/notes/PersonalNotesView.tsx@@ -1,6 +1,16 @@import { useState, useEffect, useRef, useCallback, useMemo } from "react";import { useTranslation } from "react-i18next";-import { Plus, Loader2, FolderOpen, MoreHorizontal, Pencil, Trash2, Check } from "lucide-react";+import {+ Plus,+ Loader2,+ FolderOpen,+ MoreHorizontal,+ Pencil,+ Trash2,+ Check,+ SquarePen,+ Search,+} from "lucide-react";import { Button } from "../ui/button";import {DropdownMenu,@@ -9,6 +19,16 @@ import {DropdownMenuItem,DropdownMenuSeparator,} from "../ui/dropdown-menu";+import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "../ui/dialog";+import {+ Select,+ SelectTrigger,+ SelectValue,+ SelectContent,+ SelectItem,+ SelectSeparator,+} from "../ui/select";+import { Input } from "../ui/input";import { useToast } from "../ui/Toast";import NoteListItem from "./NoteListItem";import NoteEditor from "./NoteEditor";@@ -20,7 +40,7 @@ import { useSettingsStore, selectIsCloudReasoningMode } from "../../stores/settiimport { useFolderManagement } from "../../hooks/useFolderManagement";import { useNoteDragAndDrop } from "../../hooks/useNoteDragAndDrop";import { cn } from "../lib/utils";-import { MEETINGS_FOLDER_NAME } from "./shared";+import { MEETINGS_FOLDER_NAME, findDefaultFolder } from "./shared";import logger from "../../utils/logger";import { parseTranscriptSegments } from "../../utils/parseTranscriptSegments";import {@@ -44,6 +64,7 @@ function makeContentHash(content: string): string {interface PersonalNotesViewProps {onOpenSettings?: (section: string) => void;+ onOpenSearch?: () => void;meetingRecordingRequest?: { noteId: number; folderId: number; event: any } | null;onMeetingRecordingRequestHandled?: () => void;isMeetingMode?: boolean;@@ -51,6 +72,7 @@ interface PersonalNotesViewProps {export default function PersonalNotesView({onOpenSettings,+ onOpenSearch,meetingRecordingRequest,onMeetingRecordingRequestHandled,isMeetingMode,@@ -64,6 +86,10 @@ export default function PersonalNotesView({const [localContent, setLocalContent] = useState("");const [localEnhancedContent, setLocalEnhancedContent] = useState<string | null>(null);const [showActionManager, setShowActionManager] = useState(false);+ const [showNewNoteDialog, setShowNewNoteDialog] = useState(false);+ const [newNoteFolderId, setNewNoteFolderId] = useState<string>("");+ const [showNewNoteFolderDialog, setShowNewNoteFolderDialog] = useState(false);+ const [newNoteFolderName, setNewNoteFolderName] = useState("");const saveTimeoutRef = useRef<NodeJS.Timeout | null>(null);const enhancedSaveTimeoutRef = useRef<NodeJS.Timeout | null>(null);const activeNoteRef = useRef<number | null>(null);@@ -234,6 +260,51 @@ export default function PersonalNotesView({}}, [activeFolderId, loadFolders]);+ const handleOpenNewNoteDialog = useCallback(() => {+ const personal = findDefaultFolder(folders);+ setNewNoteFolderId(personal ? String(personal.id) : folders[0] ? String(folders[0].id) : "");+ setShowNewNoteDialog(true);+ }, [folders]);++ const handleNewNoteFolderChange = useCallback((val: string) => {+ if (val === "__create_new__") {+ setShowNewNoteFolderDialog(true);+ return;+ }+ setNewNoteFolderId(val);+ }, []);++ const handleCreateNewNoteFolder = useCallback(async () => {+ const trimmed = newNoteFolderName.trim();+ if (!trimmed) return;+ const res = await window.electronAPI.createFolder(trimmed);+ if (res.success && res.folder) {+ await loadFolders();+ setNewNoteFolderId(String(res.folder.id));+ }+ setNewNoteFolderName("");+ setShowNewNoteFolderDialog(false);+ }, [newNoteFolderName, loadFolders]);++ const handleConfirmNewNote = useCallback(async () => {+ const folderId = Number(newNoteFolderId);+ if (!folderId) return;+ const result = await window.electronAPI.saveNote(+ t("notes.list.untitledNote"),+ "",+ "personal",+ null,+ null,+ folderId+ );+ if (result.success && result.note) {+ setActiveFolderId(folderId);+ setActiveNoteId(result.note.id);+ loadFolders();+ }+ setShowNewNoteDialog(false);+ }, [newNoteFolderId, loadFolders]);+const handleNotesAdded = useCallback(async () => {if (activeFolderId) {await initializeNotes(null, 50, activeFolderId);@@ -410,6 +481,35 @@ export default function PersonalNotesView({style={{ width: isMeetingMode ? 0 : "13rem" }}><div className="w-52 shrink-0 border-r border-border/15 dark:border-white/4 flex flex-col h-full">+ <div className="px-2 pt-2 pb-1 shrink-0 space-y-0.5">+ <button+ onClick={handleOpenNewNoteDialog}+ className={cn(+ "flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs",+ "text-muted-foreground/80 hover:text-foreground hover:bg-foreground/5",+ "transition-colors duration-150",+ "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/30"+ )}+ >+ <SquarePen size={14} className="shrink-0" />+ {t("notes.sidebar.newNote")}+ </button>+ {onOpenSearch && (+ <button+ onClick={onOpenSearch}+ className={cn(+ "flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs",+ "text-muted-foreground/80 hover:text-foreground hover:bg-foreground/5",+ "transition-colors duration-150",+ "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/30"+ )}+ >+ <Search size={14} className="shrink-0" />+ {t("notes.sidebar.searchNotes")}+ </button>+ )}+ </div>+{/* Folders */}<div className="flex items-center justify-between px-3 py-2"><span className="text-xs font-medium uppercase tracking-wider text-foreground/50 dark:text-foreground/25">@@ -920,6 +1020,97 @@ export default function PersonalNotesView({onNotesAdded={handleNotesAdded}/>)}++ <Dialog open={showNewNoteDialog} onOpenChange={setShowNewNoteDialog}>+ <DialogContent className="sm:max-w-[320px] p-5 gap-3">+ <DialogHeader>+ <DialogTitle className="text-sm">{t("notes.sidebar.newNote")}</DialogTitle>+ </DialogHeader>+ {folders.length > 0 && (+ <div className="flex items-center gap-2">+ <FolderOpen size={12} className="text-foreground/20 shrink-0" />+ <Select value={newNoteFolderId} onValueChange={handleNewNoteFolderChange}>+ <SelectTrigger className="h-7 flex-1 text-xs rounded-lg px-2.5 [&>svg]:h-3 [&>svg]:w-3">+ <SelectValue placeholder={t("notes.upload.selectFolder")} />+ </SelectTrigger>+ <SelectContent>+ {folders.map((f) => (+ <SelectItem key={f.id} value={String(f.id)}>+ {f.name}+ </SelectItem>+ ))}+ <SelectSeparator />+ <SelectItem value="__create_new__">+ <span className="flex items-center gap-1.5 text-primary/60">+ <Plus size={11} />+ {t("notes.upload.newFolder")}+ </span>+ </SelectItem>+ </SelectContent>+ </Select>+ </div>+ )}+ <DialogFooter className="gap-1.5">+ <Button+ variant="ghost"+ size="sm"+ onClick={() => setShowNewNoteDialog(false)}+ className="h-7 text-xs"+ >+ {t("notes.upload.cancel")}+ </Button>+ <Button+ variant="default"+ size="sm"+ onClick={handleConfirmNewNote}+ disabled={!newNoteFolderId}+ className="h-7 text-xs"+ >+ {t("notes.upload.create")}+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>++ <Dialog open={showNewNoteFolderDialog} onOpenChange={setShowNewNoteFolderDialog}>+ <DialogContent className="sm:max-w-[320px] p-5 gap-3">+ <DialogHeader>+ <DialogTitle className="text-sm">{t("notes.upload.newFolder")}</DialogTitle>+ </DialogHeader>+ <Input+ value={newNoteFolderName}+ onChange={(e) => setNewNoteFolderName(e.target.value)}+ placeholder={t("notes.upload.folderName")}+ className="h-8 text-xs"+ autoFocus+ onKeyDown={(e) => {+ if (e.key === "Enter") handleCreateNewNoteFolder();+ }}+ />+ <DialogFooter className="gap-1.5">+ <Button+ variant="ghost"+ size="sm"+ onClick={() => {+ setShowNewNoteFolderDialog(false);+ setNewNoteFolderName("");+ }}+ className="h-7 text-xs"+ >+ {t("notes.upload.cancel")}+ </Button>+ <Button+ variant="default"+ size="sm"+ onClick={handleCreateNewNoteFolder}+ disabled={!newNoteFolderName.trim()}+ className="h-7 text-xs"+ >+ {t("notes.upload.create")}+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog></div>);}diff --git a/src/locales/de/translation.json b/src/locales/de/translation.jsonindex 0fc00dbd4..989365adc 100644--- a/src/locales/de/translation.json+++ b/src/locales/de/translation.json@@ -1532,6 +1532,10 @@}},"notes": {+ "sidebar": {+ "newNote": "Neue Notiz",+ "searchNotes": "Notizen suchen"+ },"folders": {"title": "Ordner","soon": "Demnächst",diff --git a/src/locales/en/translation.json b/src/locales/en/translation.jsonindex 6a9046e23..1c202113c 100644--- a/src/locales/en/translation.json+++ b/src/locales/en/translation.json@@ -1641,6 +1641,10 @@"upgradeUnlimited": "Upgrade to Pro — unlimited transcriptions"},"notes": {+ "sidebar": {+ "newNote": "New note",+ "searchNotes": "Search notes"+ },"folders": {"title": "Folders","soon": "Soon",diff --git a/src/locales/es/translation.json b/src/locales/es/translation.jsonindex 0a49a2685..6d48e01bc 100644--- a/src/locales/es/translation.json+++ b/src/locales/es/translation.json@@ -1532,6 +1532,10 @@}},"notes": {+ "sidebar": {+ "newNote": "Nueva nota",+ "searchNotes": "Buscar notas"+ },"folders": {"title": "Carpetas","soon": "Próximamente",diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.jsonindex 071d7a788..09768f151 100644--- a/src/locales/fr/translation.json+++ b/src/locales/fr/translation.json@@ -1593,6 +1593,10 @@"upgradeUnlimited": "Passer à Pro — transcriptions illimitées"},"notes": {+ "sidebar": {+ "newNote": "Nouvelle note",+ "searchNotes": "Rechercher des notes"+ },"folders": {"title": "Dossiers","soon": "Bientôt",diff --git a/src/locales/it/translation.json b/src/locales/it/translation.jsonindex 16e221b94..5ecbb05fa 100644--- a/src/locales/it/translation.json+++ b/src/locales/it/translation.json@@ -1532,6 +1532,10 @@}},"notes": {+ "sidebar": {+ "newNote": "Nuova nota",+ "searchNotes": "Cerca note"+ },"folders": {"title": "Cartelle","soon": "Presto",diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.jsonindex 463211264..ac71a3615 100644--- a/src/locales/ja/translation.json+++ b/src/locales/ja/translation.json@@ -1460,6 +1460,10 @@}},"notes": {+ "sidebar": {+ "newNote": "新しいノート",+ "searchNotes": "ノートを検索"+ },"editor": {"transcribe": "文字起こし","staleIndicator": "強化後にコンテンツが変更されました",diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.jsonindex 7b0adfd3c..150c04f46 100644--- a/src/locales/pt/translation.json+++ b/src/locales/pt/translation.json@@ -1532,6 +1532,10 @@}},"notes": {+ "sidebar": {+ "newNote": "Nova nota",+ "searchNotes": "Pesquisar notas"+ },"folders": {"title": "Pastas","soon": "Em breve",diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.jsonindex 2a090450f..2d8d41697 100644--- a/src/locales/ru/translation.json+++ b/src/locales/ru/translation.json@@ -1532,6 +1532,10 @@}},"notes": {+ "sidebar": {+ "newNote": "Новая заметка",+ "searchNotes": "Поиск заметок"+ },"folders": {"title": "Папки","soon": "Скоро",diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.jsonindex a00a6c9c7..d8313ac35 100644--- a/src/locales/zh-CN/translation.json+++ b/src/locales/zh-CN/translation.json@@ -1527,6 +1527,10 @@}},"notes": {+ "sidebar": {+ "newNote": "新建笔记",+ "searchNotes": "搜索笔记"+ },"folders": {"title": "文件夹","soon": "即将推出",diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.jsonindex dc1427e6e..2f9b354ac 100644--- a/src/locales/zh-TW/translation.json+++ b/src/locales/zh-TW/translation.json@@ -1527,6 +1527,10 @@}},"notes": {+ "sidebar": {+ "newNote": "新增筆記",+ "searchNotes": "搜尋筆記"+ },"folders": {"title": "資料夾","soon": "即將推出",