What are the limits or tunables for the amount of txt you can copy and paste?
- C@CmdrCody
What are the limits or tunables for the amount of txt you can copy and paste?
It looks to be rather small from what I can tell. I can't copy two pages of a configuration file without batching it into the paste command on the TP site with multiple selections. It would be even better if there was a preview or staging area for the pasted text so the TP site could batch the text in (if it even needed to). I am assuming I am hitting the (small) upper limit somewhere in the JavaScript which controls this paste functionality, but for my use case, it would be helpful for me to push say a larger volume of dictated txt from my local system to the target computer (one-way). This is tedious as of now, but useful for basic administration. For document creators, or people wanting to push entire .conf or ini data, it is extremely useful but rather annoying in its current implementation. I really like where it's going, though.
I am trying to understand the limits of the paste event in the TP app. I see the:
function onPaste(evt) { // Stop data actually being pasted into div evt.stopPropagation(); evt.preventDefault(); // Get pasted data via clipboard API const clipboardData = evt.clipboardData || window.clipboardData; pasteOverlay.dispatchEvent( new CustomEvent("paste-text", { detail: clipboardData.getData("Text"), bubbles: true, composed: true, }) ); hidePasteOverlay(); }
What are the upper limits of the clipboardData coming from windows. I can, for example, paste into a txt area on an online editor much more data than what TP sends over to the target. Is there any way to tune this? I'll keep digging in GitHub, as I am new to the project, but I thought I would stop and ask for some directions, and join the forums too ;).
- David @david2023-06-13 11:37:43.878Z
Hi @CmdrCody, thanks for your question about copy/paste on TinyPilot.
I've moved your two posts into their own thread and merged them since they were about the same topic.
I've just double-checked the paste functionality myself to check for an 'upper limit' and I found that pasting is a little inconsistent. I tested this by just pasting a larger block of text a few times and saw that the text cuts off at seemingly random points. Obviously this is a frustrating experience if you regularly paste larger blocks of text. I'm sorry about that. I don't know of any specific limitations here, so I'll dig deeper into this and see if there are any issues we're unaware of.
Your idea of a paste staging area is great! I can definitely see how it would be useful to see what you're about paste - especially if it's a larger block of text. We have an open GitHub issue to enhance the paste UI in a very similar way to your suggestion. You're welcome to subscribe for notifications on the issue if you'd like.
- In reply toCmdrCody⬆:David @david2023-06-13 12:35:58.378Z2023-06-13 13:04:34.168Z
I've just been informed that this inconsistent pasting behavior is a known issue. Unfortunately, we haven't done any extensive debugging for this. However, Michael suggests it could be unexpected behavior with websockets - rather than an issue with JS. I've added a comment to the issue to point to this thread.
In the meantime, you can continue to workaround this issue by batching the text you want to paste.