nvim-dbee
nvim-dbee copied to clipboard
feat(layout): expose function and command to toggle visibility of sidebar (drawer + call_log windows)
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.
I tested and it works for me!
@kndndrj can this go in?
Sorry, I read some other disscussions and it seems like i should ask @MattiasMTS ?