bito-code-review[bot] commented on code in PR #37716:
URL: https://github.com/apache/superset/pull/37716#discussion_r2771792452
##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -244,7 +244,27 @@ function WorldMap(element, props) {
datamap.svg
.selectAll('.datamaps-subunit')
.on('contextmenu', handleContextMenu)
- .on('click', handleClick);
+ .on('click', handleClick)
+ .on('mouseover', function onMouseOver() {
+ if (inContextMenu) {
+ return;
+ }
+ const countryId = d3.select(this).attr('class').split(' ')[1];
+ // Store original fill color for restoration
+ d3.select(this).attr('data-original-fill',
d3.select(this).style('fill'));
+ })
+ .on('mouseout', function onMouseOut() {
+ if (inContextMenu) {
+ return;
+ }
+ const countryId = d3.select(this).attr('class').split(' ')[1];
+ const originalFill = d3.select(this).attr('data-original-fill');
+ // Restore the original fill color (data-based or default no-data
color)
+ if (originalFill) {
+ d3.select(this).style('fill', originalFill);
+ d3.select(this).attr('data-original-fill', null);
+ }
+ });
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incomplete hover effect and dead code</b></div>
<div id="fix">
The added mouseover handler stores the original fill but does not apply the
highlight color, preventing the intended hover effect. Additionally, the
countryId variable is unused in both handlers.
</div>
</div>
<small><i>Code Review Run #7349ad</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]