[wp-trac] [WordPress Trac] #28307: Ajax for Post Search

WordPress Trac noreply at wordpress.org
Sun Jun 1 02:10:20 UTC 2014


#28307: Ajax for Post Search
-----------------------------------+-------------------------
 Reporter:  adamsilverstein        |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  4.0
Component:  Administration         |     Version:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch ux-feedback  |     Focuses:  javascript
-----------------------------------+-------------------------

Comment (by adamsilverstein):

 Thanks for the excellent technical feedback. Your explanation of why to
 use wp_send_json_error(); makes perfect sense. Can you expand on the JS
 workaround needed for non-Latin?

 I guess I agree with your UX criticism (to a point - until it makes search
 more productive). You are right - this is 'find a post to edit', not quite
 the same as what the search does, though maybe one of the biggest uses of
 the post list screen? Maybe this is more plugin territory for now.

 I was trying to keep it simple - ultimately I'd love to see a completely
 Backbone-built list view, and in that the entire list would update 'live'
 as you typed, showing the same results you now see when clicking 'Search',
 so a live search view. What do you think?

 Thanks again for the feedback!

 Replying to [comment:17 azaozz]:
 > IMHO having autocomplete on a search field feels a bit confusing as UX.
 It overrides the purpose of that field "find posts containing [term] and
 display them on the screen".
 >
 > Autocomplete (auto-find) would work better if this was "Find a post to
 edit" field, not "search posts". It would still be harder to use as it
 misses some information about the post like status (published, draft,
 pending...), date, author, etc.
 >
 > As a technical implementation it looks good. Perhaps better to keep the
 `strlen()` instead of `mb_strlen()` and increase the minimum to 3 chars
 for "non-Latin" languages? Generally `strlen()` will return the length in
 bytes, so the search string can contain 3 ASCII chars or 1-2 "higher"
 UTF-8 chars. This may need a workaround in JS too.
 >
 > Also, as UI Autocomplete always expects JSON response, we should be
 using `wp_send_json_error();` instead of `wp_die()` to prevent
 jQuery.parseJSON warnings.

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


More information about the wp-trac mailing list