MCPcopy
hub / github.com/codeaashu/claude-code / exitTeammateView

Function exitTeammateView

src/state/teammateViewHelpers.ts:88–109  ·  view source on GitHub ↗
(
  setAppState: (updater: (prev: AppState) => AppState) => void,
)

Source from the content-addressed store, hash-verified

86 * schedules eviction via evictAfter so the row lingers briefly.
87 */
88export function exitTeammateView(
89 setAppState: (updater: (prev: AppState) => AppState) => void,
90): void {
91 logEvent('tengu_transcript_view_exit', {})
92 setAppState(prev => {
93 const id = prev.viewingAgentTaskId
94 const cleared = {
95 ...prev,
96 viewingAgentTaskId: undefined,
97 viewSelectionMode: 'none' as const,
98 }
99 if (id === undefined) {
100 return prev.viewSelectionMode === 'none' ? prev : cleared
101 }
102 const task = prev.tasks[id]
103 if (!isLocalAgent(task) || !task.retain) return cleared
104 return {
105 ...cleared,
106 tasks: { ...prev.tasks, [id]: release(task) },
107 }
108 })
109}
110
111/**
112 * Context-sensitive x: running → abort, terminal → dismiss.

Callers 8

CoordinatorTaskPanelFunction · 0.85
PromptInputFunction · 0.85
BackgroundTasksDialogFunction · 0.85
handleKeyDownFunction · 0.85
BackgroundTaskStatusFunction · 0.85
handleKeyDownFunction · 0.85
CancelRequestHandlerFunction · 0.85
useTeammateViewAutoExitFunction · 0.85

Calls 3

logEventFunction · 0.85
isLocalAgentFunction · 0.85
releaseFunction · 0.70

Tested by

no test coverage detected