MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / toggleSessionPickerScope

Method toggleSessionPickerScope

apps/kimi-code/src/tui/kimi-tui.ts:2710–2734  ·  view source on GitHub ↗
(selectedSessionId: string)

Source from the content-addressed store, hash-verified

2708 }
2709
2710 private async toggleSessionPickerScope(selectedSessionId: string): Promise<void> {
2711 const requestToken = ++this.sessionPickerScopeRequestToken;
2712 const nextScope = this.state.sessionsScope === 'cwd' ? 'all' : 'cwd';
2713 await this.fetchSessions(nextScope);
2714 if (requestToken !== this.sessionPickerScopeRequestToken) return;
2715 if (this.state.activeDialog !== 'session-picker') return;
2716 this.mountSessionPicker({
2717 initialSelectedSessionId: selectedSessionId,
2718 applyStartupModes: this.sessionPickerOptions.applyStartupModes,
2719 onCancel: () => {
2720 this.hideSessionPicker();
2721 if (this.sessionPickerOptions.closeOnCancel) void this.stop();
2722 },
2723 onCtrlC: this.sessionPickerOptions.forwardEditorExit
2724 ? () => {
2725 this.state.editor.onCtrlC?.();
2726 }
2727 : undefined,
2728 onCtrlD: this.sessionPickerOptions.forwardEditorExit
2729 ? () => {
2730 this.state.editor.onCtrlD?.();
2731 }
2732 : undefined,
2733 });
2734 }
2735
2736 hideSessionPicker(): void {
2737 this.sessionPickerScopeRequestToken += 1;

Callers 1

mountSessionPickerMethod · 0.95

Calls 4

fetchSessionsMethod · 0.95
mountSessionPickerMethod · 0.95
hideSessionPickerMethod · 0.95
stopMethod · 0.95

Tested by

no test coverage detected