Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This branch has not been deployed
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.
Fixes #2251.
Why
With Iconic enabled, Run QuickAdd took about a second to open on a large vault. The picker rendered every choice name with
MarkdownRenderer.render. That call runs every plugin's Markdown post processors. Iconic's post processor readsmetadataCache.getTags(), a scan of the whole vault, on every call before it looks for a tag. So 27 rows meant 27 vault scans per open, and more on each keystroke. The settings list had the same cost.What changed
renderChoiceNamenow writes a plain name straight into<p dir="auto">, which is the output Obsidian's renderer gives for such a name. Names that use Markdown or HTML still go through the renderer.renderChoiceName.,.'"?;()-, and it does not open a list, an indented code block, or awww.autolink.Scope
/as the link source path instead of"", the same as the settings list. Both render identically in Obsidian.Blast Radius
Every picker row and settings row with a plain name skips the Markdown renderer. If the gate accepted a name that Obsidian renders differently, that name would show as literal text. The fuzz and e2e checks below found no such name.
Verification
getTags()calls per open: 27 → 0. Settings tab: about 950 ms → 27-51 ms.tests/e2e/choice-name-render.test.tschecks the real picker against the renderer, and it fails ifdir="auto"is removed.Note
Render plain picker choice names as text without
MarkdownRendererAdds an
isPlainNameclassifier torenderChoiceNameso ordinary names render as an automatic-direction text paragraph, while names with Markdown or HTML constructs still go through the async Markdown renderer. RoutesChoiceSuggester.renderSuggestionthrough the shared helper, keeping the existing rejection fallback. Adds unit and end-to-end tests covering plain names, Markdown-sensitive names, and HTML comparison against Obsidian's renderer.renderChoiceNamein renderChoiceName.ts is now async and returns a promise; callers in ChoiceListItem.svelte, MultiChoiceListItem.svelte, and quickAddSettingsTab.test.ts discard that promise, so render failures no longer surface there.Macroscope summarized 7573699.