Page MenuHomePhabricator

Don't select {F...} text after adding it to textareas
ClosedPublic

Authored by epriestley on Dec 22 2015, 3:51 PM.
Tags
None
Referenced Files
F13325302: D14851.diff
Sat, Jun 15, 1:39 AM
F13312800: D14851.diff
Tue, Jun 11, 7:10 AM
F13299233: D14851.diff
Fri, Jun 7, 7:48 AM
F13282589: D14851.diff
Sun, Jun 2, 12:15 PM
F13257929: D14851.id35901.diff
Sun, May 26, 5:33 AM
F13224368: D14851.id35901.diff
Sun, May 19, 8:05 AM
F13211590: D14851.diff
May 17 2024, 5:54 AM
F13211231: D14851.diff
May 17 2024, 5:35 AM
Subscribers
None

Details

Summary

Fixes T10039. We add text to textareas in two cases:

  • Users clicking assitance buttons in Remarkup text areas.
  • Drag-and-drop file uploads.

In case (1), it makes sense to highlight the text (it shows the user what we inserted, and lets them undo the action easily if it isn't what they wanted).

In case (2), it does not. Users almost never want to delete or edit a file reference. It is slightly nice to have the reference as a visual callout, but I don't think this is a big deal.

Change the behavior so that we highlight only for remarkup buttons, not for drag-and-drop files.

Test Plan
  • Clicked an "isnert quote" button on remarkup assist area, got highlighted example text.
  • Dragged and dropped a file, got text inserted with no highlight.

Diff Detail

Repository
rP Phabricator
Branch
upload1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9721
Build 11665: Run Core Tests
Build 11664: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Don't select {F...} text after adding it to textareas.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.

There's a small behavioral change here: uploading multiple files no longer puts newlines between them. That seems OKish? Maybe we should insert {F...}\n?

Actually, let me just put that old behavior back for now, since it's probably a little better than {F...}{F...}.

webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
17–23

This was also hacking around the old behavior, so it's nice to get rid of it.

  • When uploading a bunch of files, drop them in with lines between them so they look a little nicer.
chad edited edge metadata.
This revision is now accepted and ready to land.Dec 22 2015, 4:20 PM
This revision was automatically updated to reflect the committed changes.