momijizukamori: (dreamsheep | styles)
Cocoa ([personal profile] momijizukamori) wrote in [site community profile] dw_dev2014-12-12 04:12 pm

new style search help? preserving results + auto-categorizer

Not dead! Just busy with life. But Fu is in the process of converting the widgets on /customize to something less ridiculous, which gives me time to prod some of the problems that have been stumping me.

1) Preserving search results
The order of actions to generate a page of results from the advanced search, as I have it right now, goes like this:
User checks boxes to indicate choices -> user presses 'search' button -> button triggers POST actions -> a query is generated as one of these actions -> query goes to worker -> worker performs search -> worker sends back a list of theme ids

The problem is that POST data is lost on reload/page change, so when you click to see the second page of results (if there are more than one page), all of the query and the results vanish. Most of our other ways of grabbing a set of layouts (by base style, by designer, etc) append the query string to the URL, which is then hidden from the user via routing, but even just the list of search elements has the potential to get unwieldy fast (and the return list is worse)

2) The auto-categorizer
I don't have this working yet because it's not necessary for the new search, just... nice, given we have almost fifteen hundred themes (!!!). The script needs to pull hexcodes out of the style layers (which is all text to the perspective of anything not the S2 compiler). That seems to say 'regex' to me but I don't know if that's safe/the best way to do it.
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2014-12-15 11:46 pm (UTC)(link)

Ahh yeah you could, that would be good. But also in this case would be so the user could see; because the next page button is in a separate form from the search, having the checkboxes selected in the search form would do nothing.

But yeah, set the checkbox value based on the POST value when generating the page on the server too!