fix(menu): wire Command Palette / Sidebar / Bottom Panel View-menu toggles

This commit is contained in:
2026-08-23 19:31:33 +05:30
parent 66938968db
commit d43fbaea59
+19
View File
@@ -1682,6 +1682,11 @@ document.addEventListener('DOMContentLoaded', async () => {
const ReplPanel = getReplPanel(); const ReplPanel = getReplPanel();
replPanel = new ReplPanel(); replPanel = new ReplPanel();
// View menu: toggle the bottom REPL panel
ipcRenderer.on('toggle-bottom-panel', () => {
replPanel.toggle();
});
// Populate app version from main process // Populate app version from main process
window.electronAPI.getAppVersion().then((version) => { window.electronAPI.getAppVersion().then((version) => {
const el = document.getElementById('app-version-display'); const el = document.getElementById('app-version-display');
@@ -1793,6 +1798,11 @@ document.addEventListener('DOMContentLoaded', async () => {
}, },
}); });
// View menu: toggle a sidebar panel by id (explorer/git/snippets/templates/outline)
ipcRenderer.on('toggle-sidebar-panel', (event, panelId) => {
sidebarManager.togglePanel(panelId);
});
// --- Plugin System --- // --- Plugin System ---
const { PluginLoader } = require('./plugins/plugin-loader'); const { PluginLoader } = require('./plugins/plugin-loader');
const { PluginRegistry } = require('./plugins/plugin-registry'); const { PluginRegistry } = require('./plugins/plugin-registry');
@@ -2045,6 +2055,15 @@ document.addEventListener('DOMContentLoaded', async () => {
commandPalette.register('Load Custom Preview CSS', '', triggerLoadCustomCSS); commandPalette.register('Load Custom Preview CSS', '', triggerLoadCustomCSS);
commandPalette.register('Clear Custom Preview CSS', '', triggerClearCustomCSS); commandPalette.register('Clear Custom Preview CSS', '', triggerClearCustomCSS);
// View menu: toggle the Command Palette
ipcRenderer.on('toggle-command-palette', () => {
if (commandPalette.isOpen()) {
commandPalette.close();
} else {
commandPalette.open();
}
});
// Keyboard shortcuts // Keyboard shortcuts
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
// Ctrl+Shift+P — Command Palette // Ctrl+Shift+P — Command Palette