Repository navigation
Commit 8d4f7f7
Fix getUsersNoteFileExtension() returning a function in React windows
In an HTML/React window DataStore is an async bridge proxy: every property
access returns a function, so the truthiness check in
getUsersNoteFileExtension() returned that function instead of a string.
makeCalendarFilename() then stringified it, producing filenames like
"20260829.function(...args) { return sendBridgeCall(...) }".
Visible in the Dashboard's Add-to-any-note dialog: picking a date in the
NoteChooser calendar picker filled the Note field (and the heading-chooser's
sourceNote) with that function source.
- NPFileExtensions: only trust an actual non-empty string; fall back to
DEFAULT_NOTE_FILE_EXTENSION for anything else. Trim and strip a leading dot.
- NoteChooser: match the picked date against loaded notes on the filename
without its extension, since a React window can't know the real extension.
- Tests for the bridge-function case, non-string values, and trimming.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 9b42b28 commit 8d4f7f7
3 files changed
Lines changed: 36 additions & 4 deletions
File tree
- helpers
- __tests__
- react/DynamicDialog
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
99 | 121 | | |
100 | 122 | | |
101 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
404 | 410 | | |
405 | 411 | | |
406 | 412 | | |
| |||
0 commit comments