[wp-trac] [WordPress Trac] #44588: Denote the Copy action is complete by updating the Copy button to state 'Copied'

WordPress Trac noreply at wordpress.org
Thu Jan 23 22:51:01 UTC 2020


#44588: Denote the Copy action is complete by updating the Copy button to state
'Copied'
-------------------------------------------------+-------------------------
 Reporter:  garrett-eclipse                      |       Owner:  garrett-
                                                 |  eclipse
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.4
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots needs-     |     Focuses:
  testing                                        |  administration
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * keywords:  has-patch has-screenshots needs-testing dev-feedback 2nd-
     opinion => has-patch has-screenshots needs-testing
 * status:  assigned => accepted


Comment:

 Thanks @nickylimjj  & @xkon for the work here. Sorry my suggestion to
 adopt ClipboardJS didn't pan out. I appreciate you both delving into it
 fully before abandoning that approach. I agree after testing those patches
 the clipboard contents was never really up to par with what we had
 originally so am all onboard with the current direction.

 In [https://core.trac.wordpress.org/attachment/ticket/44588/44588.7.diff
 44588.7.diff] I've made a minor refresh to re-apply some changes from my
 [https://core.trac.wordpress.org/ticket/44588#comment:17 comment:17]
 mainly;
 - Cleanup JS variable creation.
 - Cleanup PHP for coding standards on indentation.
 - In the PHP removed unneeded variable instantiations when they are
 strings only being used a single time.

 I also updated the copy action to introduce a `setTimeout` in order to
 dismiss the `Copied!` text after 3 seconds. This is so when coming back to
 a used button and clicking copy again we get the feedback. When we didn't
 dismiss the text  any additional clicks don't receive that visual feedback
 and so aren't sure if the action completed. Demo;
 [[Image(https://core.trac.wordpress.org/raw-
 attachment/ticket/44588/eefc573b39676dddd47856849123463d.gif)]]

 This feels good to go to me but I don't want to mark my own patch for
 `commit`, could either of you (@nickylimjj or @xkon) give my latest patch
 a once over and test and we'll put our stamp of approval on this. My
 tests, CS checks and PHPUnit tests all ran green.

 Sidenote: While testing with some plugins such as WooCommerce I noticed
 they were still using the old `.wp-policy-help` class which resulted in
 their help/tutorial text being included in the copy content. To address
 this I opened [https://core.trac.wordpress.org/ticket/49282 49282]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44588#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list