Skip to content
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

Adding clipboard support #457

Merged
merged 7 commits into from
Apr 3, 2024
Merged

Adding clipboard support #457

merged 7 commits into from
Apr 3, 2024

Conversation

daonb
Copy link
Contributor

@daonb daonb commented Apr 3, 2024

  • Releasing 1.9.2 to the store
  • Supporting clipboard copy
  • Adding support for clipboard images

Summary by CodeRabbit

  • New Features
    • Added support for webexec clipboard commands, sending logs to the server, increased scrollback lines setting, PWA installation offer for first-time users, custom SSH port option.
  • Bug Fixes
    • Addressed reconnect failures, endless loops, flickering displays, and lazyvim issues.
  • Documentation
    • Added a troubleshooting page on the dev site.
  • Refactor
    • Modified imports, error handling, session management, message handling in various classes.
  • Chores
    • Updated lint script, Docker Compose configuration, and Node version in GitHub workflows.
  • Tests
    • Introduced new test cases and removed outdated functionality in test scripts.

Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for dazzling-kringle-090742 ready!

Name Link
🔨 Latest commit 5953b1d
🔍 Latest deploy log https://app.netlify.com/sites/dazzling-kringle-090742/deploys/660d377bda7fa100096e2bfa
😎 Deploy Preview https://deploy-preview-457--dazzling-kringle-090742.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

coderabbitai bot commented Apr 3, 2024

Warning

Rate Limit Exceeded

@daonb has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 28 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between e3ef270 and 5953b1d.

Walkthrough

This update brings a variety of improvements and fixes across different aspects of the application. It includes support for new webexec clipboard commands, enhanced logging capabilities, UI enhancements for Terminal7, and the addition of a PWA installation offer for first-time users. Additionally, there are updates such as custom SSH port options, troubleshooting documentation on the dev site, and various fixes addressing reconnect failures, display issues, and performance optimizations.

Changes

Files Change Summary
CHANGELOG.md Added support for webexec clipboard commands, enhanced logging, PWA installation offer, custom SSH port option, troubleshooting page.
index.html Added cache control meta tag, deferred script loading, updated version number.
package.json Updated lint script.
src/commands.ts Updated editCMD to use ControlMessage for admin commands.
src/gate.ts Modified imports, error handling, session management, message handling in Gate class.
src/peerbook.ts Modified imports, type declarations, method signatures in PeerbookConnection class.
src/session.ts Updated method return types in Channel and Session interfaces, BaseChannel and BaseSession classes.
src/ssh_session.ts Added a new line, modified return types in HybridSession class.
src/webrtc_session.ts Updated classes, methods, and imports related to ControlMessage, WebRTCChannel, WebRTCSession, PeerbookSession, HTTPWebRTCSession.
tsconfig.json Specifies TypeScript configuration for the project.

🐰✨
In the land of code and byte,
Where changes merge both day and night,
A rabbit hopped with sheer delight,
For Terminal7's latest flight.
🌟 With bugs now fixed, and features bright,
It's smoother sailing, oh so right!
🚀🐾

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for terminal7 ready!

Name Link
🔨 Latest commit 5953b1d
🔍 Latest deploy log https://app.netlify.com/sites/terminal7/deploys/660d377b8a611d0008fab845
😎 Deploy Preview https://deploy-preview-457--terminal7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 15

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0dc2939 and e3ef270.
Files ignored due to path filters (1)
  • ios/App/Podfile.lock is excluded by !**/*.lock
Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • index.html (1 hunks)
  • package.json (2 hunks)
  • src/commands.ts (3 hunks)
  • src/gate.ts (4 hunks)
  • src/peerbook.ts (7 hunks)
  • src/session.ts (4 hunks)
  • src/ssh_session.ts (2 hunks)
  • src/webrtc_session.ts (10 hunks)
  • tsconfig.json (1 hunks)
Files skipped from review as they are similar to previous changes (8)
  • index.html
  • package.json
  • src/commands.ts
  • src/gate.ts
  • src/peerbook.ts
  • src/session.ts
  • src/ssh_session.ts
  • tsconfig.json
Additional comments not posted (2)
src/webrtc_session.ts (2)

9-28: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [25-51]

The updates to the WebRTCChannel class, including the nullable dataChannel property and the refactored resize method, are correctly implemented and align with the new ControlMessage usage.


400-407: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [403-430]

The updates to the PeerbookSession class, including improved logging and error handling, as well as the use of ControlMessage objects, are correctly implemented and enhance the class's functionality.


### Added

- support for webexec clipboard commands, e.g. use `webexec copy < file.txt` to copy a file to the client's clipboard
Copy link

Choose a reason for hiding this comment

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

Consider rephrasing the description of the webexec clipboard commands for clarity.

- - support for webexec clipboard commands, e.g. use `webexec copy < file.txt` to copy a file to the client's clipboard
+ - Added support for webexec clipboard commands. For example, `webexec copy < file.txt` copies the content of `file.txt` to the client's clipboard.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- support for webexec clipboard commands, e.g. use `webexec copy < file.txt` to copy a file to the client's clipboard
- Added support for webexec clipboard commands. For example, `webexec copy < file.txt` copies the content of `file.txt` to the client's clipboard.

CHANGELOG.md Outdated Show resolved Hide resolved
src/webrtc_session.ts Outdated Show resolved Hide resolved
src/webrtc_session.ts Outdated Show resolved Hide resolved
Comment on lines +1 to 6
import { CapacitorHttp, HttpHeaders } from '@capacitor/core'
import { BaseChannel, BaseSession, Channel, ChannelID, Failure, Marker } from './session'
import { IceServers } from "./terminal7"
import { ServerPayload } from "./gate"

type ChannelOpenedCB = (channel: Channel, id: ChannelID) => void
type RTCStats = {
Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [497-497]

Add error handling in the sendOffer and sendCandidate methods of the HTTPWebRTCSession class to ensure robustness in case of failures during the offer or candidate sending process.

+ try {
    CapacitorHttp.post({
        url: this.address, 
        headers: headers,
        readTimeout: 3000,
        connectTimeout: 3000,
        data: offer.sdp,
    }).then(response => {
        // Existing code...
    }).catch(error => {
        terminal7.log(`FAILED: POST to ${this.address} with ${JSON.stringify(this.headers)}`, error)
        if (error.message == 'unauthorized')
            this.fail(Failure.Unauthorized)
        else
            this.fail(Failure.NotSupported)
    })
+ } catch (e) {
+     terminal7.log(`Exception during sendOffer: ${e}`);
+ }

@daonb daonb merged commit 5953b1d into tuzig:master Apr 3, 2024
9 checks passed
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.

1 participant