Skip to content

feat: implement copy command with options - #15168

Closed
leoncheng57 wants to merge 1 commit into
anomalyco:devfrom
leoncheng57:feature/copy-command-with-options
Closed

leoncheng57 wants to merge 1 commit into
anomalyco:devfrom
leoncheng57:feature/copy-command-with-options

Conversation

@leoncheng57

@leoncheng57 leoncheng57 commented Feb 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #2118

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a new copyWithOptions command that allows users to copy messages with customizable formatting options. Users can now select exactly which messages in the session to copy with formatting retained. This does not replace the existing copy command.

  • The new copyWithOptions command that enables selective copying of session messages
  • Solves the problem where users could only copy entire session transcripts or the last message—now they can choose exactly which messages to export
  • Adds a DialogCopyMessages component that provides a keyboard-navigable interface where users can view message previews, toggle selections with spacebar, select all with Ctrl+A, and confirm with Enter
  • TUI user interface with keyboard-first navigation (up/down arrows, space, Enter, Ctrl+A)
  • Includes unit test coverage validating both the command handler logic and the dialog component behavior

How did you verify your code works?

  • Added unit tests for the new DialogCopyMessages component
  • Extensive manual testing to see that all the copy commands and different options are working

Screenshots / recordings

image
PR.recording.mov

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR:

However, this is a historical PR rather than a current duplicate. No active open/unmerged duplicate PRs addressing the same copyWithOptions feature were found.

Result: No active duplicate PRs found

@leoncheng57
leoncheng57 force-pushed the feature/copy-command-with-options branch 2 times, most recently from aaccef0 to 745939b Compare February 26, 2026 05:35
This commit includes:
- Add selective copy dialog for User msgs and AI responses
- Expand copy dialog to support both user and assistant messages
- Fix scrolling issues and improve type safety
@leoncheng57
leoncheng57 force-pushed the feature/copy-command-with-options branch from 745939b to 45d5acc Compare February 26, 2026 05:42
@leoncheng57 leoncheng57 reopened this Feb 26, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a /copy command to copy latest message (or allow scrolling while selecting text)

1 participant