-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(search): add create into inbox to search #7287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d155e78 to
41973b7
Compare
41973b7 to
bda16f3
Compare
e226324 to
794060d
Compare
|
Hm, I can't get every checks to pass, I don't think this PR changes are at fault based on reviewing the logs. If it is pls send me back to draft. I tested the code and it works reliably on my computer. Its now officially open for review now, not a Draft anymore. |
|
for the code-review it is especially interesting if it was okay to edit these 2 files mention_customization and augmentation.ts (See picture). Through git blame i found your name there and concluded custome code there would be okay. Maybe there are other ways to fix what I did here, but fixing without editing these files would be a bit more convoluted. |
I pushed commit 80afdaf with the changes to review (branch) If @eliandoran is ok with that commit, please cherry pick it, or I can add it to your PR if it allows edits from maintainers. |
|
@contributor Thanks for the additional review. And Improvement Feel free to play around with things that don't align with standards I am not so much aware of to speed up the process. |
| marker: string; | ||
| text?: string; | ||
| range?: ModelRange; | ||
| mention: string | { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file already had mix of tab spaces on different lines. Now it has mix on the same lines too.
I see that all original files from ckeditor uses tabs (for easier sync with upstream maybe?). But this is not enforced on ci or editorconfig rules.
@eliandoran
Let's decide what to use for this file in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to ignore the whitespace changes for now. I suppose they are a left over from when we merged the CKEditor customization into the monorepo.
|
Okay, I will revert to draft.
|
8f499d1 to
bc87aae
Compare
|
@contributor The Commit contributor@80afdaf didn't work yet. In my case it generated the following error: Error Message{ "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951", "lineno": 7279, "colno": 11, "date": 1760748587043 }, { "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951", "lineno": 7279, "colno": 11, "date": 1760748592273 }, { "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/ckeditor5.js?v=23194951:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/Trilium/.cache/vite/deps/chunk-D46A7232.js?v=23194951", "lineno": 7279, "colno": 11, "date": 1760748599023 } ] Stack: ErrorWhat needs to be fixed I usually test trilium by Irrelvant extra detailsWhile I love the code review, reviewing Code that isn't running properly yet is time consuming, as broken code always has weird glitches that need thinking investment in the code changes. So asking for cherry pick of a commit not tested yet, asks for more investment than glancing, which sometimes can be quite uncomfortable, as then the communication get ambiguous. What to do if it doesn't work? criticize creating bad impression? fix it yourself? reject? How could it be fixed? previously one way I had to solved it is that i would let ckeditor define a subset of that enum that refers to a string, and then let have trilium refer to the same string. I can fix the issue, but I am not 100% sure what you have planned, therefore would appreciate it, if you could fix it to preserve intent. I cherry pick afterwards Conclusion Therefore:
Status: DONE Footnotes |
I built, ran and tested the commit week ago before offering it.
git log of the branch the branch https://github.com/contributor/trilium/tree/search-to-inbox: I use the same command to build and run. Probably you miss something during cherry pick. Can you build and run my branch? |
|
I just tried the commit over current state of the PR - and it cherry picks cleanly, and the app is running perfectly as well The branch is here: https://github.com/contributor/trilium/tree/search-into-inbox-new |
This comment was marked as outdated.
This comment was marked as outdated.
|
@contributor Actually sorry for my fast generalization: funnily I only tested what you didn't test. Thus miscommunication lol. not working:
|
|
@contributor Trace & Log Stack Trace200 GET /api/notes/RGCyxYx1gtqE/blob with 348 bytes took 0ms JS Error: Uncaught error: Message: Uncaught CKEditorError: unexpected-error Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error Original error: ReferenceError: CreateNoteAction is not defined, URL: http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b, Line: 7279, Column: 11, Error object: TypeError: Converting circular structure to JSON --> starting at object with constructor 'ClassicEditor' | property 'accessibility' -> object with constructor 'Accessibility' --- property '_editor' closes the circle, Stack: ReferenceError: CreateNoteAction is not defined at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35) at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7728:37) at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7731:21) at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:44674:20) at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:46394:28) at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38746:14) at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38729:22) at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) Stack: Error at Object.logError (http://127.0.0.1:37742/assets/v0.99.1/src/services/ws.ts:22:14) at window.onerror (http://127.0.0.1:37742/assets/v0.99.1/src/services/glob.ts:33:8) JS Info: CKEditor state changed to crashed JS Error: CKEditor crash logs: [ { "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b", "lineno": 7279, "colno": 11, "date": 1760782443406 } ] Stack: Error at logError (http://127.0.0.1:37742/assets/v0.99.1/src/services/ws.ts:22:14) at EditorWatchdog. (http://127.0.0.1:37742/assets/v0.99.1/src/widgets/type_widgets/editable_text.ts:119:7) at EditorWatchdog._fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42864:16) at EditorWatchdog._handleError (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42902:12) at Watchdog._boundErrorHandler (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42815:14) JS Info: CKEditor state changed to initializing JS Info: Creating new CKEditor 200 GET /api/search/%23textSnippet with 2 bytes took 1ms JS Info: CKEditor state changed to ready 204 PUT /api/notes/RGCyxYx1gtqE/data with 0 bytes took 4ms 200 GET /api/notes/RGCyxYx1gtqE/blob with 163 bytes took 1ms 200 GET /api/autocomplete?query=&activeNoteId=RGCyxYx1gtqE&fastSearch=true with 143 bytes took 1ms Slow 200 GET /api/autocomplete?query=jdkfls&activeNoteId=RGCyxYx1gtqE&fastSearch=true with 2 bytes took 12ms 204 PUT /api/notes/RGCyxYx1gtqE/data with 0 bytes took 7ms 200 GET /api/notes/RGCyxYx1gtqE/blob with 170 bytes took 0ms JS Error: Uncaught error: Message: Uncaught CKEditorError: unexpected-error Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error Original error: ReferenceError: CreateNoteAction is not defined, URL: http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b, Line: 7279, Column: 11, Error object: TypeError: Converting circular structure to JSON --> starting at object with constructor 'ClassicEditor' | property 'accessibility' -> object with constructor 'Accessibility' --- property '_editor' closes the circle, Stack: ReferenceError: CreateNoteAction is not defined at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35) at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7728:37) at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7731:21) at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:44674:20) at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:46394:28) at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38746:14) at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38729:22) at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16) Stack: Error at Object.logError (http://127.0.0.1:37742/assets/v0.99.1/src/services/ws.ts:22:14) at window.onerror (http://127.0.0.1:37742/assets/v0.99.1/src/services/glob.ts:33:8) JS Info: CKEditor state changed to crashed JS Error: CKEditor crash logs: [ { "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b", "lineno": 7279, "colno": 11, "date": 1760782443406 }, { "message": "unexpected-error\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error\nOriginal error: ReferenceError: CreateNoteAction is not defined", "stack": "ReferenceError: CreateNoteAction is not defined\n at CustomMentionCommand.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/packages/ckeditor5/src/plugins/mention_customization.ts:32:35)\n at CustomMentionCommand. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7728:37)\n at CustomMentionCommand.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at [as execute] (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7731:21)\n at CommandCollection.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:44674:20)\n at ClassicEditor.execute (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:46394:28)\n at MentionsView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38746:14)\n at MentionsView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)\n at MentionListItemView. (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/ckeditor5.js?v=e341837d:38729:22)\n at MentionListItemView.fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:7413:16)", "filename": "http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b", "lineno": 7279, "colno": 11, "date": 1760782448777 } ] Stack: Error at logError (http://127.0.0.1:37742/assets/v0.99.1/src/services/ws.ts:22:14) at EditorWatchdog. (http://127.0.0.1:37742/assets/v0.99.1/src/widgets/type_widgets/editable_text.ts:119:7) at EditorWatchdog._fire (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42864:16) at EditorWatchdog._handleError (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42902:12) at Watchdog._boundErrorHandler (http://127.0.0.1:37742/assets/v0.99.1/@fs/home/jakob/git/contributor/trilium/.cache/vite/deps/chunk-D46A7232.js?v=f45fe61b:42815:14) JS Info: CKEditor state changed to initializing JS Info: Creating new CKEditorgit logcommit 80afdaf (HEAD -> search-to-inbox, origin/search-to-inbox) Author: contributor Date: Sun Oct 12 23:06:53 2025 +0300commit 794060d commit a254e96 commit fbb4ab6 |
|
@contributor Everything else works as expected. |
|
@werererer I see the problem with creating a note via mentions. Looking into this |
@contributor However I believe the problem here is that we can't communicate because there may be a missmatch in mental model thinking about this problem. I am thinking exactly like the porphyrian tree, the concept should be able to be understood in around 5 minutes. I don't know if you can understand my reasoning in code without it: This is the best resource I used to learn about it: its basically theory about how to create types for this usecase: |
|
I still believe that original flatten structure (CreateNoteIntoInboxOpts is CreateNoteAtUrlOpts, and not CreateNoteOpts) is better and more type safe model. Current state (allows assigning invalid values): export type CreateNoteIntoInboxOpts = CreateNoteOpts;
const t: CreateNoteIntoInboxOpts = {
target: CreateNoteTarget.IntoInbox
}
t.target = CreateNoteTarget.IntoNoteURL; // make no sense, but type system allows itOriginally (prevents assigning invalid values): export type CreateNoteIntoInboxOpts = Extract<CreateNoteAtUrlOpts, { target: CreateNoteTarget.IntoInbox }>;
const t: CreateNoteIntoInboxOpts = {
target: CreateNoteTarget.IntoInbox
}
t.target = CreateNoteTarget.IntoNoteURL; // error: Type 'CreateNoteTarget.IntoNoteURL' is not assignable to type 'CreateNoteTarget.IntoInbox' |
|
@contributor Actually if you make the type check work! I will prob agree. That we have a semantic missmatch of understanding where which type belongs because of differences in understanding these concepts described by the types is not a problem for me! So just make it work! I will update my own semantic understanding afterwards |
|
@contributor if type check makes no error and even if I feel a semantic Missmatch I will cherry pick anyways and continue towards reopening review after usual testing. Because names are just syntax which I dont care much about in this case. Later in review elian can decide the rest of open questions (that are given way above) so that we can finish this work. Therefore:
|
c1cb804 to
1bef6d8
Compare
|
@contributor Thanks to your input including correction suggestion, I simplified the type system, by removing layers. Another Reason is YAGNI1. Other parts of the code where also simplified, some names where improved. Unfortunately I couldn't take your code suggestion as it created type errors which where not easily resolvable. If you agree now with the new code, I will rebase onto the newest version and test again for bugs. If you do not: point out where, it will be improved. To revert this decision the code I force pushed away is now here: Footnotes |
@werererer Looks simpler and much better now, good job! I like how We could avoid upcasting in |
|
@contributor okay, i integrated your fix. Actually the commit improved type checking and uncovered small logical errors in the code! caught by If you are okay with the current state of code (without open questions resolved yet), then Pls explicitly give me an okay to move on to the next steps (resolving open questions) to improve PR merge efficiency. Else pls provide more criticism: I will addressed them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@werererer there's likely a bug with creating ai chat note
…e subsequent found bugs
|
type-casting with I removed all as casts from the commits. |
|
@contributor I tested everything churned away through some more bugs. I can't find any more bugs. However I did not test the AI feature, because I am not familiar with it, maybe if you know better it would be great to get that tested as well. if it fails the most likely culprit would be a change in behavior between the original create_note and the one we have right now. The failing unit tests do not seem relevant to the code. If it looks alright I will continue to request review from elian (after some more tests and rebase). If not, pls tell where we need what fix. |
@werererer I don't know it either. I migrated from Trilium Classic month ago, still have to try new features. Quick AI test in release show that it can create notes, but seems only in root (or maybe I prompted not good enough lol) Update: build for PR does the same. Creates a note in root. This aligns to code that hard code root path So this part seems work as intended |






Solves: #6817
State: Workes. waiting for Review
TODO:
Done:
createNotecalls with unifiedcreateNoteIntoPath/createNoteIntoInboxCreateModeto autocomplete systemMentionActionenum for CKEditor mentionsnote_autocomplete.tsand related widgets for consistencyPS
Yes I had to put my hands on many files, because the logic of creating notes was handled by a lot of different files. After this PR managing the code for creating notes should becomes easier.