| 93 | |
| 94 | // Generate options with summarize as input type for inline context |
| 95 | function getRestoreOptions(canRestoreCode: boolean): OptionWithDescription<RestoreOption>[] { |
| 96 | const baseOptions: OptionWithDescription<RestoreOption>[] = canRestoreCode ? [{ |
| 97 | value: 'both', |
| 98 | label: 'Restore code and conversation' |
| 99 | }, { |
| 100 | value: 'conversation', |
| 101 | label: 'Restore conversation' |
| 102 | }, { |
| 103 | value: 'code', |
| 104 | label: 'Restore code' |
| 105 | }] : [{ |
| 106 | value: 'conversation', |
| 107 | label: 'Restore conversation' |
| 108 | }]; |
| 109 | const summarizeInputProps = { |
| 110 | type: 'input' as const, |
| 111 | placeholder: 'add context (optional)', |
| 112 | initialValue: '', |
| 113 | allowEmptySubmitToCancel: true, |
| 114 | showLabelWithValue: true, |
| 115 | labelValueSeparator: ': ' |
| 116 | }; |
| 117 | baseOptions.push({ |
| 118 | value: 'summarize', |
| 119 | label: 'Summarize from here', |
| 120 | ...summarizeInputProps, |
| 121 | onChange: setSummarizeFromFeedback |
| 122 | }); |
| 123 | if ("external" === 'ant') { |
| 124 | baseOptions.push({ |
| 125 | value: 'summarize_up_to', |
| 126 | label: 'Summarize up to here', |
| 127 | ...summarizeInputProps, |
| 128 | onChange: setSummarizeUpToFeedback |
| 129 | }); |
| 130 | } |
| 131 | baseOptions.push({ |
| 132 | value: 'nevermind', |
| 133 | label: 'Never mind' |
| 134 | }); |
| 135 | return baseOptions; |
| 136 | } |
| 137 | |
| 138 | // Log when selector is opened |
| 139 | useEffect(() => { |