You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sadpandajoe (via GitHub)" <gi...@apache.org> on 2026/10/21 13:32:04 UTC

[PR] fix(partition): keep the tooltip within the chart near the right edge [superset]

sadpandajoe opened a new pull request, #45570:
URL: https://github.com/apache/superset/pull/45570

   ### SUMMARY
   Hovering the right-most part of a Partition (icicle) chart left the tooltip positioned past the chart's right edge, so on dashboards (where the chart container clips overflow) it appeared to vanish. The Treemap chart does not have this problem because its echarts tooltip flips to the other side of the cursor.
   
   This change makes the Partition tooltip do the same: after the tooltip content is rendered it is measured, and if `cursorX + 15px + tooltipWidth` would exceed the chart width it is placed to the left of the cursor instead (clamped at 0). Otherwise the placement is unchanged.
   
   The bottom edge and other legacy D3 plugins are intentionally left untouched.
   
   ## Root Cause
   `positionAndPopulate()` in `plugin-chart-partition/src/Partition.ts` set the tooltip's `left` to `cursorX + 15px` unconditionally, with no comparison against the chart width or the tooltip's width. This line dates back to the original `Partition.js` and was carried through the later plugin migrations unchanged. Near the right edge the tooltip's right edge lands beyond the chart; the dashboard chart wrapper uses `overflow: hidden`, so the overflowing part is cut off. The Partition plugin also had no tests, and could not be imported under Jest because `d3-hierarchy@3` is ESM-only and was missing from the `transformIgnorePatterns` allow-list.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   UI before/after evidence will follow in this section once captured against this change.
   
   Regression guard (jsdom, driving the real `mousemove` handler with stubbed layout):
   - Before the fix: `places the tooltip right of the cursor when there is room` passes; `keeps the tooltip inside the chart when hovering near the right edge` fails (`Expected: <= 400, Received: 525`).
   - After the fix: both pass; the whole `plugin-chart-partition` test directory passes (6 suites, 23 tests).
   
   ### TESTING INSTRUCTIONS
   1. Create or open a Partition chart (for example from a dataset with a couple of group-by levels) and add it to a dashboard.
   2. Hover over the right-most blocks of the chart.
   3. The tooltip should appear to the left of the cursor and stay fully visible; hovering elsewhere should still show it to the right of the cursor.
   4. Run the unit test: `cd superset-frontend && npx jest plugins/plugin-chart-partition`.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] 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
   


-- 
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] fix(partition): keep the tooltip within the chart near the right edge [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45570:
URL: https://github.com/apache/superset/pull/45570#issuecomment-6317886242

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45570?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 84.12%. Comparing base ([`75be8f9`](https://app.codecov.io/gh/apache/superset/commit/75be8f981a6c299f1316de22b7caeef64185fb1b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`accc45b`](https://app.codecov.io/gh/apache/superset/commit/accc45ba907b7ac635578d4ce65375083794fe02?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   #45570      +/-   ##
   ==========================================
   + Coverage   84.06%   84.12%   +0.05%     
   ==========================================
     Files        3056     3056              
     Lines      201028   201033       +5     
     Branches    47025    47027       +2     
   ==========================================
   + Hits       168990   169110     +120     
   + Misses      28799    28684     -115     
     Partials     3239     3239              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/45570/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/45570/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.23% <100.00%> (+0.12%)` | :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/45570?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


Re: [PR] fix(partition): keep the tooltip within the chart near the right edge [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45570:
URL: https://github.com/apache/superset/pull/45570#issuecomment-6348920429

   ## CodeAnt PR Risk: Low Risk
   
   - The PR appears safe to merge; no actionable issues were identified in the review.
   
   **Assessed commit:** `accc45ba907b`


-- 
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