Skip to content

Conversation

Copy link

Copilot AI commented Nov 19, 2025

Adds a "Copy Result" button to the results page that copies the sorted list to clipboard in numbered format.

Changes

  • New component: CopyResultButton in app/sort/sort.tsx

    • Formats list as numbered items (1. Item\n2. Item...)
    • Shows "Copied!" feedback for 2s after click
    • Uses existing FullMobileButton styling with secondary variant
  • Icon additions: Added CopyIcon and CopyItemButton components for reusability

  • Placement: Button positioned between "Undo" and "Share this list" section in DoneLayout

Implementation

function CopyResultButton({ sorted }: { sorted: readonly string[] }) {
  const [copied, setCopied] = useState(false);

  const handleCopy = async () => {
    const text = sorted.map((item, index) => `${index + 1}. ${item}`).join("\n");
    await navigator.clipboard.writeText(text);
    setCopied(true);
    setTimeout(() => setCopied(false), 2000);
  };

  return (
    <FullMobileButton variant="secondary" onClick={handleCopy}>
      {copied ? "Copied!" : "Copy Result"}
    </FullMobileButton>
  );
}

Screenshot

Copy Result button on results page

Button shows "Copied!" feedback after click:

Copied feedback state

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/top5maker/top5maker/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)
    • Triggering command: next-server (v14.2.20) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add button for easy copying of result</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sort-star Ready Ready Preview Comment Nov 19, 2025 3:12am

Co-authored-by: Spacerat <141427+Spacerat@users.noreply.github.com>
Co-authored-by: Spacerat <141427+Spacerat@users.noreply.github.com>
Copilot AI changed the title [WIP] Add button for easy copying of result Add copy button for sorted results Nov 19, 2025
Copilot AI requested a review from Spacerat November 19, 2025 03:14
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 button for easy copying of result

2 participants