fix(runner): drop themeName when wiring a theme into a demo (DEV-2047) - #124
Merged
Conversation
Found by running the panel against a real example rather than reading its
output: the React starter sets themeName="ht-theme-main", the panel added
theme={customTheme} beside it, and Handsontable refuses both —
Both `theme` and `themeName` are defined in your configuration. These
options are aliases and cannot be used together. The `themeName` option
will be ignored.
The theme did apply (theme wins), so this was a warning rather than a
failure, but every themed demo logged it and the dead prop stayed in code the
user can read and download. The prop being replaced is now removed, in JSX and
in settings objects alike, leaving licenseKey and everything else untouched.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0e3b079. Configure here.
| } else if (/gridSettings[^=]*=\s*\{/.test(source)) { | ||
| // 3. Angular's settings object. | ||
| next = source.replace(/(gridSettings[^=]*=\s*\{)/, "$1\n theme: customTheme,"); | ||
| next = stripThemeName(source.replace(/(gridSettings[^=]*=\s*\{)/, "$1\n theme: customTheme,")); |
There was a problem hiding this comment.
Reset cannot restore themeName
Medium Severity
Wiring now permanently deletes the original themeName from the demo source. Reset only removes the customTheme import and theme wiring, so it cannot put themeName back. After Apply then Reset, demos that relied on an explicit themeName stay without it in the editable and downloadable code.
Reviewed by Cursor Bugbot for commit 0e3b079. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Found by an actual browser test of the shipped panel at
?example=react&v=18.0.0— not by reading generated output, which is how it slipped through.The React starter sets
themeName="ht-theme-main". The panel addedtheme={customTheme}next to it, and Handsontable takes one or the other:The theme did apply —
themewins — so this was noise rather than breakage. But every themed demo logged it on load, and the ignored prop stayed sitting in code the user reads, edits and downloads.Wiring now removes the prop it replaces, in JSX (
themeName="…") and in settings objects (themeName: '…'), leavinglicenseKeyand every other prop alone.Note
Low Risk
Localized change to demo file codegen regexes; no runtime auth, data, or grid behavior outside generated example sources.
Overview
When the theme panel auto-wires
customThemeinto a demo, it now strips existingthemeNameprops/settings so they are not left alongsidetheme.Handsontable treats
themeandthemeNameas aliases and warns (ignoringthemeName) when both are set—starters such as React already usedthemeName="ht-theme-main", so themed demos logged noise on every load even though the custom theme applied.A new
stripThemeNamehelper removes JSXthemeName="…"and objectthemeName: '…'lines after the React/Vue, vanilla, and Angular wiring paths injecttheme.Reviewed by Cursor Bugbot for commit 0e3b079. Bugbot is set up for automated code reviews on this repo. Configure here.