Skip to content
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

fix(sqllab): Un-render deselected tabs #18934

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

etr2460
Copy link
Member

@etr2460 etr2460 commented Feb 24, 2022

SUMMARY

When you switch tabs in sql lab, we were keeping them all rendered in the dom, but hidden. This meant that everytime the sql lab redux state changed, we'd re-render all tabs that were viewed since the last page load. This prop is defined on antd tabs (https://ant.design/components/tabs/#API), and un-renders tabs that aren't currently selected, improving the perf of both switching tabs and updating the sql query being run.

TESTING INSTRUCTIONS

go to SQL Lab, change tabs and see the old tabs un-rendered from the DOM. Ensure all SQL Lab functionality still works

to: @kgabryje @ktmud @rusackas @john-bodley

@ktmud
Copy link
Member

ktmud commented Feb 24, 2022

I wonder if it's worth setting this option to true only when there are a lot of tabs.

@etr2460
Copy link
Member Author

etr2460 commented Feb 24, 2022

@ktmud that's an interesting point, although i didn't see any significant perf regression to requiring a rerender in the dom when switching tabs (especially since all the tabs were being rerendered before this change when a tab switch happened).

We could certainly iterate here to try and find the best solution, although i suspect that it's more dependent on the content of each tab (does it have results, has it loaded tables in the selected schema, how long is the query in the ace editor) than the raw number of tabs

@etr2460 etr2460 merged commit 420a63f into apache:master Feb 24, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants