Commit f3c85ca
authored
feat: add Notes Space with unified architecture (#698)
* feat(notes): add CodeMirror 6 dependencies
* refactor(notes): make NotesEditor standalone with defineModel
* feat(spaces): add dev space with editor demo
* fix(notes): hide header mark with trailing space, show code marks on block focus
* feat(notes): add rounded corners and padding to fenced code blocks
* fix(notes): show marks only when cursor is between them, not on entire line
* chore(dev): expand demo markdown content with all supported elements
* fix(notes): use primary color for links instead of accent
* feat(notes): add tab/shift-tab indentation support
* feat(notes): add smart list indentation with ordered list renumbering
* docs: add Notes Space design spec
* docs: update Notes Space spec after review
Address review findings:
- Watcher integration: ignore __spaces__/notes/ in snippet sync
- Own getNotesPaths() function, separate from snippet getPaths()
- Own notesRuntimeRef singleton cache
- Storage contracts and useStorage() integration
- Notes-specific reserved names (not reusing snippet list)
- Separate content update endpoint (PATCH /notes/:id/content)
- Note serialization: frontmatter + raw body (no fragment parsing)
- Composables re-export from index.ts
- notesState as separate electron-store object
* docs: address final review findings in Notes Space spec
- Scope watcher ignore to __spaces__/notes/ only (not __spaces__/ broadly)
- Use separate useNotesStorage() accessor instead of extending StorageProvider
- Own writeNoteFolderMetadata() (FolderRecord has defaultLanguage, NoteFolderRecord doesn't)
- Reuse shared pendingStateWriteByPath for state debounce
- Note to add 'notes' case in refreshAfterStorageSync() switch
* docs: add Notes Space implementation plan
* feat(notes): add notes storage types and contracts
Add NotesPaths, NotesState, MarkdownNote, NotesRuntimeCache and other
runtime types. Add notes contracts (NoteRecord, NotesStorage,
NotesFoldersStorage, NoteTagsStorage, NotesStorageProvider) to the
shared contracts file.
* feat(notes): add notes constants, paths, and validation support
Add getNotesPaths(), notesRuntimeRef singleton, notes-specific path
constants. Add folder path utilities (buildNotesFolderPathMap,
findNotesFolderById, etc.). Extend validateEntryName to accept 'note'
kind.
* feat(notes): add notes state persistence with shared debounce
Add loadNotesState, saveNotesState, ensureNotesStateFile that reuse
the shared pendingStateWriteByPath maps from the snippet runtime.
State version starts at 1.
* feat(notes): add note file I/O, serialization, and folder metadata
Add serializeNote (YAML frontmatter + raw markdown body), readNoteFromFile,
writeNoteToFile, persistNote, loadNotes, findNoteById, listNoteMarkdownFiles.
Add notes folder metadata read/write without legacy migration or
defaultLanguage.
* feat(notes): add notes search index with trigram matching
Add buildNotesSearchIndex, getNoteIdsBySearchQuery, and
invalidateNotesSearchIndex using the same trigram + word token
algorithm as snippet search.
* feat(notes): add notes sync, runtime cache, and barrel export
Add syncNotesFoldersWithDisk, syncNotesRuntimeWithDisk,
getNotesRuntimeCache, resetNotesRuntimeCache for the notes storage
runtime. Add barrel export index.ts for the notes runtime module.
* fix(notes): add missing META_FILE_NAME re-export in notes constants
* feat(notes): add notes folders CRUD storage
* feat(notes): add notes CRUD storage
* feat(notes): add notes tags storage, provider index, and barrel export
* feat(notes): add useNotesStorage accessor and ignore notes in snippet watcher
* feat(notes): add API DTOs for notes, note-folders, note-tags
* feat(notes): add REST API routes for notes, note-folders, note-tags
* feat(notes): register notes space, routing, and i18n keys
* feat(notes): add notes composables (useNotes, useNoteFolders, useNoteTags, useNotesApp)
* feat(notes): add 3-column notes space layout
* feat(notes): add notes sidebar with library and folder tree
* feat(notes): add virtualized notes list with search and context menu
* feat(notes): add notes editor pane connecting CM6 to composable
* feat(notes): add notes case to storage sync handler
When external vault changes are detected (e.g. sync from another device),
the notes space now refreshes folders, notes, and tags data.
* fix(notes): replace (api as any) casts with typed API method calls
* fix(notes): fix api:generate script and regenerate API client with notes endpoints
* fix(notes): add response schema to notes GET endpoint for proper API typing
* fix(notes): add external drop handler to move notes into folders via drag-drop
* feat(notes): add editor header with note name input and action buttons slot
* fix(notes): re-create editor when switching notes via key binding
* fix(notes): invalidate search index on state save so search finds new/updated notes
* fix(notes): invalidate search index when note content is updated
* fix(notes): rewrite search to match code space pattern with substring fallback
- Add w: token fallback when trigrams yield no candidates (short words)
- Use intersectSets for proper candidate narrowing
- Final check uses searchText.includes(normalizedQuery) for substring match
- ensureNotesSearchIndex now returns cache for caller use
* fix(notes): return empty trigrams for words < 3 chars to match code space behavior
* fix(notes-search): support one-character queries
* fix(notes-search): harden runtime cache behavior
* fix(notes): close note-space parity gaps
* chore: merge branch 'main' into feat/notes-editor-cm6-clean
* fix(notes-ui): align tags panel placement with code space
* feat: add tag input1 parent 682b402 commit f3c85ca
File tree
180 files changed
+18123
-2058
lines changed- docs/spaces
- scripts
- src
- main
- api
- dto
- routes
- i18n/locales/en_US
- ipc/handlers
- storage
- providers/markdown
- notes
- runtime
- __tests__
- storages
- __tests__
- runtime
- __tests__
- storages
- __tests__
- store
- module
- types
- types
- renderer
- components
- app-space-shell
- editor
- code-image
- header
- json-visualizer
- markdown
- preview
- notes
- __tests__
- cm-extensions
- __tests__
- fixtures
- preferences
- sidebar
- folders/custom-icons
- ui
- action-button
- shadcn
- button
- select
- switch
- composables
- spaces/notes
- __tests__
- ipc/listeners
- router
- services/api/generated
- views
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
180 files changed
+18123
-2058
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| |||
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | | - | |
| 173 | + | |
| 174 | + | |
166 | 175 | | |
0 commit comments