Sunday, June 05, 2016

The Latest Last Big Update

Mobile-friendly searches!
How's that for a title? Those of you who read the message boards know I thought long and hard about what to call this update.... ;o)

ANYHOW! So this morning, I took AQ down to do a massive, enormous update! There were thousands and thousands of new, modified and even deleted code. And the end result is.... well, mostly cosmetic from your point of view.

This update was initially supposed to be a long-needed update of the message boards. That--did not happen. I started with modifying the code that moderators use to move threads then got sidetracked with a nagging smartphone display issue on that page--a page that only moderators would see!--which veered me off course into a massive update the AQ search engines.

But still, that hit upon 3 of the top 20 visited pages on AQ--which I "mobilized" to work better on smartphone. Better, as in no need to zoom in or out to navigate and read text, and no horizontal scrolling to read anything. There's always room for improvement, but it's vastly better now.

The three pages are:
  1. The Advance Search page.
  2. The search results page. (For instance, Seattle, WA.)
  3. The logbook pages
From a technical standpoint, each of them are actually multiple different pages internally. Each search type has different search options and information to display. When I updated the Advanced Search page, it has to handle all of these types of searches: All box types, traditional boxes, hitchhikers, travelers, postals, LTCs, event boxes, "other" boxes, all trackers, traditional trackers, postal trackers, LTC trackers and "other" trackers, events, groups, themes, blogs and last (but probably not least!)... trips. Of course, there is some amount of overlap between all of them, but there's a lot of stuff happening in just one page!

The code running all this stuff was old and decrepit and needed a through reboot. It's much easier to maintain, edit and update. I created over a thousand new unit tests to check the new code for issues and problems. It's a lot of good stuff... but none of it is really visible.

But you probably don't care about the technical stuff.... you probably want to know--what is new?! And the answer is... not much, really.

There are some minor modifications. The Advanced Search page no longer sets any defaults. That seemed to confuse people when someone would search for a box but it didn't show in the results because the option to hide un-clued boxes was automatically set. Now, if you want to use a setting, you have to explicitly select it. (Defaults still apply to simple searches, though.)

New premium member search option!
It also wasn't clear which options were for premium members or not, so I added some information about that. (Non-premium members, obviously, won't see this change since there are no premium member options you can use, but premium members can now see exactly which options they have access to and might reduce confusion when a non-premium member can't find the option you told them about.) Premium members have a few new search options they didn't have before like excluding boxes with the fee-area icon or compass.

I turned the blue diamond and Box of the Week search options into premium member perks. I resisted the blue diamond search option for a couple of years when I first introduced blue diamonds because they were already controversial to begin with, but eventually caved a couple of years later at repeated requests for them. But here's the thing.... I never really liked those search options either. I don't mind people taking a closer look at blue diamond boxes when selecting what boxes to hunt for, but I never really liked the idea of not even looking at boxes without blue diamonds. So I liked the idea of ditching those searches completely, but decided just to restrict the feature instead.

Note to premium members: I left some posts on the Premium Member Only board about some other hidden search options as well. ;o)

The search results page largely dumped the table layout it has always used since large tables don't fit well on smartphone at all. Now the rows "collapse" to fit the width of whatever device you are using. On a wide desktop page, it look fairly similar  to before, but I stuffed more information into it such as the last found date and the owner of the box. (Okay, the owner used to be there, but only if you hovered your mouse cursor over the box name. Now no hovering is required!)

I made the links that used to hide out in the upper-left corner of the page more prominent since it seemed like people were always overlooking them.

And the editing of current search is now at the bottom of the results rather than the top. I have to admit, I was a little torn about which way to go with it. I didn't usually edit my searches, but it's handy at the top when I did want to edit it. Fill up space with options I rarely used, or make it easily accessible for those times I did? I'm still not sure which way is best, but if you have a strong preference, do let me know. I could be convinced to change it.

That "quick edit" option is much more powerful than before as well. It'll let you remove or edit pretty much every search option that's being used! Typed the name of the box you were searching for incorrectly? You can change it from right there. You can change tags, attributes, statuses... pretty much everything! So it didn't become a giant advanced search page in itself, however, it mostly just shows options that were enabled so you can edit or remove them. If you want to enable an option that you hadn't initially used, you'll have to edit your search. (There's a button for that at both the top and bottom of the results!)

And the last major page I updated was the logbook pages. To be honest, I did a pretty lame job of it. I had to mess with it because my changes to the searches broke the logbook (which uses the search features of the Advanced Search page--almost all searches on AQ are attached to it!). The logbook pages really needed a major update as well, but mostly I just wanted to fix it just well enough to get them working again. The code there still sucks, but is at least a bit cleaner. =) Someday, I'll need to sit down and do a serious update of that section. I did tweak the layout to have the "collapsible" rows (like the search results page) so it works better on smartphones.

It does, however, include more information such as last find dates for plants which numerous people have asked for over the years. And, like the search results, will show the owner of the box without requiring one to hover their mouse cursor over the box name. (You won't see the owner name on someone's plants list, though, unless it's different than the person who planted it.)

What else... what else? Hmmm... *thinking*

Since I have pretty much re-written the entire search engine subsystem from scratch, it affects a lot of other places on AQ. Widgets on My Page use the search engine, apps use it--even registering a new account uses it! (AQ automatically creates a few favorite searches based on the person's location.) The changes broke code all over the website! I spend solid weeks testing and re-testing changes with thousands of tests, but there are undoubtedly bugs that slipped through. Several have already been found, reported and fixed throughout the day, and I doubt that's the last of them.

I checked out the changes on Firefix, Chorme, Internet Explorer, Opera, Microsoft Edge and Safari and as far as I can tell, it all seems to work well with those major browsers. I've tried them with my desktop and my smartphone, and it seems to work well. But there are so many devices and sizes and such out there, I can hardly claim it's comprehensive. If you see a page that doesn't appear to format correctly, let me know. (Be sure to include what kind of device you are using and the browser!)

So keep your eyes open! If there's something that looks like a problem, let me know! =)

I probably forgot something important, but that's all I can think of for now. Happy trails!

-- Ryan


Elizabeth Shoemaker said...

Thanks for all the effort you put into this. Personally, I'd have snatched my head bald from the intricacies of it!

MichKathy said...

Earlier today I noticed that the search results didn't seem to obey the sort selected. I wanted to see the results sorted by box name. Unfortunately I was on a tablet at the time so I don't have the URL handy.

Ryan said...

A link would be useful. *nodding* I tried running a search on AQ with the results sorted by name and it worked fine so if there's a bug, I'm not seeing it. Did you follow a link then change the sort order? In any case, if you see the problem again, do send me the URL and where it came from!

Grandreader said...

I'm a bit frustrated with the changes, at least in a search. I did a search of my hometowm and found some boxes missing, yet when I looked them up by name, there they were! It worries me that I'll be missing some when I do a search before heading to a new area. Help, please and thank you!

Grandreader said...

I'm a bit frustrated with the changes, at least in a search. I did a search of my hometowm and found some boxes missing, yet when I looked them up by name, there they were! It worries me that I'll be missing some when I do a search before heading to a new area. Help, please and thank you!

Ryan said...

You'll need to be more specific if you want help--I can't read your mind! Include the exact URL of the search your ran along with the name of the box that you expected to see but didn't.

Anonymous said...

Here is a search that isn't sorting for me:;name=Beach;sort=1;title=Virginia;coords=US,VA,,,,,38.0033738186,-79.4583599865;rad=15;location=Virginia

The menu has a check mark next to name.

-- MichKathy

Ryan said...

I'm not sure what you mean by there being a check next to name, but I am a little curious.... Is this search supposed to find all boxes in Virginia with the word "Beach" in the title, or all boxes near "Virginia Beach"? Because this search is doing the former, not the latter.

Anonymous said...

The search is intended to find all "Beach" (in title) boxes in the state of Virginia. I want an alphabetized list of boxes.

The checkmark I referred to is in the menu for Sort Order. I was just confirming that I did have "Name" selected before doing the search.

Ryan said...

Ah.... hmm... yes. When you search for a "name" of a box, the database ranks the matches. In that case, the "name" search is actually sorting based on the "best match" of the name rather than alphabetically. It's one of those search options where boxes can be a "good" match, a "bad" match, or no match at all (in which case they don't show up in the results at all). So the better matches are sorted ahead of poor matches. Most search options don't have "degrees" of how close something matches. It's either on, or off, so sorting by name defaults to alphabetical.

I'll see what I can do to add an "alphabetical" sort option when I have a chance.