Skip to content

Copy pr/merge error directly into message #294

@idofrizler

Description

@idofrizler

Problem

When there's a red error message in the push/commit modal, users have to manually copy the error. Should be one-click to copy error into chat for debugging.

Priority

🟢 P3 | Quick win | ~1 hour

Implementation Details

Add Copy Button Next to Error

{error && (
  <div className="text-red-500 flex items-center gap-2">
    <span>{error}</span>
    <button 
      onClick={() => copyErrorToChat(error)}
      className="text-xs underline"
    >
      Ask Cooper about this
    </button>
  </div>
)}

Copy and Navigate Function

const copyErrorToChat = (error: string) => {
  // Close the modal
  setModalOpen(false);
  
  // Set the chat input with context
  const context = `I got this error while trying to push/commit:

\`\`\`
${error}
\`\`\`

Can you help me fix this?`;
  
  setInputValue(context);
  // Focus the input
  inputRef.current?.focus();
};

Files to Modify

  • Commit/Push modal component (likely in src/renderer/components/)
  • May need to lift state or use context for setInputValue

Acceptance Criteria

  • Small button appears next to error messages
  • Clicking closes modal and pastes error to chat
  • Chat input is focused, ready to send

Metadata

Metadata

Assignees

No one assigned

    Labels

    quick-winSmall fix, <1 hour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions