Skip to content

refactor: extract formatter and template services#1205

Open
chhoumann wants to merge 7 commits into
engine-flat/01-vault-frontmatter-servicesfrom
engine-flat/02-formatter-template-services
Open

refactor: extract formatter and template services#1205
chhoumann wants to merge 7 commits into
engine-flat/01-vault-frontmatter-servicesfrom
engine-flat/02-formatter-template-services

Conversation

@chhoumann
Copy link
Copy Markdown
Owner

Summary

  • Adds formatter evaluator boundaries so macro/template/inline JavaScript evaluation is explicit and injectable.
  • Extracts folder selection and template file operations into dedicated services.
  • Removes remaining direct capture dependencies on the old single-template path and covers preview/append behavior regressions.

Stack

  1. engine-flat/01-vault-frontmatter-services
  2. This PR
  3. engine-flat/03-template-choice
  4. engine-flat/04-capture-choice
  5. engine-flat/05-macro-cutover

Validation

  • bun run lint
  • bun run test
  • bun run build
  • Obsidian dev vault plugin reload and e2e validation

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6baefe77-19c6-465b-9fd9-897bc69be21d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch engine-flat/02-formatter-template-services

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

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: c338da3
Status: ✅  Deploy successful!
Preview URL: https://41e89d31.quickadd.pages.dev
Branch Preview URL: https://engine-flat-02-formatter-tem.quickadd.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c338da32b8

ℹ️ 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".

Comment on lines +79 to +81
const { content } = await new TemplateEvaluator(
formatter,
).evaluateTemplateContent(templateContent, templatePath);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve caller title when evaluating TEMPLATE tokens

Using TemplateEvaluator.evaluateTemplateContent(..., templatePath) here makes nested {{TEMPLATE:...}} expansion call setTitle() with the template file name, and because the nested formatter shares context.variables, that title value leaks back into the parent formatting run. In flows where no title was pre-set (for example API format() input that includes {{TEMPLATE:...}} followed by {{TITLE}} or {{VALUE:title}}), the output now incorrectly uses the template basename instead of leaving title unset/derived from the actual target file context.

Useful? React with 👍 / 👎.

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.

1 participant