Page MenuHomePhabricator

Copy-pasting from Numbers and some other apps both insert text and upload a file
Closed, ResolvedPublic

Description

Just copy some cells in Numbers or Excel then paste in a text area:

{F169078 size=full}

You get this:

1
2
3{F169080}

Event Timeline

swisspol raised the priority of this task from to Needs Triage.
swisspol updated the task description. (Show Details)
swisspol added a subscriber: swisspol.

I think it's because such apps put both text and image on the pasteboard.

(D9647 makes the image survive since that's easier, but maybe that's not desirable.)

I think it warrants more research: is it OS X only or other OSes too? Which apps typically put multiple data flavors into the pasteboard? Is there some "order" on the pasteboard accessible to JS?

In the examples I have encountered, I have seen multiple apps where I wanted to copy text and ended up paste text + image while I have yet to see an image app pasting both image + text.

PS: Here's another case where it happens: try coping a file in the Finder and pasting in Phabricator. Here again, I think text should win. If you want the icon, you copy the icon explicitly from the Info window.

If you think about it, an image app have no real reason to put text on the pasteboard: where would the text come from anyway?

Assume we can detect your OS and which application the data comes from. Do you want the text from the cells, the picture of the cells, or something else? What's your desired/expected behavior in this specific case, assuming we can do anything?

I think it would be a losing game to try to customize per OS or per app.

From what I have seen so far, having a basic heuristic like "if text is present, prefer it, otherwise if image is present, prefer it, otherwise, pick whatever (which is probably nothing since I'm not sure what other format is supported in text area?)".

I'm interested in your personal expectation of behavior, independent of implementation feasibility. I'm interested in understanding your expectation so I can maintain this feature in the long term, not so that I can choose the best implementation today.

For example, suppose only one behavior is actually possible today, and we select it based on technical feasibility, since it's the only thing we can actually do.

Then sometime next year someone sends me a diff to change the behavior, because the other behavior is now possible (since browsers have new capabilities, or they figured out some clever way to do things, or Numbers has changed its data format, or whatever else).

Should I accept the patch?

Knowing what's feasible today doesn't help me answer that question, but knowing what you personally expect would. I can also research what's technically possible at any time, but I can't necessarily ask you what you want a year from now if it didn't get written down in this task.

Understood and agreed. My answer was already addressing your question actually, but it wasn't clear, so let me rephrase it:

From what I have seen so far as a user, my expectation as a user would be to have things behave with this having a basic heuristic like "if text is present, prefer it, otherwise if image is present, prefer it, otherwise, pick whatever (which is probably nothing since I'm not sure what other format is supported in text area?)".

I think this would fix the cases I have seen so far: I have yet to see an image app that puts text on the pasteboard when copying an image. The problem is with some text apps putting images as well.

Another reason to prefer text to image as a user if both are present: if I really wanted the image, I can always drag & drop it to upload. I'm not sure how to fix things it's the text I wanted but the image keeps being pasted. Overall my guess is that it's way more likely you'll want the text if you have text + image on the pasteboard, as from what I have observed this only happens when coming from what is essentially a text app anyway (or at least not an image editing app for sure): Finder, Excel, Numbers...

One more example: try copy-pasting from Word. You get both image and text which really makes no sense for sure.

My expectation is you'd just get the text. I tried copy-paste from Word into a number of different Applications, and only Phabricator showed both Text and Images, everything else (even Google Docs/Chrome) showed just the text.

epriestley triaged this task as Normal priority.
epriestley added a project: Remarkup.