Skip to content

Make the sample data in db.json valid - #3

Merged
vadim9999 merged 1 commit into
mainfrom
fix/valid-sample-data
Nov 19, 2026
Merged

vadim9999 merged 1 commit into
mainfrom
fix/valid-sample-data

Conversation

@vadim9999

Copy link
Copy Markdown
Contributor

What was wrong

  • Test leftovers in the tree: 123, 1, 2222, {{ddd}}, {{simpleTest}} and Hello1.
  • Blocks that never rendered: two {{twoBlocks}} nodes sat under the root, but the root HTML has no slot for them.
  • Broken library element: {{twoBlocks}} contained 49 literal \n sequences, which appear as visible "\n" text in the email.

What it is now

A complete No More To-Go "Weekly Menu" issue:

  • Tree: the root's three slots ({{items}}, {{items2}}, {{items3}}) hold three two-column rows. The six recipes are the ones named in the issue's intro, and each has a link, a photo from nomoretogo_email_template, a title and a subtitle.
  • Elements: {{twoBlocks}}, {{recipeCard}} and {{textBlock}}.
  • Same shape the editor builds: one child per placeholder, every child's title appears in its parent's HTML, and keys are unique.

public/generated/nmtgTemplate.html is regenerated, and the README has a short "Sample data" section.

Checks

  • PUT /tree with the new tree returns 204, so the data passes zod validation.
  • POST /generate renders all six recipes in order, with no {{…}} left over.
  • npm test (52 passed) and npm run format:check pass.

The frontend's README screenshots use this data: LLazyEmail/email-template-editor-reactjs (PR to follow).

The tree held test leftovers (123, 1, 2222, {{ddd}}, Hello1) and two
{{twoBlocks}} nodes under the root with no matching slot in the root
HTML, so they never rendered. The {{twoBlocks}} library element also
had 49 literal "\n" sequences that showed up as text in the email.

The root's three slots now hold three two-column rows with the six
recipes named in the issue's intro, each with a link, photo, title
and subtitle. The library has three clean elements: {{twoBlocks}},
{{recipeCard}} and {{textBlock}}. Regenerated nmtgTemplate.html and
described the sample data in the README.
@vadim9999
vadim9999 merged commit d0e2fbc into main Nov 19, 2026
2 checks passed
@vadim9999
vadim9999 deleted the fix/valid-sample-data branch November 19, 2026 18:37
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