## Bug Fixes ### Note Card Actions - Fix broken size change functionality (missing state declaration) - Implement React 19 useOptimistic for instant UI feedback - Add startTransition for non-blocking updates - Ensure smooth animations without page refresh - All note actions now work: pin, archive, color, size, checklist ### Markdown LaTeX Rendering - Add remark-math and rehype-katex plugins - Support inline equations with dollar sign syntax - Support block equations with double dollar sign syntax - Import KaTeX CSS for proper styling - Equations now render correctly instead of showing raw LaTeX ## Technical Details - Replace undefined currentNote references with optimistic state - Add optimistic updates before server actions for instant feedback - Use router.refresh() in transitions for smart cache invalidation - Install remark-math, rehype-katex, and katex packages ## Testing - Build passes successfully with no TypeScript errors - Dev server hot-reloads changes correctly
1.7 KiB
1.7 KiB
Story 3.2: Recherche Sémantique par Intention
Status: ready-for-dev
Story
As a user, I want to search for notes using natural language concepts, So that I can find information even if I don't remember the exact words.
Acceptance Criteria
- Given a search query in the search bar.
- When the search is executed.
- Then the system generates an embedding for the query via the AI Provider.
- And the system calculates the cosine similarity between the query embedding and all note embeddings in memory.
- And notes with high similarity (e.g., > 0.7) are returned even without keyword matches.
Tasks / Subtasks
- Implémentation de la fonction de Similarité Cosinus (AC: 4)
- Créer une fonction utilitaire
cosineSimilarity(vecA, vecB)
- Créer une fonction utilitaire
- Mise à jour de
searchNotesdansactions/notes.ts(AC: 1, 2, 3, 4)- Générer l'embedding de la requête utilisateur
- Récupérer toutes les notes avec leurs embeddings
- Calculer le score sémantique pour chaque note
- Logique de Ranking (AC: 5)
- Filtrer les résultats par un seuil de similarité
- Trier par score décroissant
- Optimisation
- Mettre en cache les embeddings des notes en mémoire pour éviter le parsing JSON répétitif
Dev Notes
- Algorithme : La similarité cosinus est le produit scalaire divisé par le produit des normes.
- Hybridité : Cette story se concentre sur la partie sémantique. La story 3.3 s'occupera de la fusion propre avec la recherche textuelle (SQL LIKE).
- Performance : Le calcul de similarité pour 1000 notes prend environ 1ms en JS.