feat(ui): add session history navigation, permission keys, and review shortcuts
mod+alt+arrows step through this window's session-open history (or between neighbouring tabs when session tabs are on), mod+k r renames the current session inline, and mod+k a toggles permission auto-accept. Pending permission cards respond to alt+enter / alt+shift+enter / alt+backspace with the keys printed on the buttons. The commit message box commits on mod+enter, alt+arrows step the diff review between changed files, and the command palette gains search-only commands for rare actions so the initial list stays short.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import { isTerminalEventTarget } from '@/lib/terminalFocus';
|
||||
import { useSessionUIStore } from '@/sync/session-ui-store';
|
||||
import { activateSessionTabByIndex, closeSessionTabAndActivateNeighbour } from '@/lib/sessionTabs';
|
||||
import { activateAdjacentSessionTab, activateSessionTabByIndex, closeSessionTabAndActivateNeighbour } from '@/lib/sessionTabs';
|
||||
import { navigateSessionHistory } from '@/lib/sessionNavigationHistory';
|
||||
import { useSelectionStore } from '@/sync/selection-store';
|
||||
import * as sessionActions from '@/sync/session-actions';
|
||||
import { normalizeContextPanelDirectoryKey, useUIStore } from '@/stores/useUIStore';
|
||||
@@ -169,6 +170,14 @@ export const useKeyboardShortcuts = () => {
|
||||
console.warn('[keyboard-shortcuts] failed to open draft mini chat window', error);
|
||||
});
|
||||
},
|
||||
switch_session_previous: () => {
|
||||
if (!isVSCodeRuntime() && useUIStore.getState().sessionTabsEnabled && activateAdjacentSessionTab(-1)) return;
|
||||
return navigateSessionHistory(-1) ? undefined : false;
|
||||
},
|
||||
switch_session_next: () => {
|
||||
if (!isVSCodeRuntime() && useUIStore.getState().sessionTabsEnabled && activateAdjacentSessionTab(1)) return;
|
||||
return navigateSessionHistory(1) ? undefined : false;
|
||||
},
|
||||
close_session_tab: () => {
|
||||
if (isVSCodeRuntime() || !useUIStore.getState().sessionTabsEnabled) return false;
|
||||
if (currentSessionId) {
|
||||
|
||||
Reference in New Issue
Block a user