Feature: Autocomplete/dropdown or any other assisted input with generic conditionals #42

Open
rinatkhaziev opened this Issue Jun 28, 2012 · 11 comments

3 participants

@rinatkhaziev

Per @jeremyfelt:
it would be cool if we could modify the input fields for each conditional either through filters or just by default. For example – If is_category() is selected as the conditional, a drop down list of existing categories would be more pleasant than a text field.

@jeremyfelt

I started tackling this last night and made some decent progress. I'm going to try and have it ready for some testing by next week.

@jeremyfelt jeremyfelt was assigned Oct 18, 2012
@danielbachhuber

Cool, assigned this to you and the v0.3 milestone

@danielbachhuber

@jeremyfelt still want to try to swing this for v0.4?

@jeremyfelt

This got pretty ugly pretty quick. I'm guessing it's a no go for v0.4, but deserves future thought. I'll take a peek soon.

@jeremyfelt

Brainstorming here... Ignoring quick edit for the moment, just focusing on new ad code.

  1. Check a JS global for options to prefill when onchange of acm-conditionals[] select field is triggered
  2. If the JS global has a matching key - is_category - replace the acm-arguments[] input field with a select menu
  3. Loop through the matching key's array in the JS global to build the possible selections in acm-arguments[]

So...

  • This seems straight forward at first, but what if you're working with is_tag as your conditional and have 70,000 tags?
  • Rather than a new select menu, we can use jQuery UI's chosen to corral a massive list.
  • Generating the massive list would be expensive, though we are in the admin. Would an ajax search interface make sense instead?
  • Would it make more sense as a filter that let themes or providers decide what should show?

See, ugly. :)

Thoughts @danielbachhuber @rinatkhaziev?

@rinatkhaziev

This seems straight forward at first, but what if you're working with is_tag as your conditional and have 70,000 tags?

Start autocompleting at 3 chars, limit to 100 items. This way we won't do any expensive queries.

Rather than a new select menu, we can use jQuery UI's chosen to corral a massive lis

Makes sense

Generating the massive list would be expensive, though we are in the admin. Would an ajax search interface make sense instead?

See the first bullet point

Would it make more sense as a filter that let themes or providers decide what should show?

Filter would definitely be nice.

Not that ugly :)

@jeremyfelt

Good point. With Chosen, the user could just finish typing if it doesn't match one of the 100. Much less ugly.

@danielbachhuber

@jeremyfelt will you be able to finish this up in the next day or so?

@jeremyfelt

I'm going to try and toss some time at it this evening or tomorrow, but the outlook is unlikely at finishing it up for 0.4.

@danielbachhuber

Let's just put it in v0.5 then, and we can keep the momentum going by releasing in a month or so. Please do the work on a feature branch when you do work on it.

@jeremyfelt

Awesome, sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment