Skip to content

feat(tui): paste into custom form answers - #41080

Closed
kitlangton wants to merge 1 commit into
v2from
paste-custom
Closed

kitlangton wants to merge 1 commit into
v2from
paste-custom

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Pasting while a choice form is active now routes the pasted text directly into Type your own answer, regardless of which option is highlighted. The editor opens with the complete pasted value and does not submit automatically.

How

  • packages/tui/src/routes/session/form.tsx handles form-level paste events while the form mode is active.
  • packages/tui/src/mini/footer.form.tsx applies the same behavior to the direct-run form footer.
  • Paste is rerouted only for choice fields that permit custom answers.
  • Text fields retain native paste behavior, and choices without custom answers remain unchanged.
  • Pasted bytes use OpenTUI's decoding and ANSI-stripping behavior before insertion.

Scope

This PR covers paste routing only. Automatically opening the custom editor when typing on its highlighted row is handled separately in #41079.

Testing

  • bun run test test/cli/tui/form.test.tsx test/mini/footer.view.test.tsx from packages/tui: 43 passed, 4 skipped
  • bun typecheck from packages/tui
  • Pre-push bun turbo typecheck --concurrency=3: 32 tasks passed
  • OpenCode Drive end-to-end recording against this worktree

Demo

The recording uses an isolated OpenCode Drive TUI with a simulated question response and bracketed-paste input. A predefined option remains highlighted before paste; the pasted value opens and fills Type your own answer without submitting.

recording-fd589c55-24a0-4c2e-824a-0fae534b6f79.mp4

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant