Skip to content

fix(file): check the note whose alias is typed as a |multi custom value - #2104

Merged
chhoumann merged 1 commit into
masterfrom
fix/multi-custom-alias
Oct 1, 2026
Merged

chhoumann merged 1 commit into
masterfrom
fix/multi-custom-alias

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #2102. In the in-app {{FILE:...|multi|custom}} picker, typing a note's alias into Add a custom value added it as a custom row, and the alias was written as plain text. Typing an alias now checks that note, as an alias already does in the single |custom picker and in remote replies. Other typed text is still added as a custom value.

Before After
Light before after
Dark before after
dev:mobile before after

Obsidian 1.13.7, {{FILE:People|multi|custom|format:markdown}}, the one typed into Add a custom value, then Enter. Thomas Anderson has the aliases Neo and The One. After pressing Done, master writes - the one and this PR writes - Thomas Anderson.

How

MultiSuggester resolves a typed value with itemWithAlias (from #2102) in two places: when the value is added with Enter or Add, and when a draft is folded in on Done. If the note is already checked, the existing "already added" notice shows, so the note is never added twice.

Tests

  • multiSuggester.aliases.test.ts: the one added with Enter and NEO folded in on Done resolve to the note, once. It fails on master (['the one', 'NEO']).
  • pnpm run build-with-lint, pnpm run test (6599 passed), .agents/run-e2e (395 passed, 24 Templater-only skipped).

Release / migration

None.

Refs #2062

Note

Fix MultiSuggester custom values to resolve typed aliases

Adds a typedValue helper to MultiSuggester that resolves typed text through the configured item aliases and falls back to the original text when no alias matches. Both commitDraft (Enter) and submit (Done) now canonicalize a custom-value draft through this helper before duplicate checks and selection.

  • Behavioral Change: custom-value text matching an option alias now selects the aliased item value instead of the literal text; unmatched text remains unchanged. Covered by new test in multiSuggester.aliases.test.ts.

Macroscope summarized 52ef59c.

Summary by CodeRabbit

  • Bug Fixes
    • Custom values that match an option alias now select the corresponding option and are not added twice, whether submitted with Enter, Add, or Done.

In {{FILE:...|multi|custom}}, typing a note's alias into Add a custom
value added it as a custom row, and the alias was written as text. It
now checks that note, as the single |custom picker and remote replies
do.
@chhoumann
chhoumann marked this pull request as ready for review October 1, 2026 09:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T09:11:23.071294Z 52ef59c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 425a726c-0d60-444e-877a-8092acc0484a

📥 Commits

Reviewing files that changed from the base of the PR and between 0a20512 and 52ef59c.

📒 Files selected for processing (2)
  • src/gui/MultiSuggester/multiSuggester.aliases.test.ts
  • src/gui/MultiSuggester/multiSuggester.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

MultiSuggester now resolves typed custom values that match option aliases before it checks for duplicates or submits a selection. A test covers alias entry through Enter and Done.

Changes

Alias selection

Layer / File(s) Summary
Resolve aliases during selection
src/gui/MultiSuggester/multiSuggester.ts, src/gui/MultiSuggester/multiSuggester.aliases.test.ts
typedValue maps a typed alias to its option value. Draft commits and submission use the resolved value. The test checks that entering alias variants selects the note value once.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 52ef5

Typed aliases now select the corresponding note rather than becoming custom text, while unmatched values retain their existing behavior. No actionable merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes resolving an aliased note when the alias is entered as a custom value in a |multi field. It identifies the main behavior change, although the wording is somewhat awkward…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit taps Enter with care
An alias finds its value there
The draft resolves and joins the list
Done keeps one choice, just as it should
The rabbit hops through fields of green

Comment @coderabbitai help to get the list of available commands.

@chhoumann
chhoumann merged commit 1da7bce into master Oct 1, 2026
15 checks passed
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.

1 participant