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

SQL Lab container div not showing because height is 0px #32027

Open
3 tasks done
jwoodb opened this issue Jan 29, 2025 · 2 comments
Open
3 tasks done

SQL Lab container div not showing because height is 0px #32027

jwoodb opened this issue Jan 29, 2025 · 2 comments
Labels
sqllab:design Related to the SQL Lab UI/UX

Comments

@jwoodb
Copy link

jwoodb commented Jan 29, 2025

Bug description

The bug is that I...

  1. Cloned the superset repo to my local machine
  2. Ran docker compose up --build
  3. Logged in and accessed the SQL Lab tab.
  4. The page was blank except for the query tabs (see screenshot)
Image

Expected behaviour: The full UI shows.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

Not applicable

Node version

18 or greater

Browser

Chrome

Additional context

No issues were logged in the superset_app docker container.

There were no errors in the JS console in the browser, only this:

Image

I took a look at the markup and I could see it was all there, but collapsed. It appears that this div was the culprit because it did not set a height:

<div data-test="SqlLabApp" class="App SqlLab css-6pihn3">

I add the height: 100vh to the SqlLabStyles CSS in the following file: superset-frontend/src/SqlLab/components/App/index.tsx

const SqlLabStyles = styled.div`
  ${({ theme }) => css`
    &.SqlLab {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      padding: 0 ${theme.gridUnit * 2}px;
      height: 100vh; // Add this new rule
     ...

And, the page displays as expected.

I have no idea why this wasn't working for me without me having to add this additional CSS rule.

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented Jan 29, 2025

Hey @jwoodb! 👋 I'm here to help you with any bugs, questions, or contributions you have for Apache Superset. Let's work together to resolve this issue!

The issue you're experiencing with the SqlLabApp component having a height of 0px might be related to the dynamic height adjustment logic in the component. The SqlLabApp component uses JavaScript logic to dynamically adjust its height based on the window size and user interactions. This is done using the useEffect hook, which recalculates the height on window resize events [1].

If this logic isn't functioning as expected, it could result in the component not displaying correctly. Adding height: 100vh to the CSS is a workaround that forces the component to occupy the full viewport height, which is why it resolves the issue for you.

To further investigate, you might want to check if the JavaScript logic responsible for setting the height is being executed correctly. Ensure that there are no errors or issues with the event listeners or the functions that calculate and set the height. Additionally, verify that all dependencies and configurations are correctly set up, as they might affect the execution of this logic.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the sqllab:design Related to the SQL Lab UI/UX label Jan 29, 2025
@hainenber
Copy link
Contributor

I'm currently at commit 732de4a and the SQL Lab page shows properly to me. Can you pull the latest master and retry?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllab:design Related to the SQL Lab UI/UX
Projects
None yet
Development

No branches or pull requests

2 participants