Skip to content

Bug: "Copy as Markdown" copies only first response instead of latest in follow-up dialog #249

@baruhb

Description

@baruhb

Bug Report

Description

When using the "In a pop-up window (with follow-up support)" response mode, the "Copy as Markdown" button (2) copies only the first AI response instead of the latest/last response in the conversation.

Steps to Reproduce

  1. Select text and invoke Writing Tools
  2. Choose any action (e.g., "Rewrite")
  3. Set response mode to "In a pop-up window (with follow-up support)"
  4. Receive initial AI response
  5. Ask a follow-up question (e.g., "more info")
  6. Receive second response
  7. Click "Copy as Markdown" button

Expected: Copies the latest response (step 6)
Actual: Copies the first response (step 4)

Screenshots

Image Image

Suggested Fix

The "Copy as Markdown" button should copy the last response in the conversation, not the first.


Feature Request: Improved UX for multi-response dialogs

Problem

When using follow-up mode, users often want to:

  1. Copy a specific response (not always the first or last)
  2. Use a specific response to replace the original text

Currently there's no easy way to do either.

Proposed Solution

Option A: Add buttons to each response block (Recommended)

Add two buttons next to each AI response:

┌─────────────────────────────────────────────────┐
│ Response 1: "Short version of the text..."      │
│                                    [Copy] [Use] │
├─────────────────────────────────────────────────┤
│ Response 2: "Detailed version with bullets..."  │
│                                    [Copy] [Use] │
└─────────────────────────────────────────────────┘
  • [Copy] — Copy this specific response to clipboard
  • [Use] / [Replace] — Replace original selected text with this response

Option B: Dropdown selector

Add a dropdown next to "Copy as Markdown":

[Copy as Markdown ▼]
  ├── Copy Response 1
  ├── Copy Response 2
  └── Copy All

Option C: Click-to-select (minimal UI change)

  • Click on a response block to select it (highlight border)
  • "Copy as Markdown" copies the selected block
  • Add "Use Selected" button to replace text

Recommended Implementation (Option A)

# Pseudocode for response block widget
class ResponseBlock(QWidget):
    def __init__(self, response_text, index):
        self.text = response_text
        self.index = index
        
        # Layout
        self.copy_btn = QPushButton("📋")  # Copy icon
        self.use_btn = QPushButton("✓ Use")  # Replace text
        
        self.copy_btn.clicked.connect(self.copy_to_clipboard)
        self.use_btn.clicked.connect(self.replace_original_text)
    
    def copy_to_clipboard(self):
        QApplication.clipboard().setText(self.text)
    
    def replace_original_text(self):
        # Send this response back to replace selected text
        self.parent().apply_response(self.text)

Benefits

  1. Clarity — User always knows what will be copied/used
  2. Flexibility — Can choose any response, not just first/last
  3. Efficiency — One click to replace text with chosen version
  4. Consistency — Similar UX pattern used by ChatGPT, Claude, etc.

Additional Suggestion

Consider adding keyboard shortcuts:

  • Ctrl+1, Ctrl+2, etc. — Copy response N
  • Enter or Ctrl+Enter — Use/apply the last response

Environment

  • OS: Linux (Qubes OS 4.3, Debian 13)
  • Writing Tools version: v8
  • AI Provider: OpenAI

Thank you for this amazing tool! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions