Posted by willm 9 hours ago
But no. Your text editor is a cottage surrounded by an outdoors it doesn't control. It makes no more sense to try to take charge of the clipboard than of a flock of geese flying overhead. What if someone or some other app pasted something in between? Paste is an arrow shot, a message in a bottle.
It's true that cut and paste reflows text twice (once on cut and once on paste), but it does so in the place where your eyes are already looking. Ghost cut reflows only once (on paste), but it does so in a place where I'm not already looking. I find this much more confusing based on the video.
> Cut & Paste is not atomic
Neither is ghost cut, because if you only cut you're left with grey text as an intermediate state.
> Cut is undoable
...this is the part I agree with, and it seems trivially fixable. If you undo a `cut`, put back whatever was on the clipboard beforehand.
I think it would be confusing if only one app did it, but if an OS decided to implement this system wide, I think it would be a good improvement.
You could also make `copy` possible to undo, but I think that would be weirder since there's no visible effect of your undo action.
“Ghost cut” can work across apps with reasonable undo support by not using the clipboard at all and some form of IPC instead. For example, when you cut from app B before resolving the cut from app A, app A could be notified to cancel its cut.
I think this is much less intuitive than the current convention though.
...right, thanks. So you could still make it work but you'd definitely need OS support, it's not something one app can fix.
Edit: You could make this work on an app level by checking if the contents of the user's clipboard is still the value they cut. If yes, revert to whatever clipboard contents you saved prior to the cut. Otherwise do nothing.
It's probably too much hidden behavior to be a good idea, but I think it would match what the user wants in 99% of cases.
edit: Yeah, the problem is that the user does not expect undo to do something different depending on what they did on a different program.
Undo doing nothing to the clipboard always is more consistent and the better UX.
TFA and comments are clearly a solution is search of the problem.
When you paste, X or Wayland lets the source application communicate with the destination application to send the image over.
You’ll likely always have a very simple clipboard manager that stores a single copy of the clipboard so you don’t rely on the source application staying alive.
Clipboard managers are free to store the clipboard anywhere.
This is why copy and paste is broken for so many years, because devs at these beautiful companies, decided to let you wipe your end-user's clipboard when chatInputText.length === 0 or whatever. I noticed people having consistent issues with copy and paste when Teams became more prevalent, and it made no sense, until I realized.
If you work for one of these chat companies, for the love of GOD make an internal ticket, this is embarrassing.
The deeper underlying problem is that we treat arbitrary UI/UX implementations as objective truth. There is one decided way your computer can be interacted with, and you the user must accommodate it. This is what I want to change.
issue here: https://github.com/anomalyco/opencode/issues/13984
ALWAYS default to regular behavior unless it's something you know exactly is going to go correctly.
On anything structured that doesn't require re-flow this approach makes some sense.
Lists, Grids, etc, there are pro/cons but it makes sense.
In this case you ARE causing reflow, so content and format change at the same time.
With normal cut and paste the reflow happens at the point of attention, and the final state paste keeps your eye right at the point of action.
This jumping around stuff means you are doubley losing tracking if you paste below the cut point. This is effectively an out of bound focus shift. This has higher cognitive penalty because layout is no longer occurring in serial but in parallel in multiple places.
idempotence, types, rejection of global state, all of these "engineering" rules go out the window when you enter the realm of mereological nihilism that is text editing.
The best you can do it think of things as causal chains like some CRDTs do.