In the pharmaceutical world, it's called "off label use;" in social media, it's called "life hacks." Regardless of the name, I love it when folks find a way to repurpose functionality that was designed for one problem to solve something for which it wasn't designed.
MyFlightbook has "flight coloring" functionality, whereby you can give a name to a search and highlight flights that match the conditions of the search with one color or another. The idea was that you might highlight your checkrides, or you might highlight charity flights.
I confess I had not really thought about flights that might match several such searches, and therefore I hadn't thought about which color "wins" in such a scenario. Why would I?
But the other day, a user asked me about this because he was using flight coloring to highlight his airline flights (so jet flights where he was SIC and was flying under Part 121) and wanted to find the flights where he had neglected to tag the flight as having been conducted under Part 121. He had set up a saved search with one color to highlight all of the Jet/SIC flights, and another search with a different color for Jet/SIC flights that lacked the "Part 121 Flight" property.
The (brilliant) idea here is that the different colors could help him visually identify inconsistencies in his logbook that he wanted to catch: if he logged a flight and forgot to tag it as part 121, it would show up differently, immediately showing him that he had forgotten something.
I love this idea and I think it can be applied to all sorts of consistency checks that pilots may want to do. But alas, it only works if you know the answer to the question above: what happens if a flight matches multiple searches? When I implemented flight coloring, I never really gave much thought to that; I just left it undefined, and when he asked, I thought it might even be non-deterministic which color wins.
Well, I took a look at the code to answer the pilot's question about this, and it is deterministic; since this is a great "off-label" use for the functionality, I think I will formally commit to preserving this functionality.
Specifically, the rule is pretty simple: to determine the color (if any) for a flight, I test a flight against any colored searches in alphabetical order by the name of the search, and apply the color of the first search that matches.
So in the scenario above, the pilot would define two searches:
- A query that checks for a flight that is in a jet and which has SIC time logged, and which does NOT have a part 121 property, with color A, and a title like "1. Jet/SIC - No 121"
- A second query that checks for a flight in a jet with SIC time logged, with color B, and a title like "2. Jet/SIC".