Fix custom Callout Manager callouts not appearing in suggestions - #100
Fix custom Callout Manager callouts not appearing in suggestions#100Jackie-Li-0228 wants to merge 4 commits into
Conversation
Completr currently trusts the Callout Manager API result set, which can leave persisted custom callouts out of the completion candidates. This change keeps the API-backed suggestions as the primary source, then augments them with any custom callouts persisted in Callout Manager's plugin data and deduplicates by replacement. Constraint: Custom callouts are persisted under Callout Manager plugin data, not Completr settings Rejected: Patch the built plugin output only | upstream needs a source-level fix Confidence: medium Scope-risk: narrow Reversibility: clean Directive: Keep Callout Manager API results authoritative and use plugin-data parsing only as a fallback augmentation path Tested: ; parsed local Callout Manager data containing custom callout Not-tested: End-to-end Obsidian UI verification of the suggestion popup
There was a problem hiding this comment.
Pull request overview
Fixes missing custom Callout Manager callouts in Completr suggestions by supplementing API-provided callouts with persisted Callout Manager plugin data and deduplicating the merged results.
Changes:
- Add fallback loader to read custom callouts from Callout Manager’s persisted
data.json. - Merge API callouts with persisted custom callouts and deduplicate suggestions by replacement.
- Make Callout Manager color handling nullable/optional when building suggestions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .map(callout => newSuggestion( | ||
| api.getTitle(callout), | ||
| callout.id, | ||
| callout.icon, | ||
| `rgb(${callout.color})`, | ||
| callout.color == null ? undefined : `rgb(${callout.color})`, | ||
| )); |
There was a problem hiding this comment.
newSuggestion is declared to take icon: string and color: string, but this call may pass undefined when the Callout Manager callout has no color. This will introduce a TypeScript type error and makes the helper’s contract inconsistent with its new usage. Consider updating newSuggestion to accept optional icon/color (or passing explicit string defaults) and ensuring the resulting Suggestion metadata matches the expected shape when values are absent.
Custom Callout Manager entries may omit icon or color metadata, so the helper that creates callout suggestions needs to match the optional shape already accepted by Suggestion. Constraint: Callout Manager persisted custom callouts may contain partial metadata Confidence: high Scope-risk: narrow Tested: npm run build
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@Jackie-Li-0228 could you make a release with the fix in your repo so we can install it with BRAT? |
Summary
When Completr is configured to use
Callout Manageras the callout source, custom callouts created in Callout Manager may not appear in the suggestion list.This change keeps the Callout Manager API as the primary source of suggestions, and adds a fallback that reads persisted custom callouts from Callout Manager's plugin data. The
merged suggestions are then deduplicated by replacement.
Reproduction
insightCallout Manager> [!insBefore
The custom callout may be missing from the suggestion list.
After
The custom callout is included in the suggestion list.
Implementation notes
Verification
npm run buildinsightcalloutNotes
tsc --noEmitcurrently reports existing upstream type declaration conflicts in this repo. This change does not add a new build failure.