search-string icon indicating copy to clipboard operation
search-string copied to clipboard

Conditions after free text

Open gausie opened this issue 7 years ago • 4 comments

https://github.com/mixmaxhq/search-string/blob/8eed1468019b58442222b144926c6e98652dff19/src/searchString.js#L303

I know it's a tiny thing, but I think it makes more sense to have conditions follow rather than precede the freetext. I'm happy to submit a PR but would you rather it was an option or a default? Would it be an argument to toString()?

gausie avatar Jun 19 '18 16:06 gausie

Hey @gausie great idea. I hesitate to change the default arrangement. It seems to work well for us at Mixmax and I think that would warrant a major version semver.

I think a PR with toString({ textBeforeConditions }) would work. Please include a test! 😄

mericsson avatar Jun 21 '18 04:06 mericsson

How about having the freetext / options in it's original position?

Image I type this into the search field:

foo -bar prop1:false

and when pressing enter it (confusing to the user) changes the input to:

prop1:false -bar foo

etc.

I now have to discover/find my freetext/props to change it. So maybe adding a third option: toString({ originalOrder})

abergs avatar Jul 01 '18 18:07 abergs

Hey @abergs I think that's a great idea! That's something we noticed here at Mixmax and would love to improve. Assuming it is done well, I think that should be the default functionality. Would be a sweet PR if you're keen to do it!

mericsson avatar Jul 02 '18 16:07 mericsson

I'm going to try to pick this up next week, focusing on original order.

gausie avatar Jul 05 '18 14:07 gausie