Skip to content

fix(macro): show the rename pencil in the Macro builder title and space the Choices row - #1809

Merged
chhoumann merged 1 commit into
masterfrom
fix/macro-builder-title-pencil-choices-spacing
Sep 26, 2026
Merged

chhoumann merged 1 commit into
masterfrom
fix/macro-builder-title-pencil-choices-spacing

Conversation

@chhoumann

@chhoumann chhoumann commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two cosmetic fixes to the Macro builder, seen in Obsidian 1.13.7 with the default theme.

  1. Rename pencil in the title. The Template and Capture builders' title (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.addCenteredHeader now builds the same markup and classes as ChoiceNameHeader: h2.choiceNameHeader > button.choiceNameHeaderButton.qa-rename-title-button > .choiceNameHeaderText + .choiceNameHeaderIcon, with a 16px pencil icon. Rename behaviour is unchanged: same prompt, and choice.name and macro.name stay in sync.
  2. Spacing under the "Choices / Add existing choice" row. CommandSequenceEditor renders 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 in src/styles.css restores padding-bottom: var(--size-4-4) for that row. The rule is scoped to the Macro builder because in ConditionalBranchEditorModal the 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.

Before: Macro title has no pencil; Choices description touches the divider

After: Macro title shows the pencil like the Template builder; Choices row has the same spacing as the other rows

Verification

Run against the orb's isolated e2e Obsidian instance (pnpm run start:e2e-obsidian, then obsidian: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:

Macro builder before (master) after
pencil svg in title h2 false true (16×16, aria-hidden)
Choices row padding-bottom 0px 16px
gap from Choices description to the next divider 0px 16px
gap from User scripts description to the Choices divider (reference row) 16px 16px

Title 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.json then held name and macro.name = "Weekly review". dev:errors reported "No errors captured."

  • pnpm run build-with-lint: passes.
  • pnpm run test: 446 files, 5801 tests pass.
  • New unit test in MacroBuilder.test.ts checks that the title uses the ChoiceNameHeader markup with a decorative 16px pencil. It fails on master.

Notes

  • Not changed, pre-existing: when the Macro builder opens, Obsidian autofocuses its first focusable element, the title button, so it shows a focus ring (visible in both before and after). The Template builder mounts its Svelte form after open(), so focus lands on Done there instead.
  • No release or migration impact. No generated artifacts are committed (main.js and styles.css are gitignored).

Note

Show rename pencil icon in MacroBuilder title and fix last-row padding

  • Reworks MacroBuilder.addCenteredHeader to render the title heading with ChoiceNameHeader-compatible classes, splitting the rename button into separate text and icon spans, with a decorative pencil SVG set to 16 by 16 via Obsidian's setIcon (MacroBuilder.ts)
  • Adds a test covering the title structure, accessibility attributes, and icon rendering (MacroBuilder.test.ts)
  • Adds a scoped CSS rule so the last non-heading setting row in the Macro builder's command editor keeps its bottom padding (styles.css)

Macroscope summarized 8aa0170.

Summary by CodeRabbit

  • Style
    • Updated the Macro builder title to match the app’s shared heading style, with a clearly labeled rename button and pencil icon.
  • Bug Fixes
    • Restored bottom spacing after the final setting in the Macro builder’s command editor.

…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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T20:10:18.341271Z 8aa0170 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f8815cfc-0689-4b0e-823b-ff7dec259883

📥 Commits

Reviewing files that changed from the base of the PR and between 99d62df and 8aa0170.

📒 Files selected for processing (3)
  • src/gui/MacroGUIs/MacroBuilder.test.ts
  • src/gui/MacroGUIs/MacroBuilder.ts
  • src/styles.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Macro Builder interface

Layer / File(s) Summary
Macro title and rename control
src/gui/MacroGUIs/MacroBuilder.ts, src/gui/MacroGUIs/MacroBuilder.test.ts
The title uses shared choice-name header styling. Its rename button contains a title and decorative 16px pencil icon. The test checks the heading, button, accessible label, macro name, and icon attributes.
Command editor row spacing
src/styles.css
The final non-heading setting row in the Macro Builder command editor receives bottom padding. The rule does not apply to the branch editor.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8aa01

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes both main changes: displaying the rename pencil in the Macro builder title and restoring spacing for the Choices row.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

A rabbit taps a pencil bright,
The macro title sits just right.
A row gains room along the floor,
The heading keeps its name in store.
I hop away beneath the moon,
And nibble clover, pleased too soon.

Comment @coderabbitai help to get the list of available commands.

@chhoumann
chhoumann merged commit e3f5909 into master Sep 26, 2026
15 checks passed
@chhoumann
chhoumann deleted the fix/macro-builder-title-pencil-choices-spacing branch September 26, 2026 20:15
chhoumann added a commit that referenced this pull request Sep 26, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants