From ea2d4d5bf580a761b9c107e82e3a8fcc202368dd Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Fri, 6 Nov 2026 21:15:41 -0500 Subject: [PATCH] Revert "fix(tui): choose project or temp folder for session exports" This reverts commit 412d93e7336122866088de714e1e17f9881f6fdc. --- packages/tui/src/routes/session/index.tsx | 4 +- packages/tui/src/ui/dialog-export-options.tsx | 55 +------------------ .../component/dialog-export-options.test.tsx | 2 +- 3 files changed, 6 insertions(+), 55 deletions(-) diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index 8a6e07b8ebc..33bd34340ec 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -13,7 +13,7 @@ import { type Accessor, } from "solid-js" import path from "node:path" -import { EOL, tmpdir } from "node:os" +import { EOL } from "node:os" import { mkdir, writeFile } from "node:fs/promises" import { useRoute, useRouteData } from "../../context/route" import { createStore } from "solid-js/store" @@ -1376,7 +1376,7 @@ export function Session(props: { } const filepath = path.join( - options.location === "project" ? paths.cwd : tmpdir(), + paths.cwd, `session-${crypto.randomUUID()}.${options.format === "markdown" ? "md" : "json"}`, ) await writeExport(filepath, content) diff --git a/packages/tui/src/ui/dialog-export-options.tsx b/packages/tui/src/ui/dialog-export-options.tsx index e219edd0569..014e76b7bb5 100644 --- a/packages/tui/src/ui/dialog-export-options.tsx +++ b/packages/tui/src/ui/dialog-export-options.tsx @@ -7,14 +7,12 @@ import { createStore } from "solid-js/store" import { createMemo, createSignal, For, Show } from "solid-js" export type ExportFormat = "markdown" | "json" -export type ExportLocation = "project" | "temp" export type DialogExportOptionsProps = { defaultThinking: boolean onConfirm?: (options: { action: "copy" | "export" format: ExportFormat - location: ExportLocation thinking: boolean tools: boolean sanitize: boolean @@ -22,7 +20,7 @@ export type DialogExportOptionsProps = { onCancel?: () => void } -type Active = ExportFormat | ExportLocation | "thinking" | "tools" | "sanitize" | "copy" | "export" +type Active = ExportFormat | "thinking" | "tools" | "sanitize" | "copy" | "export" export function DialogExportOptions(props: DialogExportOptionsProps) { const newDesigns = useNewDesigns() @@ -33,13 +31,12 @@ export function DialogExportOptions(props: DialogExportOptionsProps) { ) } -type Row = "format" | "location" | "thinking" | "tools" | "sanitize" +type Row = "format" | "thinking" | "tools" | "sanitize" /** Export options as a list of values, under the "new-designs" experiment: ↑/↓ moves, ←/→ or space changes. */ function DialogExportOptionsList(props: DialogExportOptionsProps) { const [store, setStore] = createStore({ format: "markdown" as ExportFormat, - location: "project" as ExportLocation, thinking: props.defaultThinking, tools: true, sanitize: false, @@ -50,7 +47,6 @@ function DialogExportOptionsList(props: DialogExportOptionsProps) { props.onConfirm?.({ action, format: store.format, - location: store.location, thinking: store.thinking, tools: store.tools, sanitize: store.sanitize, @@ -58,7 +54,6 @@ function DialogExportOptionsList(props: DialogExportOptionsProps) { const change = (row: Row) => { if (row === "format") return setStore("format", store.format === "markdown" ? "json" : "markdown") - if (row === "location") return setStore("location", store.location === "project" ? "temp" : "project") setStore(row, !store[row]) } @@ -71,13 +66,6 @@ function DialogExportOptionsList(props: DialogExportOptionsProps) { footerOverhang: 2, footer: , }, - { - title: "Location", - value: "location" as Row, - onSelect: () => change("location"), - footerOverhang: 2, - footer: , - }, ...(store.format === "markdown" ? [ { @@ -146,7 +134,6 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { const labelColor = (active: boolean) => (active ? theme.text.formfield.focused : theme.text.formfield.base) const [store, setStore] = createStore({ format: "markdown" as ExportFormat, - location: "project" as ExportLocation, thinking: props.defaultThinking, tools: true, sanitize: false, @@ -157,7 +144,6 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { props.onConfirm?.({ action, format: store.format, - location: store.location, thinking: store.thinking, tools: store.tools, sanitize: store.sanitize, @@ -168,10 +154,6 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { setStore("format", store.active) return } - if (store.active === "project" || store.active === "temp") { - setStore("location", store.active) - return - } if (store.active === "thinking") setStore("thinking", !store.thinking) if (store.active === "tools") setStore("tools", !store.tools) if (store.active === "sanitize") setStore("sanitize", !store.sanitize) @@ -180,9 +162,7 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { const move = (offset: number) => { const options: Active[] = - store.format === "markdown" - ? ["markdown", "json", "project", "temp", "thinking", "tools"] - : ["markdown", "json", "project", "temp", "sanitize"] + store.format === "markdown" ? ["markdown", "json", "thinking", "tools"] : ["markdown", "json", "sanitize"] const order: Active[] = [...options, "copy", "export"] setStore("active", order[(order.indexOf(store.active) + offset + order.length) % order.length]) } @@ -206,11 +186,6 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { setStore("active", format) } - const selectLocation = (location: ExportLocation) => { - setStore("location", location) - setStore("active", location) - } - return ( } @@ -265,29 +240,6 @@ function LegacyDialogExportOptions(props: DialogExportOptionsProps) { - - - Save to: - - - - {(location) => ( - selectLocation(location)} - > - - {store.location === location ? "◉" : "○"} - - {location === "project" ? "Project" : "Temp"} - - )} - - - return new Promise<{ action: "copy" | "export" format: ExportFormat - location: ExportLocation thinking: boolean tools: boolean sanitize: boolean diff --git a/packages/tui/test/component/dialog-export-options.test.tsx b/packages/tui/test/component/dialog-export-options.test.tsx index 489ac4cb22a..bc07120af37 100644 --- a/packages/tui/test/component/dialog-export-options.test.tsx +++ b/packages/tui/test/component/dialog-export-options.test.tsx @@ -55,7 +55,7 @@ test("tab and shift+tab move a visible focus through the export options", async expect(span("Include thinking")?.fg.equals(field())).toBe(true) expect(span("Copy")?.bg.equals(focusedButton())).toBe(false) - for (const _ of [1, 2, 3, 4, 5, 6]) app.mockInput.pressTab() + for (const _ of [1, 2, 3, 4]) app.mockInput.pressTab() await app.waitForFrame(() => span("Copy")?.bg.equals(focusedButton()) === true) expect(span("Include tools")?.fg.equals(field())).toBe(true)