(selectedSessionId: string)
| 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; |
no test coverage detected