Skip to content

[Feature] Shareable comparison and player links #15

@grovecj

Description

@grovecj

Summary

Generate shareable URLs for player stats and comparison views so users can share results with friends.

Details

URL Structure

  • Player stats: /player/{platform}/{gamertag} (already routable)
  • Comparison: /compare?p=uno:player1,xbl:player2,psn:player3
  • Squad view: /squad/{squadId}

Share Features

  • Copy link button on player stats page and comparison page
  • Uses navigator.clipboard.writeText() with fallback
  • Naive UI notification confirming "Link copied!"
  • URL updates reactively as players are added/removed from comparison

Router Integration

  • Comparison page reads p query param on mount, parses players, fetches stats
  • Player add/remove updates the URL query params (using router.replace)
  • Browser back/forward works correctly with comparison state

Acceptance Criteria

  • Copy link button on stats and comparison pages
  • Comparison URL encodes all selected players
  • Opening a shared comparison URL loads all players correctly
  • Browser history navigation works with comparison state

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions