refactor: extract formatter and template services#1205
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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. Comment |
Deploying quickadd with
|
| 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 |
There was a problem hiding this comment.
💡 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".
| const { content } = await new TemplateEvaluator( | ||
| formatter, | ||
| ).evaluateTemplateContent(templateContent, templatePath); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Stack
engine-flat/01-vault-frontmatter-servicesengine-flat/03-template-choiceengine-flat/04-capture-choiceengine-flat/05-macro-cutoverValidation
bun run lintbun run testbun run build