1

I want to do something like a match pattern inside a single result view so that if the Action that returned the results is of a particular type, the view will be modified.

In Content-result-view.bxb, the default view for multiple docs returned is normally a thumbnail view.

render {

            if (size(this) > 1) {

               list-of (this) {

                has-details (true)
                where-each (item) {
                  layout-macro (content-thumbnail-card) {
                    param (content) {
                      expression (item)
                    }
                ...

I want to do something like

if from-output: GetNewsFromAllAltBrains {
  layout-macro (content-thumbnail-getnews-from-all-card) 
} 
else {
 layout-macro (content-thumbnail-card) 
}

It looks as if I could do this by creating a separate result-view for this match but that seems like a lot of overhead to have a whole different result-view for just one special situation.

Fred Zimmerman
  • 1,178
  • 3
  • 13
  • 29

1 Answers1

1

This is an excellent question and one that requires a longer reply to answer completely.

The core question in your post is "How can I define one View to display the contents of a Concept differently depending on the path upstream?"

The short answer is that you cannot route the display layouts in one view this way. You would need to have a separate View for each of these views using match patterns that hit each path.

The long answer requires us to consider Bixby's design philosophy.

Nodes such as Concepts and Actions are state functions and, as such, do not carry any history of the path taken to them. Bixby is able to connect these elements to each other and has a history of values and steps taken to navigate from a user's utterance to the intended goal. Bixby can pull information from earlier in the conversation/plan to inject into a later node without being explicitly asked to do so but the node itself has no ability to access the plan/conversation history.

The above information means that once the match pattern has been triggered, the individual view will only know the Concept that triggered the match pattern and nothing else. However, you can customize the match pattern to ensure that a View is invoked only when a particular path is taken to reach the Concept using the various conditions available here.

Ameya
  • 880
  • 6
  • 13