Hands free navigation for input-view form element - bixby

I am using form element number input to enter a quantity and used the submit button ("Go") to go to the next page when the submit button is clicked.
But on giving voice command "Go", the page doesn't go to the next page. why?
Any solution to this. Please.
input-view {
match {
Quantity (Quantity) {
to-input: TicInfo
}
}
message {
template ("Enter Quantity")
}
render {
form {
elements {
number-input {
id (Quantity)
type (Quantity)
label (Quantity)
}
}
on-submit {
goal: TicInfo
value: viv.core.FormElement(Quantity)
}
submit-button (Go)
}
}
}

Go is the label text of submit button and not part of voice command in both HEF and non-HEF mode. In both case, proper training examples should be added.
For hands free mode on mobile, should be triggered by "hi Bixby" and not touch screen any time during the conversation. "hi, Bixby" --> "ask my capsule to do input prompt" --> Bixby respond "Enter Quantity" and opens mic waiting for input --> "five" --> continue the flow as 5 is taken as input.
For normal non-HEF mode, hold button and "ask my capsule to do input prompt" --> Bixby respond "Enter Quantity" --> user can either type 5 and tap Go or hold button again and say "5" then release the button --> continue the flow as 5 is taken as input.
Customized input in HEF and non-HEF can be supported with proper training examples, developer can support utterance like "go ahead with 5" or "quantity is 5" or "I want 5". It is possible to training "go" with a default value to the input prompt, however, it is not possible to fill the form by entering text, and training "go" utterance to take the input value.
The training example should be marked as "at prompt for [input type]", please read more in https://bixbydevelopers.com/dev/docs/dev-guide/developers/training.training-for-nl

Related

How does Bixby retain data from a previous NL input?

I don't understand the way Bixby retains data from previous NL Input. The following example uses the capsule capsule-sample-shirt.
I first use the NL input find 2 medium shirts to get a list of shirts.
I click on any of those (here i use the Collar Dress Shirt), and Bixby asks if I would want to buy it.
I click No and Bixby informs me with a Okay, I won't do that.
I now immediately run again the same NL input find 2 medium shirts and expect Bixby again to present me with the list of shirts, just like the first time. Instead of the expected list of shirts now, Bixby asks me again Are you sure you want to buy this? with the Collar Dress Shirt that I previously selected.
Why is Bixby not showing the list of shirts the second time find 2 medium shirts is given as NL input? What would need to happen to make Bixby show the list with this NL input after the first time?
List of shirts after NL Input:
Bixby waits for confirmation:
Bixby saying it canceled the prompt:
Bixby doesn't show the list but instead immediately asks for confirmation:
This is the AI part about Bixby.
Each conversation (utterance) without pressing the reset key is considered a continuation of last utterance (if any). Thus make the choice of Collar Dress and cancel it, but later ask to find 2 medium shirts again, Bixby will try to fill-in the blank with last choice user made.
One clear issue is that now has no way to change the type of shirt unless reset, but fix would be easy, make the image of shirt clickable and link actions in view model Confirmation.view.bxb
image-card {
aspect-ratio (4:3)
image-url ("[#{value(item.shirt.images[0].url)}]")
title-area {
halign (Start)
slot1 {
text {
value ("")
style (Title_M)
}
}
}
// Add on-click here
}
You can add on-click similar to change the size and quantity
input-cell {
label ("Quantity")
value ("#{value(item.quantity)}")
on-click {
//This intent relies on searchTerm matching the item which is not a good practice, a better approach
//was to allow an ID as input to SelectItem and use `this.id` in the intent
intent {
goal {
UpdateOrder
#context (Continuation) { Order }
}
value { SearchTerm$expr(item.shirt.title) }
route { GetQuantity }
}
}
}
You may need to add other models to properly promote user.
Hope this will help, and have fun with Bixby!

Show more possibility in cell area in Bixby

The user says: "Show me Chinese menu"
I have used cell area to show food items because this is the layout I wanted in my card (vertical and small image).
However, because I have more than 80 items to list down, is it possible that first I show the user ten items and then a "Show More..." button?
If the user clicks on the "Show More Button", either I should open the menu in a different result-view or list down the rest menu in the same page hiding the "Show More..." button.
I know image-list has the option but the image is little big compare to cell-area image and showing it horizontally, where I wanted it vertically.
Scenario 2:
User: where is Pizzahut in my area
in my detail page, bixby will show one store with image, below image will be the location with map, below that will be the list of menu. So three blocks into the results. first block is compound-card, second block is map-card and third block is cell-area. Now third block which is the menu has more than 20 items and i am listing it down. I want it to show like 5 items and one show more link and as soon as user click one the show more link, rest of the menu will drop there or I can redirect it to one new page with list of all the menu... whatever is possible.
For a large set of results, the best way would be for you to use navigation-mode.
navigation-mode {
read-many-and-next {
underflow-statement (This is the first page of results)
list-summary ("I have #{size(this)} results")
overflow-statement (That's all I have)
overflow-question (What would you like to do?)
next-page-question (Do you want the next page?)
page-size (10)
}
}
This ensures that you give the user a paginated view of your results so the user can consume them piecemeal rather than getting overwhelmed with 2 sets of results (first 10 and then the next 70).
Adding information to account for modified question
The highlights functionality would've worked in a simpler view but for your more complex view, I would recommend manually adding 5 iterations of menu items to display the first 5 items followed by a card with an on-click that pulls the whole menu and displays it in a separate result-view. I've added a code sample below with some placeholder concepts and actions.
Code sample:
single-line {
text {
style (Title_S)
value ("#{value(menu[0])}")
}
}
divider
single-line {
text {
style (Title_S)
value ("#{value(restaurant.menu[1])}")
}
}
divider
single-line {
text {
style (Title_S)
value ("#{value(restaurant.menu[2])}")
}
}
divider
single-line {
text {
style (Title_S)
value ("#{value(restaurant.menu[3])}")
}
}
divider
single-line {
text {
style (Title_S)
value ("#{value(restaurant.menu[4])}")
}
}
divider
cell-card {
slot2 {
content {
order (PrimarySecondary)
primary {
template ("See Full Menu")
}
}
}
on-click {
intent {
goal:GetFullMenu
value-set: RestaurantName ("#{value(restaurant.name)}")
}
}
}

TestFx - How to test validation dialogs with no ids

I have an application with grid of records and button insert. After clicking insert, there is a form, where you fill in data and click Ok for adding new record to the grid. After clicking Ok, there is validation which fires dialog with error informations, if any of the text fields do not match validation rules. Is there any posible way to test text on the dialog with textFx, if the dialog has no id?
This is an example for Alert based dialog:
In your test:
alert_dialog_has_header_and_content(
"Removing 'Almaty' location", "Are you sure to remove this record?");
In you helper test class:
public void alert_dialog_has_header_and_content(final String expectedHeader, final String expectedContent) {
final javafx.stage.Stage actualAlertDialog = getTopModalStage();
assertNotNull(actualAlertDialog);
final DialogPane dialogPane = (DialogPane) actualAlertDialog.getScene().getRoot();
assertEquals(expectedHeader, dialogPane.getHeaderText());
assertEquals(expectedContent, dialogPane.getContentText());
}
private javafx.stage.Stage getTopModalStage() {
// Get a list of windows but ordered from top[0] to bottom[n] ones.
// It is needed to get the first found modal window.
final List<Window> allWindows = new ArrayList<>(robot.robotContext().getWindowFinder().listWindows());
Collections.reverse(allWindows);
return (javafx.stage.Stage) allWindows
.stream()
.filter(window -> window instanceof javafx.stage.Stage)
.filter(window -> ((javafx.stage.Stage) window).getModality() == Modality.APPLICATION_MODAL)
.findFirst()
.orElse(null);
}
I know this issue is a little old and probably got fixed, but for documentation purpose in case someone else look for a fix for an issue alike, I see dialog.getDialogPane() in Dialog documentation, which would help lookup for specific controls inside the pane. So further on #plaidshirt query, we could retrieve buttons and input fields with:
dialog.getDialogPane().lookupAll()
Then narrow that down to buttons and input fields for example.

How do I put the selected text/link in my chrome extension's page context menu?

When I selected some text, the context menu title is updated. For instance:
Is it possible to do this as an extension developer?
My current code:
chrome.contextMenus.create({
"title":"I WANT THIS UPDATED",
"contexts":["browser_action"],
"onclick":function(info, tab) {
chrome.tabs.create({url: 'https://www.facebook.com/'});
}
});
Thanks,
Yes, it's possible, but not for browser_action context.
The screenshot you're showing is for selection context.
Quoting the documentation:
When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
See this answer for more info on context types.

SugarCRM - very SIMPLE Logic Hook executed with delay

i have very, very simple logic hook- I am still learning and I am confused at the start.
I turn on Developer mode.
I already have field "FIRST_NAME" in Contacts module.
I Created my field "MY_FIELD" also in COntacts module.
In logic_hooks.php file I added
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'Value from one field to another', 'custom/modules/Contacts/my.php', 'User_hook','copy');
In my.php file I added
class User_hook {
function copy(&$bean, $event, $arguments)
{
$bean->my_field_c = $bean->fetched_row['first_name']. " - additional text";
}
}
So when I entered in First_Name value "First" I am getting in My field value "-additional text" but I should get "First- additional text."
If I go to Edit View and enter in First name field "Second" I am getting in My field value "First - additional text" but I should get "Second - additional text".
If I enetein Edit View "Third" I am getting in My field "Third - addiitional text" but I should get "Third - additional text".
So obviously my logic hook is executed with delay in one iteration- why and how to change it? This is my first hook so I am not so experience. Thanks for help
$bean->fetched_row['first_name'] will return the value of the field BEFORE you change it. You'd use this to see what the value of first_name was before the user changed it on the form.
Try using
class User_hook {
function copy(&$bean, $event, $arguments)
{
$bean->my_field_c = $bean->first_name. " - additional text";
}
}

Resources