fix(docs): keep the playground views in step with a scale target (audit B6) #63

Merged
abiwab merged 1 commit from fix/audit-b6 into main 2026-09-30 18:06:14 +02:00
Owner

Audit B6. In the playground, a scale target (scale by ingredient) made the single watcher skip updateGram for every change (if (!scaleTargetId.value)), so the Preview and Markdown views (rendered inside updateGram) ignored the schedule selector, the view switch, the language, the options and edits to the recipe itself; the Gantt followed only because it reads jsonData with a schedule prop.

The guard only exists so that updateGram writing the resolved factor into scaleFactorString doesn't re-trigger itself (8a94c83f). Split the watcher: everything a view is built from always re-runs the pipeline; only scaleFactorString keeps the guard.

Not verified in a browser: the Chrome extension was not connected in my session and the docs package has no component test setup. ci and a forced docs build pass. Manual check on the playground: pick a scale target (ingredient + quantity, Apply), then switch the schedule selector and the Preview/Markdown views, and edit the recipe: they should now update. No changeset (docs is private); worth a line in the blog post.

Audit B6. In the playground, a scale target (scale by ingredient) made the single watcher skip `updateGram` for *every* change (`if (!scaleTargetId.value)`), so the Preview and Markdown views (rendered inside `updateGram`) ignored the schedule selector, the view switch, the language, the options and edits to the recipe itself; the Gantt followed only because it reads `jsonData` with a `schedule` prop. The guard only exists so that `updateGram` writing the resolved factor into `scaleFactorString` doesn't re-trigger itself (8a94c83f). Split the watcher: everything a view is built from always re-runs the pipeline; only `scaleFactorString` keeps the guard. Not verified in a browser: the Chrome extension was not connected in my session and the docs package has no component test setup. ci and a forced docs build pass. Manual check on the playground: pick a scale target (ingredient + quantity, Apply), then switch the schedule selector and the Preview/Markdown views, and edit the recipe: they should now update. No changeset (docs is private); worth a line in the blog post.
fix(docs): keep the playground views in step with a scale target set
All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 2m51s
30eeaa3625
abiwab merged commit b9be8eba09 into main 2026-09-30 18:06:14 +02:00
abiwab deleted branch fix/audit-b6 2026-09-30 18:06:14 +02:00
Sign in to join this conversation.
No description provided.