Skip to content

Commit eb93db6

Browse files
committed
docs(forklog): record prompt paste and undo features
Session record and five feature records for item 28: atomic placeholder deletes (opentui#1628 backport), configurable paste summary, raw paste on <leader>v, grouped prompt undo with fork ctrl+z defaults, and the click-to-edit paste dialog, with their upstream v1 PRs anomalyco#54457-anomalyco#54460 and anomalyco#54463, key-byte measurements through Vibeterm's tmux, and the vt-206 installs on desktop and m4max. AI-Tool: opencode 1.18.34-vt-194-907b3bc518 AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Platform: linux AI-Harness: Vibeterm 9343cff AI-Session-ID: ses_ed7634c31ffeH84yR0S99Ty8Nd
1 parent 460027c commit eb93db6

7 files changed

Lines changed: 309 additions & 0 deletions

‎.vibeterm/forklog/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ carries every feature forward unchanged. That commit includes the full
8484
- [Editor-standard Home and End defaults](./features/2026-10-09-editor-home-end.md)
8585
- [Revert messages without reverting files, shown at once](./features/2026-10-10-tui-revert-messages.md)
8686
- [Unqueue a prompt waiting behind the running turn](./features/2026-10-10-tui-unqueue-prompt.md)
87+
- [Delete a paste placeholder whole on word and line deletes](./features/2026-10-10-paste-placeholder-delete.md)
88+
- [Configure when a paste is summarized and what its placeholder says](./features/2026-10-10-paste-summary-config.md)
89+
- [Paste without a placeholder](./features/2026-10-10-paste-raw-key.md)
90+
- [Grouped prompt undo and redo on ctrl+z / ctrl+shift+z](./features/2026-10-10-prompt-undo-history.md)
91+
- [Open a paste placeholder's text by clicking it](./features/2026-10-10-paste-edit-dialog.md)
8792

8893
## Session records
8994

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Open a paste placeholder's text by clicking it
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `prompt-paste-undo` (fork); `paste-edit-dialog` (upstream PR head `0de7073e89`, stacked on undo, paste summary and #53871)
8+
- First local commit: `460027c707`
9+
- Current local commit(s): `460027c707`
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`, contains `v1.18.34`)
11+
- Last checked against upstream: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
12+
- Upstream: PR [#54463](https://github.com/anomalyco/opencode/pull/54463) against `v1`; comment on [#8501](https://github.com/anomalyco/opencode/issues/8501#issuecomment-6105872904). **Needs a v2 port later.**
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 28), quoting the user:
17+
18+
> allow user to click on [ pasted content ] to open a modal that shows the entire text; editable, scrollable, etc. - use the same prompt editor code in that modal as exists on prompt fields, just make it show up in a modal, escape to close/save; button below to replace [ placeholder ] with inlining it
19+
20+
## Goals
21+
22+
- A click on a pasted-text placeholder opens `DialogPaste`: the text in a textarea with the prompt's input keybinds, mouse caret placement and grouped undo; enter adds a line.
23+
- Closing saves; the label is rebuilt with `pasteLabel` when the text changed it. **Inline** replaces the placeholder with the text; empty text removes it. Both are one prompt undo step.
24+
25+
## Changes
26+
27+
| Commit | Workday | Change | Stable seam |
28+
|---|---|---|---|
29+
| `460027c707` | 2026-10-10 | click-to-edit dialog | `packages/tui/src/component/dialog-paste.tsx`; `pasteAtCaret`, `openPaste`, `replacePaste`, `pasteClick` in `component/prompt/index.tsx`; `pasteLabel` in `prompt/paste.ts`; `test/component/prompt-paste.test.tsx`, `test/fixture/prompt-app.ts`; tui.mdx Clickable elements and "Paste summary" |
30+
31+
## Verification
32+
33+
- `prompt-paste.test.tsx` 4 pass (real app, mouse click on the placeholder).
34+
- Real-PTY rig: SGR click on `[Pasted ~3 lines]` opened the dialog; `zero` + enter + esc gave `[Pasted ~4 lines]`; a click on **Inline** put four lines in the prompt; ctrl+z restored the placeholder.
35+
36+
## Timeline
37+
38+
- 2026-10-10 [`ses_ed7634c31ffeH84yR0S99Ty8Nd`](../sessions/2026-10-10-prompt-paste-undo.md) - introduced. Evidence: commit above.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Delete a paste placeholder whole on word and line deletes
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `prompt-paste-undo` (fork); `paste-placeholder-delete` (upstream PR head `13680808c7` on `v1` `dfb56f76c7`); opentui fork `~/projekty/forks/opentui` branch `atomic-virtual-extmarks` (`bec96676`)
8+
- First local commit: `0714559fe2`
9+
- Current local commit(s): `0714559fe2`
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`, contains `v1.18.34`)
11+
- Last checked against upstream: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
12+
- Upstream: opencode PR [#54457](https://github.com/anomalyco/opencode/pull/54457) against `v1`; opentui PR [anomalyco/opentui#1628](https://github.com/anomalyco/opentui/pull/1628). **Needs a v2 port later.**
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 28), quoting the user:
17+
18+
> fix treatment of ^W when dealing with [ pasted content ] (maybe requires a fix in the underlying tui framework? if so, fork it in the right place and submit a contribution from there) - now ^W chops paste contenet placeholder mid way, should just clear it entirely
19+
20+
## Goals
21+
22+
- ctrl+w, alt+backspace, ctrl+u and ctrl+k remove a `[Pasted ~N lines]` placeholder whole, never part of its label.
23+
24+
## Non-goals
25+
26+
- None recorded.
27+
28+
## Rationale and constraints
29+
30+
- The bug is in `@opentui/core`'s `ExtmarksController`: its `deleteRange` wrapper, which every word and line delete goes through, trimmed a virtual extmark instead of treating it as one unit. Fixed at the source in the opentui fork, consumed here as a `bun patch` of the pinned `0.4.5` until opencode adopts a release with #1628.
31+
32+
## Changes
33+
34+
| Commit | Workday | Change | Stable seam |
35+
|---|---|---|---|
36+
| `0714559fe2` | 2026-10-10 | `deleteRange` widens over every virtual extmark it cuts into | `patches/@opentui%2Fcore@0.4.5.patch` (`expandToVirtualExtmarks` in `chunk-bun-t2myhmwd.js` and `chunk-node-q0cwyvm9.js`), `package.json` `patchedDependencies`; `packages/tui/test/component/prompt-placeholder-delete.test.tsx` |
37+
38+
## Verification
39+
40+
- opentui fork: `bun test src/lib/extmarks` 190 pass; the four new virtual-extmark cases fail without the fix; extmark, edit-buffer and textarea suites 828 pass; `fmt:check`, `typecheck` clean.
41+
- `prompt-placeholder-delete.test.tsx` 4 pass; 3 of 4 fail with the patch reverted in `node_modules`.
42+
- Real-PTY rig (scratch build, throwaway tmux socket): ctrl+w after `see [Pasted ~3 lines]` left `see`; alt+backspace, ctrl+k and ctrl+u each removed the placeholder whole.
43+
44+
## Timeline
45+
46+
- 2026-10-10 [`ses_ed7634c31ffeH84yR0S99Ty8Nd`](../sessions/2026-10-10-prompt-paste-undo.md) - introduced. Evidence: commit above, session Verification.
47+
48+
## Current maintenance notes
49+
50+
- On an opentui bump: if the new version contains anomalyco/opentui#1628, drop the patch and its `patchedDependencies` entry; otherwise regenerate it with `bun patch @opentui/core@<version>` against the same two chunks.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Paste without a placeholder
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `prompt-paste-undo` (fork); `paste-raw-key` (upstream PR head `5294c452c1` on `v1` `dfb56f76c7`)
8+
- First local commit: `549df87541`
9+
- Current local commit(s): `549df87541`
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`, contains `v1.18.34`)
11+
- Last checked against upstream: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
12+
- Upstream: PR [#54459](https://github.com/anomalyco/opencode/pull/54459) against `v1`. **Needs a v2 port later.**
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 28), quoting the user:
17+
18+
> paste without [ pasted content ] thing under a separate shortcut, e.g. leader -> v if it doesn't interfere with any default or my keybind. (what is my leader?)
19+
20+
## Goals
21+
22+
- `input_paste_raw` (default `<leader>v`, command `prompt.paste.raw`) pastes the clipboard as typed; an image is still attached.
23+
- A terminal (bracketed) paste while the leader is pending goes in as typed and clears the leader: the path that carries the attached laptop's clipboard over ssh/tmux.
24+
25+
## Rationale and constraints
26+
27+
- `input_paste` and `input_paste_raw` read the clipboard of the machine opencode runs on (`clipboard.read`: wl-paste/xclip/osascript/clipboardy). From m4max attached to desktop that is desktop's clipboard, hence the leader-then-terminal-paste path.
28+
- Leader is `ctrl+x`; `<leader>v` was unbound by default and in the hosts' `tui.json`.
29+
30+
## Changes
31+
32+
| Commit | Workday | Change | Stable seam |
33+
|---|---|---|---|
34+
| `549df87541` | 2026-10-10 | raw paste key and leader-then-paste | `input_paste_raw` in `config/keybind-definitions.ts` and `keybind.ts` CommandMap; `prompt.paste.raw` command, `insertPastedText`, `normalizeLineEndings`, `onPaste` leader branch in `component/prompt/index.tsx`; keymap test "leader then v"; keybinds.mdx "Paste Without a Placeholder" |
35+
36+
## Verification
37+
38+
- `test/keymap.test.tsx` leader case passes.
39+
- Real-PTY rig: ctrl+x then tmux `paste-buffer -p` inserted three lines as typed.
40+
41+
## Timeline
42+
43+
- 2026-10-10 [`ses_ed7634c31ffeH84yR0S99Ty8Nd`](../sessions/2026-10-10-prompt-paste-undo.md) - introduced. Evidence: commit above.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Configure when a paste is summarized and what its placeholder says
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `prompt-paste-undo` (fork); `paste-summary-config` (upstream PR head `adefc0be51` on `v1` `dfb56f76c7`)
8+
- First local commit: `1db2260dee`
9+
- Current local commit(s): `1db2260dee`, `460027c707` (adds `pasteLabel`)
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`, contains `v1.18.34`)
11+
- Last checked against upstream: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
12+
- Upstream: PR [#54458](https://github.com/anomalyco/opencode/pull/54458) against `v1`; comment on [#15767](https://github.com/anomalyco/opencode/issues/15767#issuecomment-6105872750). **Needs a v2 port later.**
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 28), quoting the user:
17+
18+
> allow [ pasted content ~5 lines ] to have lines/bytes/excerpts configurable
19+
20+
## Goals
21+
22+
- `prompt.paste_summary` in `tui.json`: `lines` (default 3), `characters` (default 150), `format` (default `[Pasted ~{lines} lines]`, tokens `{lines}`, `{characters}`, `{bytes}`, `{excerpt}`), `excerpt` (default 30). Defaults reproduce upstream exactly.
23+
24+
## Non-goals
25+
26+
- The global toggle (**Disable paste summary**) is unchanged.
27+
28+
## Changes
29+
30+
| Commit | Workday | Change | Stable seam |
31+
|---|---|---|---|
32+
| `1db2260dee` | 2026-10-10 | thresholds and placeholder format | `PasteSummary`, `PasteSummaryDefaults`, `Prompt.paste_summary` in `packages/tui/src/config/index.tsx`; `pasteSummary` in `packages/tui/src/prompt/paste.ts`; `pasteInputText` in `component/prompt/index.tsx`; `test/prompt/paste.test.ts`; tui.mdx "Paste summary" |
33+
34+
## Verification
35+
36+
- `test/prompt/paste.test.ts` 5 pass; `test/config.test.tsx` schema case.
37+
38+
## Timeline
39+
40+
- 2026-10-10 [`ses_ed7634c31ffeH84yR0S99Ty8Nd`](../sessions/2026-10-10-prompt-paste-undo.md) - introduced. Evidence: commit above.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Grouped prompt undo and redo on ctrl+z / ctrl+shift+z
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `prompt-paste-undo` (fork); `prompt-undo-history` (upstream PR head `8206ce472a`, stacked on `paste-placeholder-delete`)
8+
- First local commit: `6a50eb5d4f`
9+
- Current local commit(s): `6a50eb5d4f`, `832a7fe5c0` (fork-only defaults)
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`, contains `v1.18.34`)
11+
- Last checked against upstream: `dfb56f76c7` (upstream `v1`, `v1.19.0`)
12+
- Upstream: PR [#54460](https://github.com/anomalyco/opencode/pull/54460) against `v1`, keeping upstream's key defaults and showing the ctrl+z config. `832a7fe5c0` is fork-only. **Needs a v2 port later.**
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 28), quoting the user:
17+
18+
> undo/redo last prompt field action, keep X last actions, group actions wisely (e.g. adding a single letter is not a single action; but undoing the whole paragraph that took 20 minutes to write isn't a single action either) - sometimes being not careful and doing one ^U is disastrous, we need a way to undo it; ^Z / ^-shift-z are perfect for it. ^Z if not for being hidden by our vibeterm suspend opencode, which is silly, you don't ever intend to suspend a gui app; and if you do, you can bind suspend action to something else or just back to ^z. defaults: ^z ^s-z to undo/redo. pick sensible X last actions, but make it configurable too. undo/redo should work cross-prompts, e.g. if something just got submitted, ^Z-ing gets you the submitted content back (like pressing arrow up) [but doesn't abort the prompt running]
19+
20+
## Goals
21+
22+
- Typing groups by word; a pause over 1s, a caret move, or switching typing/deleting starts a group; a paste, word/line delete, newline, clear, history recall and submit are one step each.
23+
- Each entry restores text, parts (pasted content, attachments), mode and caret.
24+
- After a submit, undo restores what was sent without aborting the turn; redo empties again.
25+
- `prompt.undo_depth` (default 500).
26+
- Fork defaults: `input_undo` `ctrl+z,ctrl+-,super+z`, `input_redo` `ctrl+shift+z,ctrl+.,super+shift+z`, `terminal_suspend` `none`.
27+
28+
## Rationale and constraints
29+
30+
- The textarea's own undo stepped one character at a time, lost prompt parts (an undone placeholder deletion sent its label, not the pasted text) and was cleared by a submit.
31+
- The history is module-level in `component/prompt/index.tsx` (`promptUndo`), shared by every prompt, so it survives the remount after a route change.
32+
- Up to 16 characters inserted in one read still count as typing: tmux `send-keys` and a busy loop deliver several keys at once.
33+
- Vibeterm masked ctrl+z in opencode panes by default (opencode-tools `shortcutMasks`); opencode-tools `0220818` drops that default and the shared settings set `shortcutMasks: []`.
34+
35+
## Changes
36+
37+
| Commit | Workday | Change | Stable seam |
38+
|---|---|---|---|
39+
| `6a50eb5d4f` | 2026-10-10 | grouped history, cross-prompt, `prompt.undo_depth` | `createPromptUndo`, `copyPromptParts` in `packages/tui/src/prompt/undo.ts`; `promptUndo`, `observeUndo`, `stepUndo`, `input.undo` / `input.redo` command override in `component/prompt/index.tsx`; `Prompt.undo_depth` in `config/index.tsx`; `test/prompt/undo.test.ts`, `test/component/prompt-undo.test.tsx`; tui.mdx "Undo in the prompt"; keybinds.mdx "Undo with ctrl+z" |
40+
| `832a7fe5c0` | 2026-10-10 | fork defaults ctrl+z / ctrl+shift+z, suspend unbound | `input_undo`, `input_redo`, `terminal_suspend` in `config/keybind-definitions.ts`; `test/config.test.tsx`, keymap byte-form test |
41+
42+
## Verification
43+
44+
- `undo.test.ts` 13 pass; `prompt-undo.test.tsx` 3 pass, all 3 fail on the textarea's own undo.
45+
- Keymap test: `\x1a`, `\e[27;6;90~`, `\e[27;6;122~`, `\e[90;6u`, `\e[122;6u` dispatch undo / redo.
46+
- Real-PTY rig: `hello brave world`, ctrl+u, then ctrl+z gave `hello brave world`, `hello brave`, `hello`; ctrl+shift+z redid; after a submit during a streaming turn ctrl+z restored the prompt, the turn kept streaming, redo emptied it.
47+
- Key bytes through tmux with Vibeterm's bindings: see the session record.
48+
49+
## Timeline
50+
51+
- 2026-10-10 [`ses_ed7634c31ffeH84yR0S99Ty8Nd`](../sessions/2026-10-10-prompt-paste-undo.md) - introduced. Evidence: commits above.
52+
53+
## Current maintenance notes
54+
55+
- An opentui textarea undo change does not affect this: `input.undo` / `input.redo` are overridden by the prompt's own commands while it is focused.

0 commit comments

Comments
 (0)