Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| } else if (!warnedLegacyPointMetadata) { | ||
| warnedLegacyPointMetadata = true; | ||
| console.warn( | ||
| "Chart point metadata must be an object in the 4th tuple slot. Legacy formats are ignored.", | ||
| ); | ||
| } |
There was a problem hiding this comment.
no warning just throw an error
There was a problem hiding this comment.
Summary
- Updated chart point metadata parsing so a 4th tuple slot must be an object; otherwise the chart code now throws a
TypeErrorimmediately instead of logging a one-time warning and continuing. sqlpage/apexcharts.jsL121-L139 - Removed the legacy warning-state bookkeeping because invalid metadata now fails fast on the offending datapoint. sqlpage/apexcharts.jsL121-L135
- Committed the follow-up change on the current branch as
bca97e7and created a PR message titledFollow-up: throw on invalid chart metadata tuples.
Testing
- ✅
npm run format - ✅
npm test
| ('chart', 'A bar chart with clickable datapoints. Each row can set a `link` URL; clicking a datapoint opens that URL.', json('[ | ||
| {"component":"chart", "type": "bar", "title": "Linked Sales", "labels": true}, | ||
| {"label": "North", "value": 35, "link": "/documentation.sql?component=table"}, | ||
| {"label": "South", "value": 22}, | ||
| {"label": "West", "value": 41, "link": "/documentation.sql?component=map"} | ||
| ]')), | ||
| ('chart', 'A pie chart with per-slice links.', json('[ | ||
| {"component":"chart", "title": "Linked Answers", "type": "pie", "labels": true}, | ||
| {"label": "Yes", "value": 65, "link": "/documentation.sql?component=form"}, | ||
| {"label": "No", "value": 35, "link": "/documentation.sql?component=table"} | ||
| ]')), | ||
| ('chart', 'A bubble chart demonstrating `z` and `link` metadata together on points.', | ||
| json('[ | ||
| {"component":"chart", "title": "Bubbles with links", "type": "bubble", "ztitle": "Population", "marker": 8}, | ||
| {"series": "Europe", "x": 2.1, "y": 18.5, "z": 742, "link": "/documentation.sql?component=chart"}, | ||
| {"series": "Asia", "x": 5.2, "y": 24.1, "z": 4700, "link": "/documentation.sql?component=map"} | ||
| ]')), |
There was a problem hiding this comment.
Instead of adding new examples, add links to the existing examples where it makes the most sense. Update the tests accordingly and run them
There was a problem hiding this comment.
@codex Instead of adding new examples, add links to the existing examples where it makes the most sense. Update the tests accordingly and run them
There was a problem hiding this comment.
Summary
- Folded chart
linkusage into the existingAnswerspie chart andQuarterly Resultsbar chart documentation examples, instead of keeping separate linked-example entries. examples/official-site/sqlpage/migrations/01_documentation.sqlL690-L696 - Updated chart point parsing to throw a
TypeErrorimmediately when the 4th tuple slot is not an object, matching the review request to error instead of warn. sqlpage/apexcharts.jsL121-L135 - Retargeted the end-to-end coverage to those existing chart examples and disambiguated the duplicate
Quarterly Resultsheadings with exact role matching so the updated tests pass. tests/end-to-end/official-site.spec.tsL27-L60 - Committed the follow-up changes on the current branch as
2adc7e1and recorded a follow-up PR title/body with the requested summary.
Testing
-
✅
npx biome format --write sqlpage/apexcharts.js tests/end-to-end/official-site.spec.ts -
✅
npx biome check sqlpage/apexcharts.js tests/end-to-end/official-site.spec.ts -
✅
cargo run(fromexamples/official-site) -
✅
npx playwright install chromium(fromtests/end-to-end) -
✅
npx playwright install-deps chromium(fromtests/end-to-end) -
✅
npm run test -- official-site.spec.ts -g 'chart point links|chart links - no-link datapoint'(fromtests/end-to-end) -
⚠️ Screenshot not captured because the browser screenshot tool was not available in this environment.
|
On it |
Summary
Testing
Committed on the current branch as |
Motivation
zandlinkmetadata for interactive navigation and documentation examples.Description
sqlpage/templates/chart.handlebarsto emit either[series, x, y]or[series, x, y, {"z":..., "l":...}]and to avoid any numeric 4th-slot output.sqlpage/apexcharts.jsto parse 3-item tuples and 4th-slot object metadata, extractzandl, preserve existing time/range conversions, attachlto point objects, and buildpieLinksfor pie slices.align_categoriesto reuse full point objects rather than discarding extra fields.dataPointSelectionandclickevent hooks, helper functionsresolvePointLinkandnavigateIfLink, and a short-lived guard to avoid double-triggered navigation.linkparameter inexamples/official-site/sqlpage/migrations/01_documentation.sqland add examples for linked bar, linked pie, and combinedz+linkpoints.tests/end-to-end/official-site.spec.tscovering linked bar navigation, linked pie navigation, and no-op behavior for non-linked datapoints.Testing
npm run formatwhich completed successfully.cargo test -qand all tests passed (136 passed, plus other test groups shown asok).Codex Task