Zeroclickinfo-goodies: Military Rank: Scroll to specified tile, when present

Created on 24 Jun 2016  路  6Comments  路  Source: duckduckgo/zeroclickinfo-goodies

When the query contains a specific rank, we should ensure that the view automatically scrolls to the specified tile.

The can be achieved by specifying meta.scrollToSelectedItem and meta.selectedItem

Examples can be seen here: https://github.com/duckduckgo/zeroclickinfo-spice/search?utf8=%E2%9C%93&q=scrollToSelectedItem&type=Code


IA Page: http://duck.co/ia/view/military_rank
Maintainer: @lowellosaurus

Low-Hanging Fruit Maintainer Input Requested Relevancy Suggestion

All 6 comments

I'll fix this one! @moollaza :smile:

@moollaza Are you talking about using the $grade_pat to scroll to the enlisted/warrant/officer section of grades as mentioned in the note on line 39? (https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/MilitaryRank.pm#L39)

Or do you mean something more specific, like searching "us army sfc rank" would scroll straight to the E7 rank?

The idea is to compare the search query with title_main and title_sub of each returned rank/position. If search query contains any of both of these, then set the selectedItem to that rank/position.

Is this right? @moollaza
Does this sound good to you? @lowellosaurus

@lowellosaurus @sahildua2305 I meant that if the user specifies a specific rank in the query, we should be able to scroll to it.

I think this is more along the lines of what @sahildua2305 is describing.

@lowellosaurus I'm unsure what your code comment there refers to -- would that be a more general case? Do multiple ranks belong to a certain grade? If so we can use a topic display approach to group them. This would give a small row of links that scrolls to the first tile in that "topic" (group).

That's what we've used for the ExperimentalIA on Beta to provide the "Today", "Last 7 Days", etc links: https://beta.duckduckgo.com/?q=drake&ia=iatesting


In testing some queries I noticed a few more that should show this IA, and I would expect to scroll to the correct tile:

  • us army colonel rank
  • us army rank colonel
  • us army colonel rank insignia
  • us army colonel rank logo
  • us army colonel rank symbol

@moollaza the topic links is exactly what I was thinking! I'll look into implementing this.

the topic links is exactly what I was thinking! I'll look into implementing this.

@lowellosaurus awesome! 馃挴

I look forward to your Pull Request 馃憤

Was this page helpful?
0 / 5 - 0 ratings