Skip to content

feat(explore-suspect-attrs): Positioning floating trigger to the bottom right #94939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Abdkhan14
Copy link
Contributor

Always positioning at the bottom right prevents the trigger from covering the selected region.

Screen.Recording.2025-07-05.at.10.32.02.PM.mov

@Abdkhan14 Abdkhan14 requested a review from a team as a code owner July 6, 2025 02:32
@Abdkhan14 Abdkhan14 changed the title feat(explore-suspect-attrs): Positioning floating trogger to the bott… feat(explore-suspect-attrs): Positioning floating trigger to the bottom right Jul 6, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 6, 2025
Copy link

codecov bot commented Jul 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #94939      +/-   ##
==========================================
- Coverage   87.93%   87.88%   -0.05%     
==========================================
  Files       10455    10449       -6     
  Lines      606439   604333    -2106     
  Branches    23550    23547       -3     
==========================================
- Hits       533251   531105    -2146     
- Misses      72821    72861      +40     
  Partials      367      367              

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Chart Hook Positioning and Null Handling Errors

The useChartBoxSelect hook has three issues:

  1. chart.getDom() is used without a null check before calling getBoundingClientRect().
  2. The return value of chart.convertToPixel() is destructured without a null check, which can cause a TypeError if it returns null.
  3. The floatingTriggerPosition.left calculation omits window.scrollX, leading to incorrect positioning when the page is horizontally scrolled.

static/app/views/explore/hooks/useChartBoxSelect.tsx#L123-L136

// absolutely position the floating CTAs.
const [clamped_x1_pixels, clamped_y0_pixels] = chart.convertToPixel(
{xAxisIndex: 0, yAxisIndex: 0},
[clamped_x1, clamped_y0]
);
const chartRect = chart.getDom().getBoundingClientRect();
if (chartRect) {
setFloatingTriggerPosition({
left: chartRect.left + clamped_x1_pixels,
top: chartRect.top + clamped_y0_pixels + window.scrollY,
});
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

1 participant