Skip to content

feat: add a keyboard shortcut for collapsing the Object Explorer - #10296

Open
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:feature/object-explorer-toggle-shortcut
Open

feat: add a keyboard shortcut for collapsing the Object Explorer#10296
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:feature/object-explorer-toggle-shortcut

Conversation

@dpage

@dpage dpage commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

#10254 made the Object Explorer collapsible by clicking the current workspace icon, but that click is currently the only way to do it. This adds a keyboard shortcut, Ctrl+Alt+B by default, registered as its own toggle_object_explorer preference so it can be changed like any other.

Why Ctrl+Alt+B

The Shift+Alt+<letter> family is full: b, f, o, l, h, q, v, s, n, e, d and g are all taken, and b belongs to the existing Object Explorer shortcut, which keeps its present meaning of focusing the tree. Ctrl+Alt+B is free, sits close enough to VS Code's Ctrl+B for the side bar to be guessable, and keeps a family resemblance to the bracket keys used for tab navigation. Ctrl+Shift+B was the other obvious candidate and I avoided it, since Chrome and Firefox both use it for the bookmarks bar.

One caveat worth raising rather than burying: on keyboard layouts where AltGr is Ctrl+Alt, this combination can be swallowed by the layout and produce a character instead. That applies to any Ctrl+Alt binding, the preference is user-configurable, and Shift+Ctrl+Alt+B is available if the default turns out to irritate people. Happy to change the default if reviewers prefer.

Shape of the change

The shortcut only fires a pgadmin:object-explorer:toggle event, because the workspace provider owns the visibility state, and the provider ignores it in classic layout, where there is no workspace toolbar and the Object Explorer is always shown.

Testing

web/regression/javascript/browser/keyboard_toggle_object_explorer_spec.js covers the shortcut asking for the toggle, and WorkspaceProvider.spec.jsx gains a case for the provider acting on it in both directions.

Also driven in a browser: in the workspace layout, Ctrl+Alt+B collapses the panel and a second press restores it, with aria-pressed on the workspace icon following along, and the new preference appears alongside the existing shortcuts.

Documented in docs/en_US/keyboard_shortcuts.rst. No release note entry, per the usual practice of batching those shortly before release.

pgadmin-org#10254 made the Object Explorer collapsible by clicking the current
workspace icon, but left that as the only way to do it. This adds a
shortcut, Ctrl+Alt+B by default, registered as its own
toggle_object_explorer preference so anyone can change it.

Ctrl+Alt+B rather than anything in the Shift+Alt family, which is full: b,
f, o, l, h, q, v, s, n, e, d and g are all taken, b by the existing Object
Explorer shortcut, which keeps its meaning of focusing the tree. Ctrl+Alt+B
is close enough to VS Code's Ctrl+B for the side bar to be guessable, and
keeps a family resemblance to the bracket keys used for tab navigation.
Ctrl+Shift+B would have been the other obvious candidate, but Chrome and
Firefox both use it for the bookmarks bar.

Worth noting for anyone reviewing: on keyboard layouts where AltGr is
Ctrl+Alt, this combination can be swallowed by the layout and produce a
character instead. That is true of any Ctrl+Alt binding, the preference is
user-configurable, and Shift+Ctrl+Alt+B is available if the default turns
out to annoy people.

The shortcut itself only fires an event, since the workspace provider owns
the visibility state, and the provider ignores it in classic layout where
there is no workspace toolbar and the Object Explorer is always shown.

Tested in a browser as well as in the unit tests: from the workspace layout
the key collapses and restores the panel, and the preference is registered
alongside the existing shortcuts.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant