proposed API: expose sidebar/panel/auxiliaryBar visibility to extensions#321414
proposed API: expose sidebar/panel/auxiliaryBar visibility to extensions#321414cgaspard wants to merge 1 commit into
Conversation
…S Code API request - Remove better-sqlite3 (broke on every VS Code NODE_MODULE_VERSION bump) - Add pure-JS SQLite B-tree reader (src/sqlite-reader.ts) — no native deps, reads workbench.sideBar/panel/auxiliaryBar.hidden from state.vscdb at activation - Fix savedLayout tracking: persist pre-maximize state only, clear on restore - Fix default current layout: assume all panels open if DB probe fails - Add unit tests for SQLite reader (8 tests, sweeps all 208 local workspace DBs) - Add test:unit script for running SQLite tests outside VS Code host - Add VSCODE-API-REQUEST.md documenting the upstream API proposal - Update .gitignore to exclude .vscode-test/ and .vscode/settings.json - Add types: ["node"] to tsconfig.json Upstream: microsoft/vscode#321409 PR: microsoft/vscode#321414 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@cgaspard please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
@cgaspard please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Fixes #321409
What
Adds
vscode.proposed.layoutVisibility.d.tswith three new members onvscode.window:isSideBarVisible: boolean— current visibility of the primary sidebarisPanelVisible: boolean— current visibility of the bottom panelisAuxiliaryBarVisible: boolean— current visibility of the auxiliary bar (secondary sidebar)onDidChangeLayoutVisibility— event that fires whenever any of the three changeWhy
There is currently no public Extension API to query whether the sidebar, panel, or auxiliary bar are visible. The internal
IWorkbenchLayoutService.isVisible()andonDidChangePartVisibilityhave exactly this information but are not bridged to the extension host.The context keys
sideBarVisible,panelVisible,auxiliaryBarVisibleexist and are kept in sync internally, but extensions can only use them in declarativewhenclauses — they cannot be read at runtime.Impact
Any extension that manages workbench layout (focus modes, maximize/restore, presentation modes, Zen-like toggles) hits this gap. The only current workaround is to parse VS Code's internal
state.vscdbSQLite file directly — which is stale mid-session and relies on undocumented storage keys.Implementation notes
The proposed
.d.tsfile is provided here. The implementation would bridgeIWorkbenchLayoutService.isVisible("workbench.parts.sidebar/panel/auxiliarybar")andonDidChangePartVisibilityfrom the renderer to the extension host — similar to howwindow.state(focused,active) is currently bridged.