nvim-dbee icon indicating copy to clipboard operation
nvim-dbee copied to clipboard

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

Open eduardofuncao opened this issue 4 months ago • 3 comments

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.

https://github.com/user-attachments/assets/b3f7895e-be03-4bdf-ab51-2e02688cc7c4

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.

eduardofuncao avatar Jul 23 '25 23:07 eduardofuncao

I tested and it works for me!

taybart avatar Jul 24 '25 04:07 taybart

@kndndrj can this go in?

taybart avatar Sep 28 '25 04:09 taybart

Sorry, I read some other disscussions and it seems like i should ask @MattiasMTS ?

taybart avatar Sep 28 '25 04:09 taybart