|
| 1 | +# TODO: X-Callback Wizard audit vs NotePlan docs |
| 2 | + |
| 3 | +Reference: [NotePlan x-callback-url scheme](https://help.noteplan.co/article/49-x-callback-url-scheme) |
| 4 | + |
| 5 | +Compiled 2026-05-27 after fixing `/addNote` `noteText` → `text` (v1.11.1). |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Summary |
| 10 | + |
| 11 | +| Status | Count | |
| 12 | +|---|---| |
| 13 | +| Correct / aligned | 8 actions | |
| 14 | +| Bugs in generated URLs | 2 in `/addNote` | |
| 15 | +| Doc vs code naming uncertainty | 1 (`filename` vs `fileName`) | |
| 16 | +| Wizard UX gaps (valid params not offered) | Several | |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Priority fixes |
| 21 | + |
| 22 | +- [ ] **`/addNote` — gate window params on `openNote=yes`** |
| 23 | + - Lines 266–268 always ask about floating/split/existing window. |
| 24 | + - If user chooses `openNote=no` but `subWindow=yes`, window params can still end up in the URL. |
| 25 | + - `/addText` only collects window options when `openNote=yes`. |
| 26 | + |
| 27 | +- [ ] **`/addNote` — `useExistingSubWindow` must include `subWindow=yes`** |
| 28 | + - `createAddTextCallbackUrl()` and `createOpenOrDeleteNoteCallbackUrl()` both add `&subWindow=yes` when `useExistingSubWindow=yes` (required per docs/CHANGELOG). |
| 29 | + - `addNote()` can emit `useExistingSubWindow=yes` alone — broken URL. |
| 30 | + |
| 31 | +- [ ] **`/addNote` — refactor to use `askOpenType()`** |
| 32 | + - Would match open/addText flows and fix the two bugs above. |
| 33 | + - Note: `/addNote` docs do not list `reuseSplitView` (only `/openNote` does). |
| 34 | + |
| 35 | +- [ ] **`/addNote` — validate title or text required** |
| 36 | + - Docs: *"A new note should have either a title or a text. Empty notes are not allowed."* |
| 37 | + - Wizard allows both blank and still builds a URL. |
| 38 | + |
| 39 | +- [ ] **`/search` — empty text should clear search** |
| 40 | + - `search()` returns `''` if user submits empty text. |
| 41 | + - Docs say empty `text` clears the search field — should emit `search?text=`. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Lower priority / UX gaps |
| 46 | + |
| 47 | +- [ ] **`/addText` — offer `noteTitle` path** |
| 48 | + - Currently only `chooseNote()` → filename, or calendar date. |
| 49 | + - Docs support `noteTitle` for regular notes. |
| 50 | + |
| 51 | +- [ ] **`/deleteNote` — offer delete by title** |
| 52 | + - Menu label says "DELETE a note by title" but wizard only supports calendar date or pick-note (filename). |
| 53 | + |
| 54 | +- [ ] **`/openNote` — offer open by note title** |
| 55 | + - Currently only `chooseNote()` → filename, or calendar date. |
| 56 | + |
| 57 | +- [ ] **`/openNote` — ISO week calendar form** |
| 58 | + - Docs support `noteDate=2022-W32`; wizard only offers day dates (`today`, `yesterday`, `tomorrow`, YYYYMMDD). |
| 59 | + |
| 60 | +- [ ] **Combined search wizard** |
| 61 | + - File TODO already notes: `search?text=` or `search?filter=Upcoming`. |
| 62 | + - Filter exists via `getFilter()` as separate menu item; could unify. |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Doc vs code naming (verify in NotePlan) |
| 67 | + |
| 68 | +- [ ] **`filename` vs `fileName`** |
| 69 | + - Docs use `filename` for `/openNote` but `fileName` for `/addText` and `/deleteNote`. |
| 70 | + - Plugin consistently emits **`filename`** (lowercase) everywhere, including tests. |
| 71 | + - Likely works despite doc inconsistency — quick live test if anything fails. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Per-action status (reference) |
| 76 | + |
| 77 | +### `/openNote` — mostly correct |
| 78 | + |
| 79 | +| Doc param | Wizard | Status | |
| 80 | +|---|---|---| |
| 81 | +| `noteDate` | today / yesterday / tomorrow / YYYYMMDD | OK | |
| 82 | +| `timeframe` | week / month / quarter / year (calendar only) | OK | |
| 83 | +| `noteTitle` | Heading/line links: `#heading` or `^blockId` | OK | |
| 84 | +| `filename` | chooseNote() → note filename | OK | |
| 85 | +| `heading` | Separate param when filename + heading | OK | |
| 86 | +| Window params | askOpenType(); companion params in helper | OK | |
| 87 | +| `highlightStart` / `highlightLength` | askHighlight() | OK | |
| 88 | + |
| 89 | +Known workaround: "Open a Folder" uses `openNote?filename=<folder>` (see `NPOpenFolders.js`). |
| 90 | + |
| 91 | +### `/addText` — correct params, UX gaps |
| 92 | + |
| 93 | +| Doc param | Wizard | Status | |
| 94 | +|---|---|---| |
| 95 | +| `noteDate` | Calendar path | OK | |
| 96 | +| `noteTitle` | Not offered | Gap | |
| 97 | +| `fileName` | Emitted as `filename` | See naming note | |
| 98 | +| `text`, `mode`, `openNote` | OK | OK | |
| 99 | +| Window params | Only when openNote=yes via askOpenType() | OK | |
| 100 | +| `reuseSplitView` | In helper; not in addText docs | Undocumented but intentional | |
| 101 | + |
| 102 | +### `/addNote` — 2 bugs + gaps |
| 103 | + |
| 104 | +| Doc param | Wizard | Status | |
| 105 | +|---|---|---| |
| 106 | +| `noteTitle`, `text`, `folder`, `openNote` | OK (text fixed 1.11.1) | OK | |
| 107 | +| Window params | Three separate yes/no prompts | Bugs | |
| 108 | +| `highlightStart` / `highlightLength` | When openNote=yes | OK | |
| 109 | + |
| 110 | +### `/deleteNote` — correct, limited UX |
| 111 | + |
| 112 | +Uses `filename` via chooseNote(); no title path. |
| 113 | + |
| 114 | +### `/openView` — correct |
| 115 | + |
| 116 | +`name` + `folder` via `openFolderView()`. Default folder view uses openNote hack. |
| 117 | + |
| 118 | +### `/search`, `/selectTag`, `/installPlugin`, `/toggleSidebar` — correct |
| 119 | + |
| 120 | +### `/runPlugin`, `/noteInfo`, heading/line links — correct |
| 121 | + |
| 122 | +### Not NotePlan x-callback |
| 123 | + |
| 124 | +- `runShortcut` — Apple Shortcuts URL |
| 125 | +- Templating / TemplateRunner — plugin-specific |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## Done |
| 130 | + |
| 131 | +- [x] **`/addNote` — `noteText` → `text`** (v1.11.1) |
0 commit comments