ad-code-manager icon indicating copy to clipboard operation
ad-code-manager copied to clipboard

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

Open rinatkhaziev opened this issue 13 years ago • 12 comments

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.

rinatkhaziev avatar Jun 28 '12 09:06 rinatkhaziev

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 avatar Oct 18 '12 00:10 jeremyfelt

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

danielbachhuber avatar Oct 18 '12 00:10 danielbachhuber

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

danielbachhuber avatar Feb 28 '13 19:02 danielbachhuber

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 avatar Mar 06 '13 03:03 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?

jeremyfelt avatar Mar 06 '13 04:03 jeremyfelt

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 :)

rinatkhaziev avatar Mar 06 '13 04:03 rinatkhaziev

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

jeremyfelt avatar Mar 06 '13 04:03 jeremyfelt

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

danielbachhuber avatar Mar 17 '13 16:03 danielbachhuber

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.

jeremyfelt avatar Mar 18 '13 19:03 jeremyfelt

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.

danielbachhuber avatar Mar 18 '13 19:03 danielbachhuber

Awesome, sounds good.

jeremyfelt avatar Mar 18 '13 19:03 jeremyfelt

No branch apparently existing in GitHub for this work.

GaryJones avatar Mar 14 '22 11:03 GaryJones