fix(macro): show the rename pencil in the Macro builder title and space the Choices row - #1809
Conversation
…ce the Choices row
The Macro builder's title now uses the same markup as ChoiceNameHeader (the
Template/Capture builder title), including the pencil rename icon.
The command editor renders into its own wrapper, so its last row ("Choices")
matched Obsidian's modal .setting-item:last-child { padding-bottom: 0 } and its
description touched the next row's divider. Restore the row padding in the Macro
builder only; in the branch editor the command editor really is last.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0df48-cf23-73df-b69b-352af3eebb60
Co-authored-by: Christian Bager Bach Houmann <christian@bagerbach.com>
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. |
|
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 (3)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Macro Builder title now uses shared choice-name header styling, with a rename button and decorative pencil icon. The command editor’s final non-heading setting row receives bottom padding. ChangesMacro Builder interface
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change updates the Macro Builder title and Choices-row spacing. The spacing rule applies to the intended row, and no material merge risk remains beyond normal checks. 🚥 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 taps a pencil bright, Comment |
* docs: retake outdated screenshots and demo GIFs Amp-Thread-ID: https://ampcode.com/threads/T-01a0deb1-657e-701c-a05a-98672ce4f276 Co-authored-by: Christian Bager Bach Houmann <christian@bagerbach.com> * docs: record the Todoist import demo and retake Macro builder screenshots after #1809 Amp-Thread-ID: https://ampcode.com/threads/T-01a0deb1-657e-701c-a05a-98672ce4f276 Co-authored-by: Christian Bager Bach Houmann <christian@bagerbach.com> --------- Co-authored-by: Amp <amp@ampcode.com>
Summary
Two cosmetic fixes to the Macro builder, seen in Obsidian 1.13.7 with the default theme.
ChoiceNameHeader.svelte) shows a pencil next to the choice name. The Macro builder's title had the rename button but no pencil, even though the docs say "click its name at the top to rename it".MacroBuilder.addCenteredHeadernow builds the same markup and classes asChoiceNameHeader:h2.choiceNameHeader > button.choiceNameHeaderButton.qa-rename-title-button > .choiceNameHeaderText + .choiceNameHeaderIcon, with a 16pxpencilicon. Rename behaviour is unchanged: same prompt, andchoice.nameandmacro.namestay in sync.CommandSequenceEditorrenders into its own wrapper (.macroBuilder__editor), so the Choices row is that wrapper's last child. That made it match Obsidian's modal rule.modal:not(.mod-settings) .setting-item…:last-child { padding-bottom: 0 }, even though the Macro builder's own settings follow it. Its description sat on the next row's divider. A CSS rule insrc/styles.cssrestorespadding-bottom: var(--size-4-4)for that row. The rule is scoped to the Macro builder because inConditionalBranchEditorModalthe command editor really is last (buttons follow), so zero padding is correct there.Before / after (real Obsidian 1.13.7, default theme, isolated e2e vault)
Each image shows the Template builder for reference, the Macro builder title, and the Macro builder scrolled to the Choices row.
Verification
Run against the orb's isolated e2e Obsidian instance (
pnpm run start:e2e-obsidian, thenobsidian:e2e -- eval). The vault was a throwaway with made-up choices ("New template", "New macro"). I opened each builder through the real UI (Settings → QuickAdd → Configure) and read computed styles from the DOM:svgin titleh2falsetrue(16×16,aria-hidden)padding-bottom0px16pxTitle font weight and size are identical to the Template builder's title (680, 21.93px).
Rename still works end to end. I clicked the title, entered "Weekly review", and pressed Done. The title re-rendered with the pencil, and
data.jsonthen heldnameandmacro.name= "Weekly review".dev:errorsreported "No errors captured."pnpm run build-with-lint: passes.pnpm run test: 446 files, 5801 tests pass.MacroBuilder.test.tschecks that the title uses theChoiceNameHeadermarkup with a decorative 16px pencil. It fails on master.Notes
open(), so focus lands on Done there instead.main.jsandstyles.cssare gitignored).Note
Show rename pencil icon in MacroBuilder title and fix last-row padding
MacroBuilder.addCenteredHeaderto render the title heading withChoiceNameHeader-compatible classes, splitting the rename button into separate text and icon spans, with a decorative pencil SVG set to 16 by 16 via Obsidian'ssetIcon(MacroBuilder.ts)Macroscope summarized 8aa0170.
Summary by CodeRabbit