Skip to content

fix(runner): drop themeName when wiring a theme into a demo (DEV-2047) - #124

Merged
qunabu merged 1 commit into
masterfrom
fix/DEV-2047-theme-name-clash
Aug 7, 2026
Merged

fix(runner): drop themeName when wiring a theme into a demo (DEV-2047)#124
qunabu merged 1 commit into
masterfrom
fix/DEV-2047-theme-name-clash

Conversation

@qunabu

@qunabu qunabu commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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 added theme={customTheme} next to it, and Handsontable takes one or the other:

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 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: '…'), leaving licenseKey and 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 customTheme into a demo, it now strips existing themeName props/settings so they are not left alongside theme.

Handsontable treats theme and themeName as aliases and warns (ignoring themeName) when both are set—starters such as React already used themeName="ht-theme-main", so themed demos logged noise on every load even though the custom theme applied.

A new stripThemeName helper removes JSX themeName="…" and object themeName: '…' lines after the React/Vue, vanilla, and Angular wiring paths inject theme.

Reviewed by Cursor Bugbot for commit 0e3b079. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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,"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0e3b079. Configure here.

@qunabu
qunabu merged commit 793ca88 into master Aug 7, 2026
3 checks passed
@demtario
demtario deleted the fix/DEV-2047-theme-name-clash branch August 10, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant