diff options
| author | Aiden Cline <[email protected]> | 2026-04-28 23:55:14 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-28 23:55:14 -0500 |
| commit | 504ca3d3d8784d74164c1f0a5a22300f0383a5aa (patch) | |
| tree | fb288462c148894d5258bce2cf6aa0f783beb11d /packages | |
| parent | a8c74c04deff2fdc63c81655b8d0dc218a762aff (diff) | |
| download | opencode-504ca3d3d8784d74164c1f0a5a22300f0383a5aa.tar.gz opencode-504ca3d3d8784d74164c1f0a5a22300f0383a5aa.zip | |
feat: make it easier to toggle on/off paste summary in the tui (#24869)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/app.tsx | 16 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 703da1b59..a26b8cfdf 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -301,6 +301,9 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) { renderer.clearSelection() } const [terminalTitleEnabled, setTerminalTitleEnabled] = createSignal(kv.get("terminal_title_enabled", true)) + const [pasteSummaryEnabled, setPasteSummaryEnabled] = createSignal( + kv.get("paste_summary_enabled", !sync.data.config.experimental?.disable_paste_summary), + ) // Update terminal window title based on current route and session createEffect(() => { @@ -737,6 +740,19 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) { }, }, { + title: pasteSummaryEnabled() ? "Disable paste summary" : "Enable paste summary", + value: "app.toggle.paste_summary", + category: "System", + onSelect: (dialog) => { + setPasteSummaryEnabled((prev) => { + const next = !prev + kv.set("paste_summary_enabled", next) + return next + }) + dialog.clear() + }, + }, + { title: kv.get("session_directory_filter_enabled", true) ? "Disable session directory filtering" : "Enable session directory filtering", diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 7fead6fdb..641edd30a 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -1209,7 +1209,7 @@ export function Prompt(props: PromptProps) { const lineCount = (pastedContent.match(/\n/g)?.length ?? 0) + 1 if ( (lineCount >= 3 || pastedContent.length > 150) && - !sync.data.config.experimental?.disable_paste_summary + kv.get("paste_summary_enabled", !sync.data.config.experimental?.disable_paste_summary) ) { pasteText(pastedContent, `[Pasted ~${lineCount} lines]`) return |
