From f3622eb23e949ceff5ecc1ca2d4efef8304e9186 Mon Sep 17 00:00:00 2001 From: samlhuillier Date: Sat, 2 Nov 2024 15:16:38 +0000 Subject: [PATCH 1/2] rm comments --- src/components/File/NewDirectory.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/File/NewDirectory.tsx b/src/components/File/NewDirectory.tsx index f95a64bc..1731d37f 100644 --- a/src/components/File/NewDirectory.tsx +++ b/src/components/File/NewDirectory.tsx @@ -69,17 +69,8 @@ const NewDirectoryComponent: React.FC = ({ isOpen, o const validName = await handleValidName(directoryRelativePath) if (!directoryRelativePath || errorMessage || !validName) return - // let directoryPath: string const directoryPath = await window.electronStore.getVaultDirectoryForWindow() - // if (parentDirectoryPath) { - // directoryPath = parentDirectoryPath - // } else if (currentlyOpenFilePath && currentlyOpenFilePath !== '') { - // directoryPath = await window.path.dirname(currentlyOpenFilePath) - // } else { - // directoryPath = await window.electronStore.getVaultDirectoryForWindow() - // } - const finalPath = await window.path.join(directoryPath, directoryRelativePath) window.fileSystem.createDirectory(finalPath) posthog.capture('created_new_directory_from_new_directory_modal') From 6e99ad01066db35a715494d42bc6de7863d41ea8 Mon Sep 17 00:00:00 2001 From: samlhuillier Date: Sat, 2 Nov 2024 15:23:01 +0000 Subject: [PATCH 2/2] remove all things related to flashcards --- README.md | 43 +++-- src/components/Common/CommonModals.tsx | 22 +-- .../Flashcard/FlashcardCreateModal.tsx | 174 ------------------ .../Flashcard/FlashcardMenuModal.tsx | 91 --------- .../Flashcard/FlashcardReviewModal.tsx | 73 -------- src/components/Flashcard/FlashcardsCore.tsx | 104 ----------- src/components/Flashcard/ProgressBar.tsx | 36 ---- src/components/Flashcard/index.ts | 4 - src/components/Flashcard/types.ts | 12 -- src/components/Flashcard/utils.ts | 62 ------- src/components/Sidebars/IconsSidebar.tsx | 25 +-- .../shortcuts/shortcutDefinitions.ts | 6 - src/components/shortcuts/use-shortcut.ts | 10 +- src/contexts/ModalContext.tsx | 36 +--- src/lib/welcome-note.ts | 8 - 15 files changed, 34 insertions(+), 672 deletions(-) delete mode 100644 src/components/Flashcard/FlashcardCreateModal.tsx delete mode 100644 src/components/Flashcard/FlashcardMenuModal.tsx delete mode 100644 src/components/Flashcard/FlashcardReviewModal.tsx delete mode 100644 src/components/Flashcard/FlashcardsCore.tsx delete mode 100644 src/components/Flashcard/ProgressBar.tsx delete mode 100644 src/components/Flashcard/index.ts delete mode 100644 src/components/Flashcard/types.ts delete mode 100644 src/components/Flashcard/utils.ts diff --git a/README.md b/README.md index f494fd31..76b79653 100644 --- a/README.md +++ b/README.md @@ -14,67 +14,74 @@ Private & local AI personal knowledge management app.

> ### 📢 Announcement +> > We are now on [Discord](https://discord.gg/b7zanGCTUY)! Our team is shipping very quickly right now so sharing ❤️feedback❤️ with us will really help shape the product 🚀 - - ## About -**Reor** is an AI-powered desktop note-taking app: it automatically links related notes, answers questions on your notes, provides semantic search and can generate AI flashcards. Everything is stored locally and you can edit your notes with an Obsidian-like markdown editor. - -The hypothesis of the project is that AI tools for thought should run models locally *by default*. Reor stands on the shoulders of the giants [Ollama](https://github.com/ollama/ollama), [Transformers.js](https://github.com/xenova/transformers.js) & [LanceDB](https://github.com/lancedb/lancedb) to enable both LLMs and embedding models to run locally: - -1. Every note you write is chunked and embedded into an internal vector database. -2. Related notes are connected automatically via vector similarity. -3. LLM-powered Q&A does RAG on your corpus of notes. -4. Everything can be searched semantically. +**Reor** is an AI-powered desktop note-taking app: it automatically links related notes, answers questions on your notes and provides semantic search. Everything is stored locally and you can edit your notes with an Obsidian-like markdown editor. +The hypothesis of the project is that AI tools for thought should run models locally *by default*. Reor stands on the shoulders of the giants [Ollama](https://github.com/ollama/ollama), [Transformers.js](https://github.com/xenova/transformers.js) & [LanceDB](https://github.com/lancedb/lancedb) to enable both LLMs and embedding models to run locally: +1. Every note you write is chunked and embedded into an internal vector database. +2. Related notes are connected automatically via vector similarity. +3. LLM-powered Q&A does RAG on your corpus of notes. +4. Everything can be searched semantically. -https://github.com/reorproject/reor/assets/17236551/94a1dfeb-3361-45cd-8ebc-5cfed81ed9cb + One way to think about Reor is as a RAG app with two generators: the LLM and the human. In Q&A mode, the LLM is fed retrieved context from the corpus to help answer a query. Similarly, in editor mode, the human can toggle the sidebar to reveal related notes "retrieved" from the corpus. This is quite a powerful way of "augmenting" your thoughts by cross-referencing ideas in a current note against related ideas from your corpus. - ### Getting Started + 1. Download from [reorproject.org](https://reorproject.org) or [releases](https://github.com/reorproject/reor/releases). Mac, Linux & Windows are all supported. 2. Install like a normal App. - ### Running local models + Reor interacts directly with Ollama which means you can download and run models locally right from inside Reor. Head to Settings->Add New Local LLM then enter the name of the model you want Reor to download. You can find available models [here](https://ollama.com/library). You can also [connect to an OpenAI-compatible API](https://www.reorproject.org/docs/documentation/openai-like-api) like Oobabooga, Ollama or OpenAI itself! ### Importing notes from other apps + Reor works within a single directory in the filesystem. You choose the directory on first boot. To import notes/files from another app, you'll need to populate that directory manually with markdown files. Note that if you have frontmatter in your markdown files it may not parse correctly. Integrations with other apps are hopefully coming soon! - ### Building from source Make sure you have [nodejs](https://nodejs.org/en/download) installed. -#### Clone repo: + +#### Clone repo + ``` git clone https://github.com/reorproject/reor.git ``` -#### Install dependencies: + +#### Install dependencies + ``` npm install ``` -#### Run for dev: + +#### Run for dev + ``` npm run dev ``` -#### Build: + +#### Build + ``` npm run build ``` ### Interested in contributing? + We are always on the lookout for contributors keen on building the future of knowledge management. Have a feature idea? Want to squash a bug? Want to improve some styling? We'd love to hear it. Check out our issues page and the [contributing guide](https://www.reorproject.org/docs/documentation/contributing) to get started. ## License + AGPL-3.0 license. See `LICENSE` for details. *Reor means "to think" in Latin.* diff --git a/src/components/Common/CommonModals.tsx b/src/components/Common/CommonModals.tsx index c079c52d..3c99e3b7 100644 --- a/src/components/Common/CommonModals.tsx +++ b/src/components/Common/CommonModals.tsx @@ -2,22 +2,12 @@ import React from 'react' import { useModalOpeners } from '@/contexts/ModalContext' import SettingsModal from '../Settings/Settings' -import FlashcardMenuModal from '../Flashcard/FlashcardMenuModal' import { useFileContext } from '@/contexts/FileContext' import RenameNoteModal from '../File/RenameNote' import RenameDirModal from '../File/RenameDirectory' const CommonModals: React.FC = () => { - const { - isSettingsModalOpen, - setIsSettingsModalOpen, - isFlashcardModeOpen, - setIsFlashcardModeOpen, - initialFileToCreateFlashcard, - setInitialFileToCreateFlashcard, - initialFileToReviewFlashcard, - setInitialFileToReviewFlashcard, - } = useModalOpeners() + const { isSettingsModalOpen, setIsSettingsModalOpen } = useModalOpeners() const { noteToBeRenamed, fileDirToBeRenamed } = useFileContext() @@ -26,16 +16,6 @@ const CommonModals: React.FC = () => { {noteToBeRenamed && } {fileDirToBeRenamed && } setIsSettingsModalOpen(false)} /> - { - setIsFlashcardModeOpen(false) - setInitialFileToCreateFlashcard('') - setInitialFileToReviewFlashcard('') - }} - initialFileToCreateFlashcard={initialFileToCreateFlashcard} - initialFileToReviewFlashcard={initialFileToReviewFlashcard} - /> ) } diff --git a/src/components/Flashcard/FlashcardCreateModal.tsx b/src/components/Flashcard/FlashcardCreateModal.tsx deleted file mode 100644 index 7900f759..00000000 --- a/src/components/Flashcard/FlashcardCreateModal.tsx +++ /dev/null @@ -1,174 +0,0 @@ -import React, { useRef, useState } from 'react' - -import { Button } from '@material-tailwind/react' -import { CircularProgress } from '@mui/material' -import posthog from 'posthog-js' -import { TypeAnimation } from 'react-type-animation' - -import { generateObject } from 'ai' -import ReorModal from '../Common/Modal' -import FilesSuggestionsDisplay, { SuggestionsState } from '../Editor/BacklinkSuggestionsDisplay' - -import FlashcardCore from './FlashcardsCore' -import { FlashcardQAPairSchema, FlashcardQAPairUI } from './types' -import { storeFlashcardPairsAsJSON } from './utils' -import resolveLLMClient from '@/lib/llm/client' -import { useFileContext } from '@/contexts/FileContext' - -interface FlashcardCreateModalProps { - isOpen: boolean - onClose: () => void - initialFlashcardFile?: string -} - -const FlashcardCreateModal: React.FC = ({ isOpen, onClose, initialFlashcardFile = '' }) => { - const [flashcardQAPairs, setFlashcardQAPairs] = useState([]) - const [isLoadingFlashcards, setIsLoadingFlashcards] = useState(false) - const [currentSelectedFlashcard, setCurrentSelectedFlashcard] = useState(0) - const [selectedFile, setSelectedFile] = useState(initialFlashcardFile) - const [suggestionsState, setSuggestionsState] = useState() - const [searchText, setSearchText] = useState(initialFlashcardFile) - const inputRef = useRef(null) - const { vaultFilesFlattened } = useFileContext() - - const initializeSuggestionsStateOnFocus = () => { - const inputCoords = inputRef.current?.getBoundingClientRect() - if (!inputCoords) { - return - } - setSuggestionsState({ - position: { - top: inputCoords.bottom, - left: inputCoords.x, - }, - textWithinBrackets: searchText, - onSelect: async (suggestion: string) => { - const suggestionWithExtension = await window.path.addExtensionIfNoExtensionPresent(suggestion) - setSearchText(suggestionWithExtension) - setSelectedFile(suggestionWithExtension) - setFlashcardQAPairs([]) - setSuggestionsState(null) - }, - }) - } - - const createFlashcardsFromFile = async (): Promise => { - posthog.capture('create_flashcard_from_file') - const llmName = await window.llm.getDefaultLLMName() - setIsLoadingFlashcards(true) - - const fileContents = await window.fileSystem.readFile(selectedFile) - const { object } = await generateObject({ - model: await resolveLLMClient(llmName), - output: 'array', - schema: FlashcardQAPairSchema, - messages: [ - { - content: `You are an expert in generating flashcards. You are asked to generate a list of flashcards for a note the user provides. Each flashcard has the following structure: -{ - question: string - answer: string -} - -Make sure you generate the flashcards in the correct format and that are relevant to the note provided. The user wants to test their knowledge on the note using the flashcards you generate.`, - role: 'system', - }, - { - content: `The note for which you will generate flashcards is the following:\n${fileContents}`, - role: 'user', - }, - ], - }) - - // so we'll need to display the error here if there is one: - const flashcardUIPairs = FlashcardQAPairSchema.array().parse(object) as FlashcardQAPairUI[] - setFlashcardQAPairs(flashcardUIPairs) - setIsLoadingFlashcards(false) - - storeFlashcardPairsAsJSON(flashcardUIPairs, selectedFile) - } - - return ( - -
-

- Select a file to generate flashcards for: - initializeSuggestionsStateOnFocus()} - onChange={(e) => { - setSearchText(e.target.value) - if (e.target.value.length === 0) { - setSelectedFile('') - } - }} - placeholder="Search for the files by name" - /> - {suggestionsState && ( - file.path)} - maxWidth="w-[800px]" - /> - )} -

- {!selectedFile && ( -

Choose a file by searching or by right clicking a file in directory

- )} - {isLoadingFlashcards && flashcardQAPairs.length === 0 && ( -
- -
- )} - -
- {selectedFile && ( - - )} -
-
-
- ) -} - -export default FlashcardCreateModal diff --git a/src/components/Flashcard/FlashcardMenuModal.tsx b/src/components/Flashcard/FlashcardMenuModal.tsx deleted file mode 100644 index 3b8f9ca9..00000000 --- a/src/components/Flashcard/FlashcardMenuModal.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import React, { useState } from 'react' - -import { Button } from '@material-tailwind/react' -import posthog from 'posthog-js' -import { BsPencilSquare } from 'react-icons/bs' -import { FaArrowAltCircleRight, FaRegArrowAltCircleRight } from 'react-icons/fa' -import { VscFeedback } from 'react-icons/vsc' - -import ReorModal from '../Common/Modal' - -import FlashcardCreateModal from './FlashcardCreateModal' -import FlashcardReviewModal from './FlashcardReviewModal' - -interface FlashcardMenuModalProps { - isOpen: boolean - onClose: () => void - initialFileToCreateFlashcard?: string - initialFileToReviewFlashcard?: string -} - -const FlashcardMenuModal: React.FC = ({ - isOpen, - onClose, - initialFileToCreateFlashcard, - initialFileToReviewFlashcard, -}) => { - const [isCreateFlashcardMode, setIsCreateFlashcardMode] = useState(!!initialFileToCreateFlashcard) - const [isReviewFlashcardMode, setIsReviewFlashcardMode] = useState(!!initialFileToReviewFlashcard) - - return ( - -
-

Flashcard Mode

- {isReviewFlashcardMode && ( - setIsReviewFlashcardMode(false)} /> - )} - {isCreateFlashcardMode && ( - setIsCreateFlashcardMode(false)} - initialFlashcardFile={initialFileToCreateFlashcard} - /> - )} - -
- - - -
-
-
- ) -} - -export default FlashcardMenuModal diff --git a/src/components/Flashcard/FlashcardReviewModal.tsx b/src/components/Flashcard/FlashcardReviewModal.tsx deleted file mode 100644 index ccdb2f89..00000000 --- a/src/components/Flashcard/FlashcardReviewModal.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import React, { useEffect, useState } from 'react' - -import ReorModal from '../Common/Modal' -import CustomSelect from '../Common/Select' - -import FlashcardCore from './FlashcardsCore' -import { FlashcardQAPairUI } from './types' -import { getFlashcardQnaPairsFromJsonFile, getFlashcardVaultDirectory } from './utils' - -interface FlashcardReviewModalProps { - isOpen: boolean - onClose: () => void -} - -const FlashcardReviewModal: React.FC = ({ isOpen, onClose }) => { - const [flashcardFiles, setFlashcardFiles] = useState([]) - const [selectedFlashcardFile, setSelectedFlashcardFile] = useState('') - const [flashcardQAPairs, setFlashcardQAPairs] = useState([]) - const [currentSelectedFlashcard, setCurrentSelectedFlashcard] = useState(0) - - useEffect(() => { - const getFlashcardsFromDirectory = async () => { - const vaultDirectoryWithFlashcards = await getFlashcardVaultDirectory() - const files = await window.fileSystem.getAllFilenamesInDirectory(vaultDirectoryWithFlashcards) - setFlashcardFiles(files) - setCurrentSelectedFlashcard(0) - } - - getFlashcardsFromDirectory() - }, []) - - // get flashcards to be reviewed when the file changes - useEffect(() => { - const readFlashcardJSONForQnAPairs = async () => { - const qnaPairs = await getFlashcardQnaPairsFromJsonFile(selectedFlashcardFile) - setFlashcardQAPairs(qnaPairs) - } - readFlashcardJSONForQnAPairs() - }, [selectedFlashcardFile]) - - return ( - -
-

Flashcard Review Mode

- -
- ({ - label: file, - value: file, - }))} - selectedValue={selectedFlashcardFile} - onChange={(value) => { - setCurrentSelectedFlashcard(0) - setSelectedFlashcardFile(value) - }} - // className="w-full" - /> -
- - {flashcardQAPairs.length === 0 &&

Choose a set of flashcards

} - -
-
- ) -} - -export default FlashcardReviewModal diff --git a/src/components/Flashcard/FlashcardsCore.tsx b/src/components/Flashcard/FlashcardsCore.tsx deleted file mode 100644 index f7a939ef..00000000 --- a/src/components/Flashcard/FlashcardsCore.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import React from 'react' - -import { Button } from '@material-tailwind/react' -import ReactCardFlip from 'react-card-flip' - -import ProgressBar from './ProgressBar' -import { FlashcardQAPairUI } from './types' - -interface FlashcardCoreProps { - flashcardQAPairs: FlashcardQAPairUI[] - setFlashcardQAPairs: (pairs: FlashcardQAPairUI[]) => void - currentSelectedFlashcard: number - setCurrentSelectedFlashcard: (current: number) => void -} - -const FlashcardCore: React.FC = ({ - flashcardQAPairs, - setFlashcardQAPairs, - currentSelectedFlashcard, - setCurrentSelectedFlashcard, -}) => { - const updateFlashcardUnderReview = (flashcardSelected: number, updatedFlashcard: FlashcardQAPairUI) => { - const updatedPairs = [...flashcardQAPairs] - updatedPairs[flashcardSelected] = updatedFlashcard - setFlashcardQAPairs(updatedPairs) - } - - return ( - flashcardQAPairs.length > 0 && ( - <> - - - - {flashcardQAPairs[currentSelectedFlashcard].isFlipped && ( // this boolean is required to ensure that we check the flipped boolean to prevent the answer from leaking - - )} - -
- - - -
- - ) - ) -} - -export default FlashcardCore diff --git a/src/components/Flashcard/ProgressBar.tsx b/src/components/Flashcard/ProgressBar.tsx deleted file mode 100644 index 2435960f..00000000 --- a/src/components/Flashcard/ProgressBar.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react' - -export interface ProgressBarProps { - completed: number - total: number - height: string -} - -const ProgressBar = ({ completed, total, height }: ProgressBarProps) => { - return ( -
-
- - {`${completed}/${total}`} - -
-
- ) -} - -export default ProgressBar diff --git a/src/components/Flashcard/index.ts b/src/components/Flashcard/index.ts deleted file mode 100644 index a05e9a9c..00000000 --- a/src/components/Flashcard/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './types' -export * from './utils' - -export { default as FlashcardReviewModal } from './FlashcardReviewModal' diff --git a/src/components/Flashcard/types.ts b/src/components/Flashcard/types.ts deleted file mode 100644 index bbe6c277..00000000 --- a/src/components/Flashcard/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { z } from 'zod' - -export const FlashcardQAPairSchema = z.object({ - question: z.string().describe('The question or prompt for the flashcard.'), - answer: z.string().describe('The answer or explanation for the flashcard question.'), -}) - -export type FlashcardQAPair = z.infer - -export interface FlashcardQAPairUI extends FlashcardQAPair { - isFlipped: boolean -} diff --git a/src/components/Flashcard/utils.ts b/src/components/Flashcard/utils.ts deleted file mode 100644 index b2e33791..00000000 --- a/src/components/Flashcard/utils.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { toast } from 'react-toastify' - -import { FlashcardQAPair, FlashcardQAPairUI } from './types' - -import { removeFileExtension } from '@/lib/file' - -export const QUESTION_FORMAT = 'Q:' -export const ANSWER_FORMAT = 'A:' -export const CONVERT_TO_FLASHCARDS_FROM_CHAT = 'Convert the above message to flashcards' - -const FLASHCARD_DIR = '.flashcards' - -export const storeFlashcardPairsAsJSON = async (qnaPairs: FlashcardQAPair[], currentFilePath: string | null) => { - if (!currentFilePath) { - toast.error('No file currently selected. Please open a file.') - return - } - const fileName = await window.path.basename(currentFilePath) - const trimmedFileName = removeFileExtension(fileName) - const filePath = await window.path.join( - await window.electronStore.getVaultDirectoryForWindow(), - FLASHCARD_DIR, - `${trimmedFileName}.json`, - ) - await window.fileSystem.writeFile({ - filePath, - content: JSON.stringify( - { - fileGeneratedFrom: currentFilePath, - qnaPairs, - }, - null, - 4, - ), - }) - toast.success('Flashcards stored as file!', { - closeButton: false, - autoClose: 500, - }) -} - -export const getFlashcardVaultDirectory = async (): Promise => { - const vaultDirectoryWithFlashcards = await window.path.join( - await window.electronStore.getVaultDirectoryForWindow(), - FLASHCARD_DIR, - ) - return vaultDirectoryWithFlashcards -} - -export const getFlashcardQnaPairsFromJsonFile = async (selectedFlashcardFile: string): Promise => { - if (!selectedFlashcardFile) { - return [] - } - const flashcardFullFilePath = await window.path.join(await getFlashcardVaultDirectory(), selectedFlashcardFile) - - const fileData = await window.fileSystem.readFile(flashcardFullFilePath) - const qnaPairs: FlashcardQAPairUI[] = (JSON.parse(fileData).qnaPairs as FlashcardQAPair[]).map((pair) => ({ - ...pair, - isFlipped: false, - })) - return qnaPairs -} diff --git a/src/components/Sidebars/IconsSidebar.tsx b/src/components/Sidebars/IconsSidebar.tsx index 49bf0385..c3caf50b 100644 --- a/src/components/Sidebars/IconsSidebar.tsx +++ b/src/components/Sidebars/IconsSidebar.tsx @@ -4,7 +4,7 @@ import { FaSearch } from 'react-icons/fa' import { GrNewWindow } from 'react-icons/gr' import { ImFilesEmpty } from 'react-icons/im' import { IoChatbubbleEllipsesOutline } from 'react-icons/io5' -import { MdOutlineQuiz, MdSettings } from 'react-icons/md' +import { MdSettings } from 'react-icons/md' import { VscNewFolder } from 'react-icons/vsc' import { HiOutlinePencilAlt } from 'react-icons/hi' @@ -14,11 +14,9 @@ import { useContentContext } from '@/contexts/ContentContext' import NewDirectoryComponent from '../File/NewDirectory' export interface IconsSidebarProps { - readonly getShortcutDescription: (action: string) => string - - readonly isNewDirectoryModalOpen: boolean - - readonly setIsNewDirectoryModalOpen: React.Dispatch> + getShortcutDescription: (action: string) => string + isNewDirectoryModalOpen: boolean + setIsNewDirectoryModalOpen: React.Dispatch> } const IconsSidebar: React.FC = ({ @@ -29,7 +27,7 @@ const IconsSidebar: React.FC = ({ const { sidebarShowing, setSidebarShowing } = useChatContext() const [sidebarWidth, setSidebarWidth] = useState(40) - const { isSettingsModalOpen, setIsSettingsModalOpen, setIsFlashcardModeOpen } = useModalOpeners() + const { isSettingsModalOpen, setIsSettingsModalOpen } = useModalOpeners() const { createUntitledNote } = useContentContext() useEffect(() => { @@ -117,19 +115,6 @@ const IconsSidebar: React.FC = ({ /> -
setIsFlashcardModeOpen(true)} - > -
- -
-
void - isFlashcardModeOpen: boolean - setIsFlashcardModeOpen: (flashcardOpen: boolean) => void - initialFileToCreateFlashcard: string - setInitialFileToCreateFlashcard: (flashcardName: string) => void - initialFileToReviewFlashcard: string - setInitialFileToReviewFlashcard: (flashcardName: string) => void } const ModalContext = createContext(undefined) @@ -30,36 +21,13 @@ export const useModalOpeners = (): ModalOpenContextType => { export const ModalProvider: React.FC = ({ children }) => { const [isSettingsModalOpen, setIsSettingsModalOpen] = useState(false) - const [isFlashcardModeOpen, setIsFlashcardModeOpen] = useState(false) - const [initialFileToCreateFlashcard, setInitialFileToCreateFlashcard] = useState('') - const [initialFileToReviewFlashcard, setInitialFileToReviewFlashcard] = useState('') - - useEffect(() => { - const createFlashcardFileListener = window.ipcRenderer.receive( - 'create-flashcard-file-listener', - (noteName: string) => { - setIsFlashcardModeOpen(!!noteName) - setInitialFileToCreateFlashcard(noteName) - }, - ) - - return () => { - createFlashcardFileListener() - } - }, [setIsFlashcardModeOpen, setInitialFileToCreateFlashcard]) const modalOpenContextValue = useMemo( () => ({ isSettingsModalOpen, setIsSettingsModalOpen, - isFlashcardModeOpen, - setIsFlashcardModeOpen, - initialFileToCreateFlashcard, - setInitialFileToCreateFlashcard, - initialFileToReviewFlashcard, - setInitialFileToReviewFlashcard, }), - [isSettingsModalOpen, isFlashcardModeOpen, initialFileToReviewFlashcard, initialFileToCreateFlashcard], + [isSettingsModalOpen], ) return {children} diff --git a/src/lib/welcome-note.ts b/src/lib/welcome-note.ts index 40ea4494..720adfaf 100644 --- a/src/lib/welcome-note.ts +++ b/src/lib/welcome-note.ts @@ -30,14 +30,6 @@ Some features you should be aware of: - You can also create inline links by surrounding text with two square brackets (like in Obsidian). [[Like this]] -- **AI Flashcards:** - - - Generate flashcards from any note by going to the chat window and hitting the toggle in the bottom right to "Flashcard Ask" mode. - - - Then generate flashcards by running a prompt like "Generate flashcards for this note" - - - Then hit the flashcard icon in the left sidebar to see your flashcards :) - You can import notes from other apps by adding markdown files to your vault directory. Note that Reor will only read markdown files. Please join our [Discord community](https://discord.gg/QBhGUFJYuH) to ask questions, give feedback, and get help. We're excited to have you on board!`