Skip to content

feat: ReplayWeb.page URL link #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2025
Merged

feat: ReplayWeb.page URL link #42

merged 4 commits into from
Jun 4, 2025

Conversation

nikitalokhmachev-ai
Copy link
Collaborator

@nikitalokhmachev-ai nikitalokhmachev-ai commented Jun 2, 2025

User description

Now, Copy Link and the share button copy the ReplayWeb.page URL link instead of a simple magnet url. #18


PR Type

Enhancement


Description

  • Replace magnet URI with ReplayWeb.page URL

  • Add REPLAY_BASE_URL constant for link generation

  • Update copy link functionality in multiple components


Changes walkthrough 📝

Relevant files
Enhancement
argo-shared-archive-list.ts
Update archive list to use ReplayWeb.page URLs                     

src/argo-shared-archive-list.ts

  • Import REPLAY_BASE_URL constant
  • Update _copyLink method to use ReplayWeb.page URL with encoded magnet
    URI
  • Replace direct magnet URI sharing with user-friendly replay URL
  • +7/-1     
    sidepanel.ts
    Update sidepanel to use ReplayWeb.page URLs                           

    src/sidepanel.ts

  • Import REPLAY_BASE_URL constant
  • Create replayLink variable with encoded magnetURI
  • Update clipboard copy and alert messages to use replayLink
  • +7/-3     
    Configuration changes
    consts.ts
    Add ReplayWeb.page base URL constant                                         

    src/consts.ts

  • Add REPLAY_BASE_URL constant pointing to Vercel deployment
  • Set URL to
    "https://replayweb-page-m-git-nikita-webtorrent-integration-monadical.vercel.app"
  • +2/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @pr-agent-monadical
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    18 - PR Code Verified

    Compliant requirements:

    • Create links to the replay viewer that can load content from torrents
    • Embed magnet links in URLs for direct loading from the user that shared it

    Requires further human verification:

    • Verify that the implementation correctly uses Webtorrent to seed WACZ files
    • Confirm that the replay viewer can properly load content from the torrent with the embedded magnet link
    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Hardcoded URL

    The REPLAY_BASE_URL is hardcoded to a development environment URL. This should be configurable or use a production URL before merging.

    export const REPLAY_BASE_URL =
      "https://replayweb-page-m-git-nikita-webtorrent-integration-monadical.vercel.app";
    Inconsistent Alert Message

    The alert message still refers to "Magnet link" even though the actual content is now a ReplayWeb.page URL. This could confuse users.

    alert(`Magnet link copied to clipboard:\n${replayLink}`);

    Comment on lines +6 to +7
    export const REPLAY_BASE_URL =
    "https://replayweb-page-m-git-nikita-webtorrent-integration-monadical.vercel.app";

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggestion: The hardcoded URL appears to be a development or staging environment. For production code, consider using a configuration variable or environment variable to make the base URL configurable across different environments. [general, importance: 7]

    Suggested change
    export const REPLAY_BASE_URL =
    "https://replayweb-page-m-git-nikita-webtorrent-integration-monadical.vercel.app";
    export const REPLAY_BASE_URL =
    process.env.REPLAY_BASE_URL || "https://replayweb.page";

    src/sidepanel.ts Outdated
    Comment on lines 500 to 509
    // Copy to clipboard
    navigator.clipboard
    .writeText(magnetURI)
    .writeText(replayLink)
    .then(() => {
    alert(`Magnet link copied to clipboard:\n${magnetURI}`);
    alert(`Magnet link copied to clipboard:\n${replayLink}`);
    })
    .catch((err) => {
    console.error("Failed to copy magnet link:", err);
    alert(`Magnet Link Ready:\n${magnetURI}`);
    alert(`Magnet Link Ready:\n${replayLink}`);
    });

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggestion: The alert message says "Magnet link copied" but you're actually copying a ReplayWeb.page URL. Update the message to accurately reflect what's being copied to avoid user confusion. [general, importance: 8]

    Suggested change
    // Copy to clipboard
    navigator.clipboard
    .writeText(magnetURI)
    .writeText(replayLink)
    .then(() => {
    alert(`Magnet link copied to clipboard:\n${magnetURI}`);
    alert(`Magnet link copied to clipboard:\n${replayLink}`);
    })
    .catch((err) => {
    console.error("Failed to copy magnet link:", err);
    alert(`Magnet Link Ready:\n${magnetURI}`);
    alert(`Magnet Link Ready:\n${replayLink}`);
    });
    // Copy to clipboard
    navigator.clipboard
    .writeText(replayLink)
    .then(() => {
    alert(`ReplayWeb.page link copied to clipboard:\n${replayLink}`);
    })
    .catch((err) => {
    console.error("Failed to copy ReplayWeb.page link:", err);
    alert(`ReplayWeb.page Link Ready:\n${replayLink}`);
    });

    Copy link
    Collaborator

    @Shrinks99 Shrinks99 left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Looks good! Added the tooltips to all relevant icon buttons in this PR too.

    @Shrinks99 Shrinks99 merged commit 76ef7b4 into main Jun 4, 2025
    0 of 3 checks passed
    @Shrinks99 Shrinks99 deleted the nikita-torrent-sharing branch June 4, 2025 00:45
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants