(options: {
readonly onCancel: () => void;
readonly onCtrlC?: () => void;
readonly onCtrlD?: () => void;
readonly initialSelectedSessionId?: string;
// CLI mode flags (--auto/--yolo/--plan) target the session picked at
// startup (bare --session); later /sessions switches keep the picked
// session's own persisted modes.
readonly applyStartupModes?: boolean;
})
| 2745 | } |
| 2746 | |
| 2747 | private mountSessionPicker(options: { |
| 2748 | readonly onCancel: () => void; |
| 2749 | readonly onCtrlC?: () => void; |
| 2750 | readonly onCtrlD?: () => void; |
| 2751 | readonly initialSelectedSessionId?: string; |
| 2752 | // CLI mode flags (--auto/--yolo/--plan) target the session picked at |
| 2753 | // startup (bare --session); later /sessions switches keep the picked |
| 2754 | // session's own persisted modes. |
| 2755 | readonly applyStartupModes?: boolean; |
| 2756 | }): void { |
| 2757 | this.state.activeDialog = 'session-picker'; |
| 2758 | this.mountEditorReplacement( |
| 2759 | new SessionPickerComponent({ |
| 2760 | sessions: this.state.sessions, |
| 2761 | loading: this.state.loadingSessions, |
| 2762 | currentSessionId: this.state.appState.sessionId, |
| 2763 | scope: this.state.sessionsScope, |
| 2764 | initialSelectedSessionId: options.initialSelectedSessionId, |
| 2765 | pageSize: 50, |
| 2766 | onSelect: (session: SessionRow) => { |
| 2767 | void this.handleSessionPickerSelect(session, options.applyStartupModes === true).catch( |
| 2768 | (error) => { |
| 2769 | this.showError(`Failed to apply startup flags: ${formatErrorMessage(error)}`); |
| 2770 | }, |
| 2771 | ); |
| 2772 | }, |
| 2773 | onCancel: options.onCancel, |
| 2774 | onCtrlC: options.onCtrlC, |
| 2775 | onCtrlD: options.onCtrlD, |
| 2776 | onToggleScope: (selectedSessionId: string) => { |
| 2777 | void this.toggleSessionPickerScope(selectedSessionId); |
| 2778 | }, |
| 2779 | }), |
| 2780 | ); |
| 2781 | } |
| 2782 | |
| 2783 | private async handleSessionPickerSelect( |
| 2784 | session: SessionRow, |
no test coverage detected