Skip to content

Conversation

@Abdkhan14
Copy link
Contributor

@Abdkhan14 Abdkhan14 commented Nov 21, 2025

  • This PR uses the new useChartXRangeSelection to enable range selection only in explore charts
  • Removes the old useBoxChartSelection hook
Screenshot 2025-11-21 at 11 23 04 AM

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 21, 2025
);
boxSelectOptions.clearSelection();
}, [boxSelectOptions, router]);
clearSelection();
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Falsy check fails for zero timestamp values

The condition checks if startTimestamp or endTimestamp are falsy, but since these are numeric timestamps, a value of 0 (Unix epoch) is valid yet falsy in JavaScript. This causes the function to incorrectly return early when the selection includes timestamp 0, preventing zoom functionality for that edge case. The check needs to explicitly test for null or undefined rather than relying on falsy evaluation.

Fix in Cursor Fix in Web

saveOnZoom: true,
});

const {groupName} = useWidgetSyncContext();
Copy link
Contributor

Choose a reason for hiding this comment

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

useWidgetSyncContext gets called on line 141. Can we just get the groupName from there? Unless there's a reason we need to create another context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Laser eyes 👁️‍🗨️

boxSelectOptions={boxSelectOptions}
triggerWrapperRef={triggerWrapperRef}
/>
{index === 0 ? <AttributeComparisonCTA>{widget}</AttributeComparisonCTA> : widget}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Chart clicks clear selection unexpectedly

The ChartWrapper no longer prevents selection clearing when clicked. The old useChartBoxSelect hook checked if clicks were inside chartWrapperRef before clearing selection, but the new useChartXRangeSelection hook uses data-explore-chart-selection-region attributes instead. The ChartWrapper lacks this attribute, causing clicks on the chart to clear the selection, breaking the previous behavior where users could interact with the chart without losing their selection.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants