Skip to content

feat(layout): expose function and command to toggle visibility of sidebar (drawer + call_log windows) #224

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eduardofuncao
Copy link
Contributor

@eduardofuncao eduardofuncao commented Jul 23, 2025

Motivation

When working within the same database connection, the sidebar containing the drawer and call log windows might not always be needed opened. Toggling it off can be used to open up some space to some focus work with the editor and results windows.

What was done

A function to toggle the visibility of the sidebar (drawer + call_log windows simultaneously) is exposed through require("dbee").sidebar_toggle() or through the command :Dbee sidebarToggle.

toggle-sidebar.mp4

Closes #223

Potential issues

  • If the height and width of the windows to be hidden are changed before they are toggled off, when you toggle the sidebar back on, the height and width of the windows will be reset to the default values;
  • If there are any expanded database nodes (showing schemas/tables) before the sidebar is toggled off, when the sidebar is toggled back on, the UI will lag for a bit before displaying the sidebar because the databases tables are refetched. This might be possible to solve by implementing some sort of loading state on these nodes.

@taybart
Copy link

taybart commented Jul 24, 2025

I tested and it works for me!

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.

Option to simplify/toggle ui
2 participants