Skip to content

feat(desktop): enhance sharing functionality with title and description #3462

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 1 commit into from
Apr 11, 2025

Conversation

kovsu
Copy link
Contributor

@kovsu kovsu commented Apr 11, 2025

Before:

CleanShot 2025-04-11 at 10 44 55

After:

CleanShot 2025-04-11 at 10 38 43

@follow-reviewer-bot
Copy link

Thank you for your contribution. We will review it promptly.

Copy link

vercel bot commented Apr 11, 2025

@kovsu is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

@follow-reviewer-bot
Copy link

Suggested PR Title:

feat: enhance sharing functionality with title and description

Change Summary:
Added sharing support with title and description for web.

Code Review:

Code Review

File: apps/desktop/src/renderer/src/modules/command/commands/entry.tsx

  1. [Line 277] - Validation for navigator.share Inputs:

    • navigator.share expects specific data types for the title, text, and url fields. There is no validation to handle cases where entry.entries.title, entry.entries.description, or entry.entries.url are not of type string or could potentially be invalid. This could result in runtime errors or unexpected behavior.
    • Recommendation: Ensure that all inputs to the navigator.share method are properly validated before passing. For example:
      if (navigator.share && typeof entry.entries.url === 'string') {
        navigator.share({
          title: typeof title === 'string' ? title : undefined,
          text: typeof description === 'string' ? description : undefined,
          url: entry.entries.url,
        });
      }
  2. [Line 277-279] - Missing Error Handling for navigator.share:

    • The navigator.share method returns a Promise and can raise an exception if the share action is unsuccessful or unsupported. Currently, there is no error handling in place for this operation.
    • Recommendation: Add proper error handling to capture and log/share feedback in case the navigator.share method fails. For example:
      if (navigator.share && typeof entry.entries.url === 'string') {
        navigator
          .share({
            title: typeof title === 'string' ? title : undefined,
            text: typeof description === 'string' ? description : undefined,
            url: entry.entries.url,
          })
          .catch((error) => {
            console.error('An error occurred while sharing:', error);
          });
      }

Summary

The above issues require attention to ensure code robustness and to avoid potential runtime exceptions or failures. Please address these changes before merging the PR.

@hyoban hyoban enabled auto-merge (squash) April 11, 2025 02:49
@hyoban hyoban merged commit 4b91807 into RSSNext:dev Apr 11, 2025
4 of 6 checks passed
@follow-reviewer-bot
Copy link

Thank you for your contribution! 🎉

Your pull request has been merged and we really appreciate your help in making this project better. We hope to see more contributions from you in the future! 💪

@kovsu kovsu deleted the feat/share branch April 11, 2025 02:55
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.

2 participants