Page MenuHomePhabricator

Use pseudoelements, not Zero Width Space, to implement copy/paste behavior in Paste/Diffusion
ClosedPublic

Authored by epriestley on Apr 11 2018, 9:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 11:41 PM
Unknown Object (File)
Thu, Dec 19, 9:24 AM
Unknown Object (File)
Mon, Dec 16, 6:46 PM
Unknown Object (File)
Sun, Dec 15, 4:46 PM
Unknown Object (File)
Fri, Dec 6, 1:57 PM
Unknown Object (File)
Fri, Nov 22, 11:53 AM
Unknown Object (File)
Fri, Nov 22, 6:34 AM
Unknown Object (File)
Oct 22 2024, 5:58 AM
Subscribers
None

Details

Summary

Depends on D19348. Ref T13105. When copying text from Paste or Diffusion, we'd like to copy only source, not line numbers.

We currently accomplish this with zero-width spaces plus a trigger that fires on "copy" in Paste and Diffusion. This is quite gross.

In the new-style Harbormaster logs, we use an approach that seems slightly better: CSS psuedoelements.

This isn't a complete solution (see also PHI504 / T5032) but puts us in a slightly better place.

Use it in Paste/Files/Diffusion too.

This gives us good behavior in all browsers in Files and Paste.

This gives us good behavior in Chrome and Firefox in Diffusion. Safari will copy (but not visually select) blame information in Diffusion. I think we can live with that for now.

Test Plan

Selected and copy/pasted stuff in Diffusion, Files, and Paste. Got good behavior everywhere except Safari + Diffusion.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable