You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/08/03 23:10:20 UTC

[GitHub] [superset] justinpark opened a new pull request, #24886: fix(explore): double resize triggered

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

   ### SUMMARY
   Since the chart container triggers the resize handler by both props and state, it often tends to trigger rendering twice.
   This commit debounces the resize function to prevent accidental duplicate resize calls.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   After:
   
   https://github.com/apache/superset/assets/1392866/adaa3871-d4e5-45fd-a31f-cbae02c39a63
   
   https://github.com/apache/superset/assets/1392866/41632cac-fb10-4fbe-81d2-ed822101fe56
   
   Before:
   
   https://github.com/apache/superset/assets/1392866/48868a41-e750-4011-b654-f91a7f47b643
   
   https://github.com/apache/superset/assets/1392866/e36c4784-e4dd-418f-a893-8334de57af8c
   
   
   ### TESTING INSTRUCTIONS
   Go to dashboard and resize the window
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] 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
   


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


[GitHub] [superset] justinpark merged pull request #24886: fix(explore): double resize triggered

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark merged PR #24886:
URL: https://github.com/apache/superset/pull/24886


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


[GitHub] [superset] codecov[bot] commented on pull request #24886: fix(explore): double resize triggered

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24886?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#24886](https://app.codecov.io/gh/apache/superset/pull/24886?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (d8c2e47) into [master](https://app.codecov.io/gh/apache/superset/commit/554ef07eeda094f5bcc081e7a265e0b7408e0868?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (554ef07) will **not change** coverage.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head d8c2e47 differs from pull request most recent head 0a77ca0. Consider uploading reports for the commit 0a77ca0 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #24886   +/-   ##
   =======================================
     Coverage   69.00%   69.00%           
   =======================================
     Files        1906     1906           
     Lines       74142    74142           
     Branches     8208     8208           
   =======================================
     Hits        51160    51160           
     Misses      20859    20859           
     Partials     2123     2123           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `55.83% <100.00%> (ø)` | |
   
   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.
   
   | [Files Changed](https://app.codecov.io/gh/apache/superset/pull/24886?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [.../src/dashboard/components/gridComponents/Chart.jsx](https://app.codecov.io/gh/apache/superset/pull/24886?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0LmpzeA==) | `58.26% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


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


[GitHub] [superset] michael-s-molina commented on a diff in pull request #24886: fix(explore): double resize triggered

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #24886:
URL: https://github.com/apache/superset/pull/24886#discussion_r1285029079


##########
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx:
##########
@@ -224,7 +222,7 @@ class Chart extends React.Component {
   }
 
   componentWillUnmount() {
-    clearTimeout(this.resizeTimeout);
+    this.unmounted = true;

Review Comment:
   ```suggestion
       this.resize.cancel();
   ```



##########
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx:
##########
@@ -269,6 +267,9 @@ class Chart extends React.Component {
   }
 
   resize() {
+    if (this.unmounted) {
+      return;
+    }

Review Comment:
   ```suggestion
   ```



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


[GitHub] [superset] michael-s-molina commented on pull request #24886: fix(explore): double resize triggered

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on PR #24886:
URL: https://github.com/apache/superset/pull/24886#issuecomment-1665572888

   @justinpark Could you check if we can remove the `resizeTimeout` logic with this PR?
   
   ```
   if (nextProps.isFullSize !== this.props.isFullSize) {
     clearTimeout(this.resizeTimeout);
     this.resizeTimeout = setTimeout(this.resize, RESIZE_TIMEOUT);
     return false;
   }
   
   if (
     nextProps.width !== this.props.width ||
     nextProps.height !== this.props.height ||
     nextProps.width !== this.state.width ||
     nextProps.height !== this.state.height
   ) {
     clearTimeout(this.resizeTimeout);
     this.resizeTimeout = setTimeout(this.resize, RESIZE_TIMEOUT);
   }
   ```


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