fix: allow closing last session tab and restore DevTools shortcut

Closing the sole remaining non-welcome tab now resets to welcome; enable Tauri devtools, menu/shortcut toggle, and copy release artifacts from CARGO_TARGET_DIR.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Logan.LiandCursor committed 2026-08-12 01:31:20 +08:00
1 parent da95113e6d
commit 188f3556ed
14 files changed
+95 -38

No files matched your search

+11 -1
View File
@@ -213,6 +213,15 @@ export function useKeyboardShortcuts(): void {
return
}
// ---- Cmd+Option+I / F12: 开发者工具(输入框内也可用)----
if ((ctrlOrMeta && e.altKey && !e.shiftKey && e.key.toLowerCase() === 'i') || e.key === 'F12') {
e.preventDefault()
void window.opsxApi?.toggleDevtools?.().catch(() => {
logger.warn('Failed to toggle developer tools')
})
return
}
// ---- 以下快捷键在输入框中不触发 (除非 fireInInput=true) ----
if (isInputElement(e) && !shouldFireInInput(e)) {
return
@@ -222,7 +231,8 @@ export function useKeyboardShortcuts(): void {
if (matchesKeySequence(e, keys[KeybindingAction.TAB_CLOSE])) {
e.preventDefault()
const { tabs, activeTabId } = useTabStore.getState()
if (activeTabId && tabs.length > 1) {
const active = tabs.find((tab) => tab.id === activeTabId)
if (activeTabId && (tabs.length > 1 || active?.type !== 'welcome')) {
logger.debug('Ctrl+W: closing tab', activeTabId)
void disposeAndCloseTab(activeTabId)
}