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)
Mon, Mar 4, 7:41 PM
Unknown Object (File)
Fri, Mar 1, 3:54 AM
Unknown Object (File)
Wed, Feb 21, 11:44 AM
Unknown Object (File)
Feb 3 2024, 6:46 PM
Unknown Object (File)
Feb 3 2024, 6:46 PM
Unknown Object (File)
Feb 3 2024, 6:46 PM
Unknown Object (File)
Jan 22 2024, 8:34 AM
Unknown Object (File)
Jan 17 2024, 10:21 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