Repository navigation
fix: show wikilink suggestions in the native aliases editor - #226
Merged
Merged
Conversation
Typing [[ in the Edit aliases prompt moved focus to a hidden mirror input that fed AbstractInputSuggest. Losing focus made Obsidian's multi-select commit [[ as its own pill and re-render, so no suggestions ever showed. AbstractInputSuggest accepts a contenteditable div, so attach it to the pill input directly and read the [[ query from its text. Re-enables the skipped native wikilink E2E test. Its helpers now type the link query after [[, as a user does.
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the Edit aliases prompt, typing
[[never showed link suggestions. Instead,[[became its own pill. MetaEdit adds its own[[suggester to the aliases widget because Obsidian's aliases widget has none.Cause:
NativeWikilinkSuggesterfedAbstractInputSuggestthrough a hidden mirror<input>and moved focus into it on every[[. The pill input lost focus, so Obsidian's multi-select committed[[as a pill and re-rendered. That re-render removed the mirror, so focus fell tobodyand no popover opened.Fix:
AbstractInputSuggestaccepts a contenteditable div, so the suggester now attaches to the pill input directly and reads the[[queryfrom its text. The mirror input, its focus juggling, and its CSS are gone (net -51 lines).The E2E test for this path had been skipped since #168, with a note saying synthetic DOM events wedged the obsidian-e2e transport. With the current transport it no longer wedges. It just timed out waiting for suggestions, which was this bug. The test is re-enabled. Its helpers now type the link query after
[[, as a user does.Verification
Obsidian 1.13.7, Linux, isolated obsidian-e2e vault, real keystrokes through CDP
Input.insertText/Input.dispatchKeyEvent:master, typing[[A, Bgives pillsAlias One,[[and no suggestions.[[A, Bshows theA, Bsuggestion. Enter fills[[A, B]], a second Enter commits the pill, and Save writes- "[[A, B]]"toaliases.tests/e2e/native-properties.test.ts(wikilink test included): 6 passed. Withmaster'ssrc/andstyles.cssit fails withTimed out waiting for .suggestion-item.pnpm run lint,pnpm run build,pnpm run test(359 passed).Release impact: user-facing fix, no settings or API changes.
Note
Low Risk
Scoped to aliases wikilink fallback UI and E2E helpers; no auth, data migration, or broad API changes.
Overview
Fixes wikilink autocomplete in the native aliases editor by rewiring
NativeWikilinkSuggesterso it no longer uses a hidden mirror<input>and focus juggling (which caused[[to commit as a pill before suggestions could appear).The suggester now binds
AbstractInputSuggestdirectly to the aliases multi-select contenteditable, derives the query from trailing[[…text ingetSuggestions, and applies the chosen link viasetValue.NativeWidgetHostteardown callsclose()instead of a customdestroy(), and the mirror-input CSS is removed.The previously skipped E2E native wikilink suggestions test is re-enabled; helpers type
[[plus the query (like a user) instead of only[[with synthetic input/keyup events.Reviewed by Cursor Bugbot for commit 4c25d1b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix wikilink suggestions in the native aliases editor by attaching to the contenteditable div
NativeWikilinkSuggesternow attaches directly to the contenteditableHTMLDivElementinstead of creating and syncing a hidden mirror input; the mirror element, its CSS rule, and the customdestroymethod are removedgetSuggestionsmatches the trailing wikilink expression in the full input text and filters paths and aliases case-insensitively; text without a trailing wikilink returns no suggestionsacceptSuggestionwrites the selected link throughAbstractInputSuggest.setValuebefore restoring focus and dispatching the input eventMacroscope summarized a491fd9.