fix: align one-page form inputs and open the New choice menu under its button - #1806
Conversation
Textareas and sliders filled the control box, whose width came from the flex split with the label, so a shorter label pushed them left of the text inputs. The form now gives every row the same control column.
The menu was anchored at the button's left edge only, so whenever it overflowed the window Obsidian flipped it to end at that point, leaving it entirely left of the button. Passing the button's width with overlap keeps it under the button; the primary button right-aligns its menu.
|
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; 3 remain after this review. 📝 WalkthroughWalkthroughOne-page modal controls now use consistent sizing, and the new-choice menu uses trigger bounds for positioning. End-to-end tests cover control alignment, menu placement, and generated attachment links. ChangesInterface alignment
Attachment link check
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue is established before merge. The menu’s placement in the supported application remains unconfirmed. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 checks the menu’s place, Comment |
The written link text follows the vault's link format, so a unique attachment gets [[photo.png]] under the default shortest format and the full-path expectation failed. The spec now resolves each link through the metadata cache and checks it lands on the picked file.
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. |
Fixes two layout bugs in QuickAdd's UI.
One-page form: inputs didn't line up. Text inputs keep their natural width. Textareas and sliders fill the control box, though, and that box's width came from the flex split with the label, so a shorter label pushed those controls left of everything else (in the screenshot, "Body" starts 122px left of "Title"). The form now gives every row the same control column (60% of the row), and inputs fill it, so every control starts at the same x whatever the label length. Dropdowns keep Obsidian's compact, right-aligned style. Rows that stack (dates, the <=540px layout, discovery forms) still override the column width. The file picker's own
min(28rem, 62%)width is replaced by the shared column, and the range input's default 2px margin is zeroed so the slider track lines up too."New choice" menu opened to the left of its button. The menu was anchored at the button's left edge only. The button sits at the right of the bar, so the 418px menu overflowed the window, and Obsidian flipped it to end at that anchor, which left it entirely left of the button. This happened at 1024px as well, not just in narrow windows (menu 352-770, button 772-908). Passing the button's
widthwithoverlap: truemakes the flip right-align the menu under the button. The primary button also passesleft: trueso its menu always right-aligns. The per-folder "Add choice" link (left side of a folder row) keeps left-aligning when it fits.Measured in real Obsidian 1.13.7 at window widths 420/600/800/1024/1600. After the fix, the primary menu's right edge equals the button's right edge at every width. At 420px the menu fills the window from x=0, so it still sits under the button.
Regression coverage (Obsidian e2e):
tests/e2e/one-page-alignment.test.tschecks that text, textarea, number, slider, and suggester controls with short and long labels all start at the same x. The new case intests/e2e/choice-list-layout.test.tschecks that the New choice menu opens below its button and is right-aligned with it. Both fail on master (textarea at 421.7 vs 549; menu right edge 770 vs button 908) and pass with this change. The full e2e suite (208 tests), unit tests, andbuild-with-lintpass locally.Boyscout:
tests/e2e/file-type-label.test.ts(from #1805) failed on master in a fresh vault. It expected[[<folder>/photo.png]], but QuickAdd writes links withgenerateMarkdownLink, which follows the vault's link format. Under the default "shortest" format a unique attachment is[[photo.png]]. The spec now checks where each link resolves (through the metadata cache) instead of its literal text. It passes under both "shortest" and "absolute". This is a separate test-only commit.No release or migration impact.
Note
Fix New choice menu placement in
AddChoiceControlsto align under its buttonThe menu-opening handler in AddChoiceControls.svelte now passes the trigger button width and enables overlap-aware positioning. Noncompact layouts request right alignment; compact layouts use the alternate alignment. The existing mouse-event fallback path is unchanged.
Macroscope summarized 750d6d6.
Summary by CodeRabbit
Improvements
Tests