Skip to content

feature: Add share button for compare results #191

Description

@O2sa

Users should be able to share a completed comparison with others from the compare results page. The app already encodes compared usernames and selected languages in the query string, but the result dashboard only has a Copy Result action that copies the raw JSON payload instead of a shareable link.

Context

  • components/home-page-client.tsx updates the URL with username and selectedLanguage params when a comparison runs.
  • components/result-dashboard.tsx already has a result action area with a clipboard-based Copy Result button.
  • components/result-dashboard.tsx uses useSearchParams() to preserve comparison context for the methodology link, so the same URL context can be reused for sharing.
  • locales/en.json and locales/ar.json currently include copy-result labels but no share labels.

Tasks

  • Add a share button to the compare results action area in components/result-dashboard.tsx.
  • Build the share URL from the current origin/path and active comparison query params, including selected languages.
  • Use the Web Share API (navigator.share) when available, with a clipboard fallback for unsupported browsers.
  • Add localized labels, aria labels, and success/failure feedback for English and Arabic.
  • Verify the shared URL reloads the same comparison without requiring manual input.

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions