tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
2.99k stars 250 forks source link

Consume paste API endpoint #1626

Closed jdeanwallace closed 11 months ago

jdeanwallace commented 11 months ago

Resolves https://github.com/tiny-pilot/tinypilot/issues/1026

This PR consumes the new /api/paste endpoint and removes the, now-unused, text-to-keystroke frontend logic.

Demo video:

https://github.com/tiny-pilot/tinypilot/assets/6730025/2b3cb2c9-964b-4e90-88c9-7ab13775f02b

Notes

  1. Pasting unsupported characters (i.e., , , (en-dash), (em-dash), etc.) now displays this error dialog:

    Screen Shot 2023-09-15 at 11 20 21

    Previously, these unsupported characters were silently ignored during a paste. As discussed here, we plan to further refine this behavior in the future.

Peer testing

This PR is stacked onto the following PRs:

You can test them all on device via the following command:

curl \
  --silent \
  --show-error \
  --location \
  https://raw.githubusercontent.com/tiny-pilot/tinypilot/master/scripts/install-bundle | \
  sudo bash -s -- https://output.circle-artifacts.com/output/job/d842ed53-55a6-490d-9cfd-842155c7d6e5/artifacts/0/bundler/dist/tinypilot-community-20230919T1127Z-1.9.1-39+3e308b3.tgz && \
  sudo reboot

Review on CodeApprove

jdeanwallace commented 11 months ago
Automated comment from CodeApprove ➜

⏳ @jotaen4tinypilot please review this Pull Request

jdeanwallace commented 11 months ago

@db39 - Could you please test the "Paste" functionality of this PR on a device while using a laptop or desktop computer as a target machine?

Jan experienced some mismatching/missing characters during a paste, but I'm unable to reproduce it. We think it might be because he's using a lower-powered target machine. If this PR works for a regular target machine, then it should be safe to merge.

You can use this text for copy/pasting and the following command to install the bundle:

curl \
  --silent \
  --show-error \
  --location \
  https://raw.githubusercontent.com/tiny-pilot/tinypilot/master/scripts/install-bundle | \
  sudo bash -s -- https://output.circle-artifacts.com/output/job/a4949eb7-1dba-4f2e-a059-e5c3d8b817e7/artifacts/0/bundler/dist/tinypilot-community-20230915T0920Z-1.9.1-23+24ca079.tgz && \
  sudo reboot
mtlynch commented 11 months ago

We think it might be because he's using a lower-powered target machine. If this PR works for a regular target machine, then it should be safe to merge.

I'd like for the dev team to dig into this further before merging. Pasting incorrect text is a step down from the currently-released behavior of stopping after too many characters.

@db39 - Hold off on testing this.