()
| 55 | } |
| 56 | }; |
| 57 | const handleFilenameSubmit = () => { |
| 58 | const finalFilename = filename.endsWith('.txt') ? filename : filename.replace(/\.[^.]+$/, '') + '.txt'; |
| 59 | const filepath = join(getCwd(), finalFilename); |
| 60 | try { |
| 61 | writeFileSync_DEPRECATED(filepath, content, { |
| 62 | encoding: 'utf-8', |
| 63 | flush: true |
| 64 | }); |
| 65 | onDone({ |
| 66 | success: true, |
| 67 | message: `Conversation exported to: ${filepath}` |
| 68 | }); |
| 69 | } catch (error) { |
| 70 | onDone({ |
| 71 | success: false, |
| 72 | message: `Failed to export conversation: ${error instanceof Error ? error.message : 'Unknown error'}` |
| 73 | }); |
| 74 | } |
| 75 | }; |
| 76 | |
| 77 | // Dialog calls onCancel when Escape is pressed. If we are in the filename |
| 78 | // input sub-screen, go back to the option list instead of closing entirely. |
nothing calls this directly
no test coverage detected