You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/07/06 23:41:32 UTC
[PR] test(preset-chart-deckgl): prove ctrl+click on deck.gl legend toggles the layer without opening a new tab [superset]
rusackas opened a new pull request, #41830:
URL: https://github.com/apache/superset/pull/41830
### SUMMARY
Test-only PR β no production code changes.
Issue #34157 reported that ctrl+clicking a legend item on a DeckGL Scatter chart (reported on Superset 4.1.2) opened a new browser tab instead of just toggling the layer's visibility. The legend items are rendered as `href="#"` anchors, so a ctrl+click whose default action is not suppressed asks the browser to open the href in a new tab.
On current `master` this is already fixed: `Legend.tsx` (`superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.tsx`) calls `e.preventDefault()` in both the `onClick` and `onDoubleClick` handlers of the legend anchors, which suppresses the browser's native ctrl+click "open link in new tab" behavior while still invoking `toggleCategory`.
This PR adds a regression test to the existing colocated `Legend.test.tsx` that encodes the expected behavior: firing a click with `ctrlKey: true` on a legend item asserts that the `toggleCategory` callback fires exactly once for that category and that the click event's `defaultPrevented` is `true`. The test passes against master, proving the issue is resolved, and pins the behavior so it can't silently regress.
closes #34157
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A β test-only change.
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npm run test -- plugins/preset-chart-deckgl/src/components/Legend.test.tsx --maxWorkers=2
```
All 4 tests in the file pass, including the new `ctrl+clicking a legend item toggles the category without opening a new tab` test.
### ADDITIONAL INFORMATION
- [x] Has associated issue: closes #34157
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
π€ Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(preset-chart-deckgl): prove ctrl+click on deck.gl legend toggles the layer without opening a new tab [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #41830:
URL: https://github.com/apache/superset/pull/41830
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(preset-chart-deckgl): prove ctrl+click on deck.gl legend toggles the layer without opening a new tab [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41830:
URL: https://github.com/apache/superset/pull/41830#issuecomment-4898616745
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(preset-chart-deckgl): prove ctrl+click on deck.gl legend toggles the layer without opening a new tab [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #41830:
URL: https://github.com/apache/superset/pull/41830#issuecomment-4898671286
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41830?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 64.78%. Comparing base ([`9e50d9e`](https://app.codecov.io/gh/apache/superset/commit/9e50d9eca674c8bcd033e6617fcb7943cd02e252?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`11c2642`](https://app.codecov.io/gh/apache/superset/commit/11c2642f1ba6ba5811b8fa05c8ed6c336f276002?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #41830 +/- ##
=======================================
Coverage 64.78% 64.78%
=======================================
Files 2689 2689
Lines 148936 148936
Branches 34365 34365
=======================================
+ Hits 96481 96484 +3
+ Misses 50690 50687 -3
Partials 1765 1765
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/41830/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/41830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.66% <ΓΈ> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/41830?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org