Skip to content

Fix custom Callout Manager callouts not appearing in suggestions - #100

Open
Jackie-Li-0228 wants to merge 4 commits into
tth05:masterfrom
Jackie-Li-0228:fix/callout-manager-custom-callouts
Open

Fix custom Callout Manager callouts not appearing in suggestions#100
Jackie-Li-0228 wants to merge 4 commits into
tth05:masterfrom
Jackie-Li-0228:fix/callout-manager-custom-callouts

Conversation

@Jackie-Li-0228

Copy link
Copy Markdown

Summary

When Completr is configured to use Callout Manager as 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

  1. Install and enable Completr
  2. Install and enable Callout Manager
  3. Create a custom callout, for example insight
  4. Set Completr's callout source to Callout Manager
  5. Type > [!ins

Before

The custom callout may be missing from the suggestion list.

After

The custom callout is included in the suggestion list.

Implementation notes

  • keep Callout Manager API results as the primary source
  • read custom callouts from Callout Manager's persisted plugin data as a fallback
  • merge and deduplicate suggestions by replacement

Verification

  • npm run build
  • verified against local Callout Manager plugin data containing a custom insight callout
  • confirmed the new code path includes persisted custom callouts in the final suggestion set

Notes

tsc --noEmit currently reports existing upstream type declaration conflicts in this repo. This change does not add a new build failure.

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
Copilot AI review requested due to automatic review settings April 23, 2026 04:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 148 to 153
.map(callout => newSuggestion(
api.getTitle(callout),
callout.id,
callout.icon,
`rgb(${callout.color})`,
callout.color == null ? undefined : `rgb(${callout.color})`,
));

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread src/provider/callout_provider.ts Outdated
Comment thread src/provider/callout_provider.ts Outdated
李旭东 and others added 3 commits April 24, 2026 10:59
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>
@Iwuaa

Iwuaa commented Jun 18, 2026

Copy link
Copy Markdown

@Jackie-Li-0228 could you make a release with the fix in your repo so we can install it with BRAT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants