Conversation
Core anchors suggest modals 80px from the top while QuickAdd's input prompts are centered, so a Multi picker followed by a VALUE prompt jumped across the screen. The choice picker and generic suggester now open centered, pinned to their height at open so filtering doesn't move the input. Fixes #1796
|
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughSuggester modals now record their height when opened and use desktop CSS to center them within the viewport. Both generic and choice suggesters apply the positioning helper. An end-to-end test checks picker position, input position after filtering, and value prompt position. ChangesPrompt positioning
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The picker-positioning change has no identified issue requiring a fix before merge. Proceed with normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. A rabbit taps the modal’s top, Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29bff405eb
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Picking from a Multi (or any QuickAdd run-time suggester) now opens the picker vertically centered, in the same spot as the VALUE prompt that follows it, instead of at core's fixed spot 80px from the top.
Obsidian anchors every
SuggestModal(.prompt) attop: 80px, while QuickAdd's input prompts are regular modals that the container centers. So a single run jumped from the top of the window to the middle.ChoiceSuggester(the launcher and Multi picker) andSuggesterModal({{VALUE:a,b,c}},api.suggester, the input suggester) now callcenterSuggestModalinonOpen.Centering uses the height the picker has when it opens, not its live height. Plain flex centering would move the input on every keystroke as filtering shrinks the list, which is why core top-anchors these in the first place. If the list grows while you type (nested search), it's capped 80px above the bottom edge and scrolls. Mobile keeps core's layout (
body:not(.is-mobile)).Verified in Obsidian 1.13.7 (the reporter's version) using the reporter's flow: a Multi with four Template choices, each asking
{{VALUE:Title}}. 800px-tall window:Also checked by hand:
{{VALUE:alpha,beta,gamma}}opens centered (400px). With nested search, a list that grows from 108px to 30 rows keeps the input still, stops 80px from the bottom, and scrolls. Mobile emulation still uses core's--prompt-top. Resizing the window while a picker is open keeps it on-screen: growing it keeps the input's offset, and shrinking 800px to 500px clamps the top to core's 80px (the picker spans 80-430px instead of pushing the input to y=-29).Regression test:
tests/e2e/picker-position.test.tsruns this flow in real Obsidian. It fails onmaster(expected 217.5 to be less than 2) and passes with the fix. The full E2E suite passed except one run ofcapture-cursor > refreshes cursor autocomplete when switching between body and property capture, a settings capture-builder test this change doesn't touch. It passed on 2/2 isolated reruns and on a full rerun of its file (39/39), so it looks flaky.pnpm run build-with-lintis clean and the unit suite passes (5758 tests).Visual change: every QuickAdd run-time picker moves from the top to the middle of the window on desktop. Obsidian's own pickers (command palette, quick switcher) and QuickAdd's settings-time template discovery picker keep core's top position. No migration.
Fixes #1796
Note
Center run-time pickers vertically on desktop, like input prompts
centerSuggestModalhelper in utils.ts that records the modal's rendered height in a CSS custom property and marks it for QuickAdd positioning.SuggesterModal.onOpenandChoiceSuggester.onOpenso pickers open centered.Macroscope summarized 23d6611.
Summary by CodeRabbit