Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(notes): navigate to correct folder when selecting note from search

Gabriel Steinc19cf013b076
diff --git a/src/components/CommandSearch.tsx b/src/components/CommandSearch.tsx
index 3dfdfd98b..c36dd3b5b 100644
--- a/src/components/CommandSearch.tsx
+++ b/src/components/CommandSearch.tsx
@@ -18,7 +18,7 @@ export interface CommandSearchProps {
onOpenChange: (open: boolean) => void;
mode?: "all" | "conversations";
transcriptions?: TranscriptionItem[];
- onNoteSelect?: (noteId: number) => void;
+ onNoteSelect?: (noteId: number, folderId: number | null) => void;
onTranscriptSelect?: (transcriptId: number) => void;
onConversationSelect?: (conversationId: number) => void;
}
@@ -217,7 +217,7 @@ export default function CommandSearch({
const selectItem = useCallback(
(item: FlatItem) => {
- if (item.kind === "note") onNoteSelect?.(item.note.id);
+ if (item.kind === "note") onNoteSelect?.(item.note.id, item.note.folder_id ?? null);
else if (item.kind === "transcript") onTranscriptSelect?.(item.transcript.id);
else if (item.kind === "conversation") onConversationSelect?.(item.conversation.id);
onOpenChange(false);
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index 02426399f..2dfb69119 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -570,7 +570,8 @@ export default function ControlPanel() {
open={showSearch}
onOpenChange={setShowSearch}
transcriptions={history}
- onNoteSelect={(id) => {
+ onNoteSelect={(id, folderId) => {
+ if (folderId) setActiveFolderId(folderId);
setActiveNoteId(id);
setActiveView("personal-notes");
}}
diff --git a/src/hooks/useFolderManagement.ts b/src/hooks/useFolderManagement.ts
index fa3fe6858..401050cb4 100644
--- a/src/hooks/useFolderManagement.ts
+++ b/src/hooks/useFolderManagement.ts
@@ -118,7 +118,6 @@ export function useFolderManagement(): UseFolderManagementReturn {
if (!activeFolderId || isLoading) return;
if (prevFolderIdRef.current === activeFolderId) return;
prevFolderIdRef.current = activeFolderId;
- setActiveNoteId(null);
const loadForFolder = async () => {
try {
const notes = await initializeNotes(null, 50, activeFolderId);