Skip to content

add(KDE Connect): KDE Connect in Raycast #18928

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

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

StevenRCE0
Copy link
Contributor

@StevenRCE0 StevenRCE0 commented May 3, 2025

Description

Added KDE Connect for Raycast, with these functions available:

  • List and (un)pair devices
  • Send file(s)/text/URL to devices
  • Send SMS (untested)
  • Add SMS attachments
  • Ping devices

This revived #6182 which stalled due to the very unstable builds of KDE Connect at that time.

Screencast

Screenshot 2025-05-03 at 18 55 02

Checklist

@raycastbot raycastbot added the new extension Label for PRs with new extensions label May 3, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR introduces KDE Connect integration for Raycast, enabling device management and content sharing between KDE-connected devices through Raycast's interface.

  • The executeCommand function in device.ts needs error handling improvement as it resolves with stdout even on errors
  • The sendFiles method in device.ts should await executeCommand promises to prevent race conditions
  • Missing metadata folder with screenshots despite having view commands in package.json (see Raycast Documentation)
  • The List component in index.tsx should use isLoading state to avoid empty state flicker
  • Shell command execution in device.ts lacks input validation for paths and strings, posing potential security risks

3 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

StevenRCE0 and others added 4 commits May 3, 2025 19:00
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR continues to develop the KDE Connect integration for Raycast, with several important changes since the last review.

  • Fixed race condition in sendFiles by properly awaiting executeCommand promises in device.ts
  • Added proper error handling in executeCommand to reject instead of resolving with stdout on errors
  • Implemented isLoading state management in the main List component to prevent empty state flicker
  • Added error handling for device availability checks and device ID validation
  • The showFailureToast utility should be used in the submitAction catch block for consistent error handling

Note: The metadata folder with screenshots is still missing despite having view commands in package.json. This needs to be addressed before the PR can be merged.

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR continues to refine the KDE Connect integration for Raycast, focusing on error handling and device management improvements.

  • Added input validation and security checks for paths and strings in device.ts command execution
  • Implemented showFailureToast from @raycast/utils in error handling blocks for consistency
  • Added metadata folder with screenshots for view commands as required by Raycast guidelines
  • Fixed error handling in executeCommand to properly reject on stderr output
  • Improved device availability checks with proper error states and loading indicators

Note: The PR is now addressing most previous review points but still needs to ensure all error handling uses showFailureToast consistently throughout the codebase.

4 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR update focuses on improving error handling and promise management in the KDE Connect device management code.

  • The executeCommand in device.ts still needs to use showFailureToast from @raycast/utils in the error rejection case for consistent error handling
  • The error message "Command exection error" has a typo and should be "Command execution error" in device.ts
  • The listDevices method in device.ts should handle promise rejection cases explicitly rather than only using resolve
  • The 2> /tmp/kde-connect-raycast.log stderr redirection in executeCommand should be handled more gracefully with proper error logging
  • The deviceID type should be more strictly typed than optional string to prevent undefined checks throughout the code

Note: Previous major issues like metadata folder, loading states, and race conditions have been addressed. These remaining points focus on code quality improvements.

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR continues to refine the KDE Connect integration with Raycast, focusing on error handling and device management.

  • The tryCommand function in index.tsx should use showFailureToast from @raycast/utils instead of manual showToast construction for error handling
  • The SendData interface in index.tsx should have destination marked as required for SMS type to prevent potential undefined errors
  • The textField function's switch statement should include a default case to handle all possible SendType values
  • The submitAction function in index.tsx should handle promise rejections more explicitly with proper error types
  • The TODO comment about implementing all types should be removed or replaced with specific implementation tasks

Note: Most major issues from previous reviews have been addressed. These points focus on improving code quality and type safety.

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR update focuses on error handling and device management in the KDE Connect integration code, particularly in device.ts.

  • The executeCommand function should handle stderr redirection more robustly instead of writing to a fixed /tmp path
  • The isAvailable method in device.ts has nested promise chains that could be simplified using async/await
  • The error message "Command exection error" in device.ts line 21 contains a typo and should be "execution"
  • The deviceID type should be more strictly typed to avoid optional checks throughout the code

Note: Most major issues from previous reviews have been addressed. These remaining points focus on code quality improvements.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR continues to improve the KDE Connect integration, focusing on core functionality in connector.ts and index.tsx.

  • The startApp function in connector.ts has a potential memory leak with the setInterval that never gets cleared
  • The appPath string concatenation in connector.ts should use path.join for better cross-platform compatibility
  • The sendSms function in connector.ts needs proper escaping for attachment paths containing spaces or special characters
  • The appReady function in connector.ts should implement a timeout to prevent hanging indefinitely
  • The KDECFunctions type definitions in connector.ts should be more strictly typed for better type safety

Note: Previous major issues like error handling, metadata folder, and loading states have been addressed. These points focus on improving code reliability and maintainability.

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

StevenRCE0 and others added 3 commits May 3, 2025 19:57
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR continues to refine the KDE Connect integration, focusing on the send functionality and error handling in send.tsx.

  • The getSelectedText() usage in send.tsx needs error handling to gracefully handle selection failures
  • The sendFiles loop in send.tsx should show progress for each file being sent rather than just the current filename
  • The testURL function in send.tsx should use a more robust URL validation approach than try-catch
  • The sendContent variable in send.tsx should be more strictly typed to match its possible content types
  • The error handling in send.tsx should use showFailureToast from @raycast/utils instead of manual toast construction

Note: Previous major issues around error handling, metadata, and device management have been addressed. These points focus on improving the send functionality's robustness and user experience.

4 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile

StevenRCE0 and others added 4 commits May 3, 2025 20:04
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR continues to improve the KDE Connect integration, focusing on error handling and user experience in send.tsx.

  • The getSelectedText() call in send.tsx should be wrapped in a try-catch block with showFailureToast for consistent error handling
  • The showToast error handling in send.tsx should be replaced with showFailureToast from @raycast/utils for consistency
  • The launchCommand function in send.tsx should be wrapped in a try-catch block to handle potential errors
  • The List component in index.tsx should use isLoading to avoid empty state flicker
  • The metadata folder with screenshots is still needed for the view commands in package.json

Note: Previous improvements to device management, error handling, and type safety have been implemented. These remaining points focus on aligning with Raycast's best practices and improving error handling consistency.

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR update focuses on the core device management functionality in device.ts, with several remaining issues to address.

  • The executeCommand function's stderr redirection to /tmp/kde-connect-raycast.log should be handled more securely, preferably using Node's built-in error handling
  • The listDevices method uses a nested promise chain that could be simplified with async/await for better readability
  • The deviceID type should be changed from optional string to a required string with explicit null checks where needed
  • The error message "Command exection error" in device.ts line 21 still contains a typo and should be "execution"

Note: Most major issues from previous reviews have been addressed. These remaining points focus on improving code quality and error handling robustness.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration, here's my review:

This PR update focuses on improving the send functionality in send.tsx, with several important issues to address.

  • The getSelectedText() call in send.tsx should be wrapped in a try-catch block with showFailureToast for error handling
  • Multiple showToast error handling instances should be replaced with showFailureToast from @raycast/utils for consistency
  • The testURL function should use a more robust URL validation approach than a simple try-catch
  • The sendContent variable should be more strictly typed to match its possible content types
  • The List component should use isLoading to avoid empty state flicker

Note: Previous improvements to device management and error handling have been implemented. These points focus on improving code quality and user experience in the send functionality.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes to the KDE Connect integration in send.tsx, here's my review:

This PR continues to refine the send functionality in the KDE Connect integration, focusing on error handling and content sharing.

  • The startApp call in send.tsx should use showFailureToast from @raycast/utils instead of manual toast construction
  • The getSelectedText() call needs to be wrapped in a try-catch block with proper error handling
  • The launchCommand function should be wrapped in a try-catch block as per Raycast guidelines
  • The error handling for device availability should be more descriptive with specific error messages
  • The switch statement for sending different content types could be simplified to reduce code duplication

Note: Previous improvements to device management, metadata, and type safety have been implemented. These points focus on improving error handling consistency and code organization.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants