docs: correct HTML chart Handlebars bindings and sandbox limitations - #11388
docs: correct HTML chart Handlebars bindings and sandbox limitations#11388igorlukanin wants to merge 6 commits into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Claude finished @igorlukanin's task in 2m 25s —— View job Review: docs-only change, correction is the right call — 1 medium, 3 low. 2 inline comments posted.Full review
ScopeSingle The core correction is well-founded: the removed section told readers to load Chart.js from a CDN inside an iframe that can't run scripts or reach the network, and the removed bindings ( Verifiability caveatThe chart renderer isn't in this repo (
Findings
Optional
ConventionsChecked and clean: |
|
Claude finished @igorlukanin's task in 54s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved. Line 18 now states the key form follows the query and points to the Handlebars reference panel; the <Warning> covers the loop form ({{this.[order_items.count]}}) as well as the indexed one. |
2 — Low: pivot unactionable |
Resolved. Line 59 names rows, columns, cellMap, grandTotals, config and points at {{json pivot}}. |
3 — Low: forward reference to json |
Resolved. Line 46 links [json helper](#helpers). |
| 4 — Low: "before the chart is rendered" said twice | Resolved. The sandbox bullet is now just "Handlebars expressions"; the statement survives once at line 6. |
Two threads I opened are now outdated and resolved.
On the key-form correction
Igor's read is right and mine was too narrow — multiple aliases per value means the two forms usually coexist, so "both can't be true" was wrong as stated; the real hazard is the qualified-only row, which the new wording covers. The fix is better than either option I proposed: it names the mechanism (follows the query), gives the reader a deterministic way to find the answer (the reference panel), and generalizes the bracket rule to both access shapes.
formatDate / date-fns
The library is now named, and the tokens check out against it: date-fns treats L/LL/LLL as stand-alone month, so "yyyy-LL-dd" → 2026-07-30 and "LLL yyyy" → Jul 2026. yyyy is the calendar year (not the YYYY that date-fns warns on). No contradiction with formatNumber using d3-format — different value types, different libraries is normal.
The renderer still isn't in this repo (formatChartData, Handlebars helper registration, and the CSP header are all outside it), so the library attribution and the data:-URL allowance remain unverifiable from here. Both are now stated precisely enough to be checked against the implementation by anyone who has it.
Remaining nit (low)
docs-mintlify/docs/explore-analyze/charts/chart-types/html.mdx:68-69 — formatDate names date-fns but formatMonth on the next row doesn't. Adjacency makes the shared library obvious enough that adding a second link would be noise; flagging only in case formatMonth accepts a different pattern set.
Conventions
Unchanged and clean: frontmatter title/description, no body H1, fences tagged html, standard callouts, root-relative internal links that resolve, no new page so no docs.json change.
· Branch igor/cub-2467-clarify-html-chart-js-support-and-handlebars-docs ·
|
Checked the two caveats against the implementation, both hold. The engine formats dates with date-fns, not Luxon — but Also took findings 3 and 4 in |
925d4d7 to
e43eed4
Compare
|
Claude finished @igorlukanin's task in 48s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 91) |
Threads
Both of my inline threads are already resolved and marked outdated — nothing to resolve, nothing to re-affirm. No human-authored threads on this PR.
Carried-over nit (low, unchanged)
docs-mintlify/docs/explore-analyze/charts/chart-types/html.mdx:69 — formatMonth still doesn't name date-fns while formatDate on the line above does. Adjacency makes it obvious; only worth a change if formatMonth takes a different pattern set.
Verifiability
Unchanged from last pass: the renderer (formatChartData, helper registration, the CSP header) lives outside this repo, so the date-fns attribution and the img-src data: / font-src data: allowance rest on Igor's check against the implementation, which he reported holds. The date-fns tokens are self-consistent — L/LL/LLL are stand-alone month in that library, giving 2026-07-30 and Jul 2026.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx present on disk), no new page so no docs.json change.
Nothing blocking. Ready to merge from my side.
· Branch igor/cub-2467-clarify-html-chart-js-support-and-handlebars-docs ·
|
Took the nit in |
|
Claude finished @igorlukanin's task in 31s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 91) |
5 — Low: formatMonth didn't name date-fns |
Resolved in this commit (line 69) |
Threads
Both threads I opened are already resolved and outdated — nothing to resolve. No human-authored threads. No new inline comments this pass.
Verifiability
Unchanged: the renderer (formatDateUtc, helper registration, the CSP header) lives outside this repo, so the date-fns attribution and the img-src data: / font-src data: allowance rest on Igor's check against the implementation, which he reported holds. Both claims are stated precisely enough to re-check there.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx on disk), no new page so no docs.json change. Docs-only — no code, tests, security, or performance surface.
· Branch igor/cub-2467-clarify-html-chart-js-support-and-handlebars-docs ·
6c691ee to
7f8ed7c
Compare
|
Claude finished @igorlukanin's task in 2m 4s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 91) |
5 — Low: formatMonth didn't name date-fns |
Resolved (line 69) |
Threads
Both threads I opened earlier are already resolved and outdated — nothing to resolve, no duplicates to skip. No human-authored threads.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx on disk), no new page so no docs.json change. Docs-only — no code, tests, security, or performance surface.
|
Claude finished @igorlukanin's task in 2m 35s —— View job Re-review of
|
| # | Severity | Location | Issue |
|---|---|---|---|
| 1 | Low | html.mdx:83 vs :39 |
Line 39 says a missing property "raises an error instead of rendering an empty string"; line 83 says a missing now renders an empty string. Both are true — strict mode covers rendered expressions, not helper arguments — but the page never states the distinction, so the two paragraphs read as contradicting each other. A half-clause at line 39 closes it. |
| 2 | Low | html.mdx:83 |
"renders an empty string" describes formatDate's behavior, not Handlebars'. Handlebars passes undefined; date-fns' format(undefined, …) throws RangeError: Invalid time value, so unless formatDateUtc guards its input the visible result is a broken chart. "…so formatDate doesn't receive the current date" is true either way and needs no verification. |
Prior findings
All six remain resolved — re-verified against the current file:
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 93) |
5 — Low: formatMonth didn't name date-fns |
Resolved (line 69) |
6 — Medium: now in parameter position |
Resolved in this commit (lines 76, 80, 83) |
— Low: coalesce undefined case |
Retracted — my reasoning was wrong, see above |
Threads
All three threads I opened are resolved and outdated — nothing to resolve, no duplicates to skip. No human-authored threads.
Verifiability
Unchanged: the renderer (formatDateUtc, helper registration, the CSP header) lives outside this repo, so the date-fns attribution and the img-src data: / font-src data: allowance rest on Igor's check against the implementation, which he reported holds. Handlebars isn't installed in this checkout either, so the strict-mode / argument-position reasoning above is from the compiler's source (javascript-compiler.js resolvePath/strictLookup, compiler.js simpleSexpr), not an executed test — worth a 30-second handlebars.compile(s, {strict: true}) check locally if you want it nailed down before rewording line 39.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx on disk), no new page so no docs.json change. Docs-only — no code, tests, security, or performance surface.
|
Claude finished @igorlukanin's task in 44s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 93) |
5 — Low: formatMonth didn't name date-fns |
Resolved (line 69) |
6 — Medium: now in parameter position |
Resolved (lines 76, 80, 83) |
| 7 — Low: line 39 vs line 83 tension | Resolved in this commit (line 39) |
8 — Low: "renders an empty string" was a formatDate claim |
Resolved in this commit (line 83) |
— Low: coalesce undefined case |
Retracted earlier; the wording is correct and now explained |
Threads
All four threads I opened are resolved and outdated — nothing to resolve, no duplicates to skip. No human-authored threads. No new inline comments this pass.
Verifiability
Unchanged and unaffected by this commit: the renderer (formatDateUtc, helper registration, the CSP header) lives outside this repo, so the date-fns attribution and the img-src data: / font-src data: allowance rest on Igor's checks against the implementation, which he reported hold. The strict-mode / argument-position claim now documented at line 39 matches the Handlebars compiler source (path.strict set in simpleSexpr/ambiguousSexpr only; argument paths compile to a plain lookupProperty chain), and Igor confirmed the runtime path through toDate at htmlTemplateEngine.ts:504.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx on disk), no new page so no docs.json change. Docs-only — no code, tests, security, or performance surface.
ccce9f7 to
bd0da8c
Compare
|
Claude finished @igorlukanin's task in 1m 1s —— View job Re-review of
|
| Prior finding | Status |
|---|---|
| 1 — Medium: unqualified vs qualified key form | Resolved (line 18 + <Warning> at 42) |
2 — Low: pivot unactionable |
Resolved (line 59 names rows, columns, cellMap, grandTotals, config) |
3 — Low: forward reference to json |
Resolved (line 46) |
| 4 — Low: duplicated "before the chart is rendered" | Resolved (line 93) |
5 — Low: formatMonth didn't name date-fns |
Resolved (line 69) |
6 — Medium: now in parameter position |
Resolved (lines 76, 80, 83) |
| 7 — Low: line 39 vs line 83 tension | Resolved (line 39) |
8 — Low: "renders an empty string" was a formatDate claim |
Resolved (line 83) |
— Low: coalesce undefined case |
Retracted earlier; correct as written and now explained by line 39 |
Cosmetic nit (not worth a commit on its own)
html.mdx:51-55 — the sentence introduces the table as "Alongside data, the following are available", and then data is the table's first row. Harmless, and the row is genuinely useful as the place the "keyed by column name" shape is stated in table form; "The following bindings are available" would remove the small self-contradiction if you touch the file again for another reason.
Verifiability
Unchanged and unaffected by a rebase. The renderer (formatDateUtc, toDate, helper registration, the CSP header) lives outside this repo, so the date-fns attribution, the img-src data: / font-src data: allowance, and the now-is-a-helper claim rest on Igor's checks against htmlTemplateEngine.ts, which he reported hold. The strict-mode / argument-position rule now documented at line 39 matches the Handlebars compiler source (path.strict set in simpleSexpr/ambiguousSexpr only; argument paths compile to a plain lookupProperty chain).
Threads
All four threads I opened are resolved and outdated — nothing to resolve, no duplicates to skip. No human-authored threads.
Conventions
Re-checked and clean: title/description frontmatter, no body H1, body opens at H2, all fences tagged html, <Warning>/<Tip> are standard Mintlify, both internal links resolve (chart-types/index.mdx, charts/custom.mdx on disk), page already registered in docs.json:79 so no navigation change needed. Docs-only — no code, tests, security, or performance surface.
Nothing blocking. Ready to merge from my side.
|
Nit's right, and I'm leaving it: the Rust jobs this push triggered take ~an hour, and a wording commit now would cancel them mid-flight. Folded into the next commit if the file gets touched for another reason. On those jobs, since it'll look odd on a docs-only PR: |
The HTML chart docs page describes a template context and a JavaScript capability that don't match what the product does. Every code example on the page currently fails if copy-pasted.
Handlebars bindings. The page documents
result._firstand{{#each result.data}}. There's noresultkey in the template context — rows are a flatdataarray. Templates compile in strict mode, so these don't render blank, they throw and break the chart. Corrected todata.0.<member>and{{#each data}}, matching the Handlebars reference panel in the chart editor.JavaScript. The page says
<script>tags are supported and shows a Chart.js CDN example. HTML charts render in a sandboxed iframe under a restrictive CSP, so scripts don't execute and external resources don't load. Replaced that section with an accurate description of what the sandbox allows, and pointed readers at built-in chart types or custom Vega-Lite specs for visualizations.Also documents the rest of the template context (
columns,rowCount,columnCount,pivot) and the available helpers, which previously only existed in the in-app panel.