mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 10:33:25 +08:00
feat(terminal-dashboard): improve UX for pane/session management
- Add confirmation dialog when closing pane with active session - Add explicit "Close Session" button to terminate backend PTY - Handle "session not found" scenario with user-friendly message - Add i18n keys for new UI elements (en/zh)
This commit is contained in:
@@ -361,6 +361,56 @@ export const useSessionManagerStore = create<SessionManagerStore>()(
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
// ========== Session Lock Actions ==========
|
||||
|
||||
lockSession: (sessionId: string, reason: string, executionId?: string) => {
|
||||
set(
|
||||
(state) => {
|
||||
const existing = state.terminalMetas[sessionId];
|
||||
if (!existing) return state;
|
||||
return {
|
||||
terminalMetas: {
|
||||
...state.terminalMetas,
|
||||
[sessionId]: {
|
||||
...existing,
|
||||
status: 'locked' as TerminalStatus,
|
||||
isLocked: true,
|
||||
lockReason: reason,
|
||||
lockedByExecutionId: executionId,
|
||||
lockedAt: new Date().toISOString(),
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
false,
|
||||
'lockSession'
|
||||
);
|
||||
},
|
||||
|
||||
unlockSession: (sessionId: string) => {
|
||||
set(
|
||||
(state) => {
|
||||
const existing = state.terminalMetas[sessionId];
|
||||
if (!existing) return state;
|
||||
return {
|
||||
terminalMetas: {
|
||||
...state.terminalMetas,
|
||||
[sessionId]: {
|
||||
...existing,
|
||||
status: 'active' as TerminalStatus,
|
||||
isLocked: false,
|
||||
lockReason: undefined,
|
||||
lockedByExecutionId: undefined,
|
||||
lockedAt: undefined,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
false,
|
||||
'unlockSession'
|
||||
);
|
||||
},
|
||||
}),
|
||||
{ name: 'SessionManagerStore' }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user