Repository navigation
Add per-option options to chart menu, with backgroundColor for PNG export - #301
Conversation
…ault remains transparent
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughChart menu options now reach click callbacks. PNG export accepts an optional background color and passes it to the renderer when configured. ChangesChart export options
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ChartCardMenuPro
participant OptionOnClick as option.onClick
participant exportPNG
participant domtoimage.toPng
ChartCardMenuPro->>OptionOnClick: callback arguments with option.options
OptionOnClick->>exportPNG: options.backgroundColor
exportPNG->>domtoimage.toPng: bgcolor when backgroundColor is truthy
Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established by the reviewed changes; normal project checks remain appropriate. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
options to chart menu, with backgroundColor for PNG exportoptions to chart menu, with backgroundColor for PNG export
|
@mad-raccoon - No issues from coderabbit or sonarqube. Claude didn't spam a bunch of comments in, either 😁 ... could you take a look when you have a couple minutes? |
mad-raccoon
left a comment
There was a problem hiding this comment.
approved with a comment.
|



Add optional options to PNG export - first one: background color. Default remains transparent
Summary
Chart menu options can now carry an optional
optionsobject. It is passed to the option'sonClickasoptions. The first use is PNG export, which gains abackgroundColorsetting. Until now PNG exports always had a transparent background.Changes
ChartCardMenuOptionandChartCardMenuOptionOnClickPropsgain an optionaloptionsfield.ChartCardMenuProforwardsoption.optionstoonClickon all three paths: instant actions,onCustomDownload, and the default path.exportPNGreadsoptions.backgroundColorand passes it todom-to-image-moreasbgcolor. The exportedPngExportOptionstype describes it.bgcolor),backgroundColorreachingtoPng, and option forwarding, including throughonCustomDownload.Backwards compatibility
Both new fields are optional. With no options set, exports behave as before, and existing themes and custom
onClickfunctions need no changes.Usage
Notes for review
optionsprop is typedRecord<string, unknown>, andexportPNGcasts it toPngExportOptions. A narrower parameter type onexportPNGwouldn't type-check when assigned toonClick.Summary by CodeRabbit