fix: improve OpenCode update and desktop menu behavior

Restart OpenCode after successful updates so the new version is active
Open native About menu into the app About dialog
Update desktop View menu actions for the new layout
This commit is contained in:
Bohdan Triapitsyn
2026-05-20 17:29:00 +03:00
parent 966f35da6c
commit aaffd6c598
12 changed files with 130 additions and 98 deletions
+29 -20
View File
@@ -72,10 +72,11 @@ type MenuAction =
| 'new-session'
| 'new-worktree-session'
| 'change-workspace'
| 'open-git-tab'
| 'open-diff-tab'
| 'open-files-tab'
| 'open-terminal-tab'
| 'toggle-right-sidebar'
| 'open-right-sidebar-git'
| 'open-right-sidebar-files'
| 'toggle-terminal'
| 'toggle-terminal-expanded'
| 'copy'
| 'theme-light'
| 'theme-dark'
@@ -97,6 +98,11 @@ export const useMenuActions = (
const setActiveMainTab = useUIStore((s) => s.setActiveMainTab);
const setSettingsDialogOpen = useUIStore((s) => s.setSettingsDialogOpen);
const setAboutDialogOpen = useUIStore((s) => s.setAboutDialogOpen);
const toggleRightSidebar = useUIStore((s) => s.toggleRightSidebar);
const setRightSidebarOpen = useUIStore((s) => s.setRightSidebarOpen);
const setRightSidebarTab = useUIStore((s) => s.setRightSidebarTab);
const toggleBottomTerminal = useUIStore((s) => s.toggleBottomTerminal);
const setBottomTerminalExpanded = useUIStore((s) => s.setBottomTerminalExpanded);
const checkForUpdates = useUpdateStore((state) => state.checkForUpdates);
const { setThemeMode } = useThemeSystem();
const checkUpdatesInFlightRef = React.useRef(false);
@@ -165,29 +171,27 @@ export const useMenuActions = (
handleChangeWorkspace();
break;
case 'open-git-tab': {
const { activeMainTab } = useUIStore.getState();
setActiveMainTab(activeMainTab === 'git' ? 'chat' : 'git');
case 'toggle-right-sidebar':
toggleRightSidebar();
break;
}
case 'open-diff-tab': {
const { activeMainTab } = useUIStore.getState();
setActiveMainTab(activeMainTab === 'diff' ? 'chat' : 'diff');
case 'open-right-sidebar-git':
setRightSidebarOpen(true);
setRightSidebarTab('git');
break;
}
case 'open-files-tab': {
const { activeMainTab } = useUIStore.getState();
setActiveMainTab(activeMainTab === 'files' ? 'chat' : 'files');
case 'open-right-sidebar-files':
setRightSidebarOpen(true);
setRightSidebarTab('files');
break;
}
case 'open-terminal-tab': {
const { activeMainTab } = useUIStore.getState();
setActiveMainTab(activeMainTab === 'terminal' ? 'chat' : 'terminal');
case 'toggle-terminal':
toggleBottomTerminal();
break;
case 'toggle-terminal-expanded':
setBottomTerminalExpanded(!useUIStore.getState().isBottomTerminalExpanded);
break;
}
case 'copy': {
const copyEvent = new Event('openchamber:copy', { cancelable: true });
@@ -239,9 +243,14 @@ export const useMenuActions = (
setSessionSwitcherOpen,
setCommandPaletteOpen,
setSettingsDialogOpen,
setBottomTerminalExpanded,
setRightSidebarOpen,
setRightSidebarTab,
setThemeMode,
toggleBottomTerminal,
toggleCommandPalette,
toggleHelpDialog,
toggleRightSidebar,
toggleSidebar,
]
);