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
F14055525: D14851.diff
Sat, Nov 16, 12:47 PM
F14041961: D14851.diff
Mon, Nov 11, 11:14 PM
F14028964: D14851.id35901.diff
Fri, Nov 8, 6:30 PM
F14028398: D14851.diff
Fri, Nov 8, 1:07 PM
F14000755: D14851.id35902.diff
Fri, Oct 25, 12:30 AM
F13996114: D14851.id35901.diff
Wed, Oct 23, 6:08 PM
F13956036: D14851.diff
Oct 14 2024, 4:01 AM
Unknown Object (File)
Sep 26 2024, 7:20 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.