[Omnibox] add knowledge graph icon for New Answer Layout |
||
Issue descriptionWhen a Knowledge Graph result is received when using the New Answer Layout, the proper icon is not seen. An example of a Knowledge Graph search would be something like "how tall is barack obama"
,
Jun 21 2018
Alright, Pri-1, hit me with it. I'll start looking at code, and ready when you are.
,
Jun 21 2018
Okay, I suspect the reason is that ANSWER_TYPE_KNOWLEDGE_GRAPH is not handled by this switch statement: https://cs.chromium.org/chromium/src/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc?rcl=5b9084f802a4976d61d9cfcce611f6b76faa251c&l=303 I love enforced algebraic data types - in ML-inspired languages like F# and Rust, this simply wouldn't be possible. But hey, for now I'll see if I can add something sensible to handle the case. :)
,
Jun 21 2018
Hmm, well I can make the answer sunny with kAnswerSunriseIcon but kAnswerDefaultIcon seems AWOL - maybe that's the more fundamental issue. Because I don't see a knowledge graph specific icon in this list: https://cs.chromium.org/chromium/src/out/Debug/gen/components/omnibox/browser/vector_icons.h?rcl=6c7bf0a2937b0e13d381015322bf8544b7e01cb6&l=20 If there's a proper icon for knowledge graph answers, point the way; otherwise I'll look at why the default icon isn't showing up.
,
Jun 21 2018
It gets interesting: reverted to default switch logic; replaced content of answer_default.icon with content of answer_sunrise.icon and "how tall" questions got sunny. Then I reverted content of answer_default.icon and "how tall" questions got the big G, which I assume is the default answer icon. Is it a build process hiccup? I will have to learn about this vector icon data flow.
,
Jun 22 2018
Okay, after conversations with bklmn@ and emilyschechter@ and dschuyler@ it was concluded that the big G default icon is the correct icon to use for knowledge graph as well. I did see a total absence of icon once for "how tall" answer result, but that is not this bug; that was apparently fixed elsewhere earlier this week, and it's possible that my code just wasn't fresh for that run. Once the icon showed at all, it continued to show G, which is by design. |
||
►
Sign in to add a comment |
||
Comment 1 by dschuyler@chromium.org
, Jun 21 2018