Skip to content

fix(console): auto-collapse sidebars on narrow viewports#582

Open
midaksh wants to merge 1 commit into
questdb:feat/notebook-cell-toolbar-redesignfrom
midaksh:feat/sidebar-responsive-collapse
Open

fix(console): auto-collapse sidebars on narrow viewports#582
midaksh wants to merge 1 commit into
questdb:feat/notebook-cell-toolbar-redesignfrom
midaksh:feat/sidebar-responsive-collapse

Conversation

@midaksh

@midaksh midaksh commented Jul 1, 2026

Copy link
Copy Markdown

Part B of #574: when the viewport shrinks, auto-collapse the left and right sidebars so the notebook stays the primary, usable surface.

Stacks on #581 (Part A).

Changes

src/hooks/useScreenSize.tsx

  • Add md (1024px) and lg (1280px) breakpoints alongside the existing sm (767px)
  • Same throttled resize + shallowEqual update pattern as sm

src/scenes/Console/index.tsx

  • Right panel (AI / table details): hide below 1280px (!lg) — larger footprint (470px min), collapses first
  • Left panel (schema / search): hide below 1024px (!md) — in addition to existing !sm at 767px
  • Set proportionalLayout={false} on the outer Allotment so the AI panel restores its saved preferredSize after resize instead of expanding to max width

Behaviour

Viewport Right panel Left panel Notebook
> 1280px visible if open visible if open normal layout
1025–1280px auto-hidden visible if open gains ~470px
768–1024px auto-hidden auto-hidden fills center
≤ 767px auto-hidden auto-hidden same as before (sm)

Panel open/close state (Redux activeSidebar, localStorage leftPanelState) is not mutated — panels restore when the viewport widens past the threshold.

Out of scope

@emrberk

emrberk commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Hey @midaksh,

I think this is a great start with the breakpoints!
My concern is that the users explicitly wants to open left/right sidebars in md and sm screens will not be able to do that anymore. How about the following approach:

  • When we shrink from lg to md, if both sidebars are open, close right sidebar automatically, and only show the left sidebar. The user will be able to reopen it any time they want. We don't block it.
  • When we shrink from md to sm, close all sidebars automatically. The user will be able to reopen any sidebar if they want.
  • Let's not hide "Data sources" toggle in left sidebar in sm view. This was a preexisting issue.

Let me know if you need any help!

@midaksh

midaksh commented Jul 1, 2026

Copy link
Copy Markdown
Author

Hey @midaksh,

I think this is a great start with the breakpoints! My concern is that the users explicitly wants to open left/right sidebars in md and sm screens will not be able to do that anymore. How about the following approach:

  • When we shrink from lg to md, if both sidebars are open, close right sidebar automatically, and only show the left sidebar. The user will be able to reopen it any time they want. We don't block it.
  • When we shrink from md to sm, close all sidebars automatically. The user will be able to reopen any sidebar if they want.
  • Let's not hide "Data sources" toggle in left sidebar in sm view. This was a preexisting issue.

Let me know if you need any help!

@emrberk This was my actual idea to start with this approach, but since it was a pre-existing logic for sm, I hesitated to make the logical changes, but now as you have suggested I will implement it shortly and notify you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants