Show more possibility in cell area in Bixby - 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)}")
}
}
}

Related

keep footer last in list when dragging new item into the list from another

I have Vue Draggable working like a Kanban board with multiple columns, and I have made each column at least the height of the viewport so that each item can easily be dragged into the column next to it (for cases where one column is much longer than the next, for example).
I also have a button in the footer slot to add new cards to the column. This works well in that it is generally always at the bottom of the list, is not draggable, etc.
The issue arises when I drag an item from another list in below the footer (but still within the height of the draggable element). When I do this, the footer does not stay below the new item, which looks odd.
Once I drop the element, it snaps into place and the footer is one again at the bottom - it is only when the new card is being moved that it appears below the footer.
Is there any way to make sure that even during the move event and a new card being added to a list that the footer stays as the last element?
This issue seems to be captured in this comment on Github issues - https://github.com/SortableJS/Vue.Draggable/issues/673#issuecomment-554149705 - but no solution is provided in that thread.
Any help greatly appreciated.
So for anyone having the same issue I solved this by doing the following:
Hooking into the onMove event using the :move prop to run a function each time an item is moved... e.g. :move="fixFooter"
Creating a function that checks if the moved item would be the last in the new list (thus by default it would sit below the footer without this fix), and if so on the $nextTick append the footer to the Draggable container so it gets moved below the item coming in to the list... (just learnt that .appendChild will move an existing element to the end)
It then checks if the from/to list is the same to account for the item being dragged back into the list it's coming from during the same drag event (otherwise you get the same undesirable footer behaviour as before if you drag an item out of a list and back below the footer without dropping it).
fixFooter(e) {
if(e.relatedContext.list.length === e.draggedContext.futureIndex) {
var newListDom = e.relatedContext.component.$el;
var newListFooter = e.relatedContext.component.$slots.footer[0].elm;
this.$nextTick(() => {
newListDom.appendChild(newListFooter);
});
} else if(e.from === e.to && (e.from.children.length - 1) === e.draggedContext.futureIndex) {
var currentListDom = e.from;
var currentListFooter = e.from.lastChild;
this.$nextTick(() => {
currentListDom.appendChild(currentListFooter);
});
}
}
Seems like for vue draggable next this is enough:
fixFooter(e) {
if (e.relatedContext.list.length === e.draggedContext.futureIndex) {
var newListDom = e.to
var newListFooter = e.to.lastChild
this.$nextTick(() => {
newListDom.appendChild(newListFooter);
});
}
}

Tabulator GroupBy problems

Good afternoon. Please tell me how to solve the following problems.
I added a menu to the column headers of the table, when clicked, grouping by the selected column should occur. But for some reason, grouping occurs only after re-selecting this menu item. This happens once after the table is created. Then the menu is triggered the first time. Next, the grouping is triggered by the first click of the menu item.
After adding grouping by columns, the table starts working very slowly. Scrolling in the horizontal direction is jerky and has a long delay, while scrolling vertically remains acceptable. If you select grouping by different columns several times, the browser starts to take up a lot of RAM. The code and video example are below. And even if we remove the grouping, the lags remain when scrolling. It is worth using the grouping once and the Tabulator becomes difficult to use.
UPD: This is actual for Chrome. An if table include 'Frozen' columns.
Code of header menus
var headerMenu = [
{
label:"Группировка",
action:function(e, column){
let gField = column.getDefinition().field;
if(table.options.groupBy === gField){
table.setGroupBy();
}
else {
table.setGroupBy(gField);
}
}
},
]
Adding menus example
arrCol.push({
title: 'Работник',
field:"fio",
sorter:"string",
headerFilter:"list",
bottomCalc:"count",
headerMenu: headerMenu,
bottomCalcParams:{precision:0},
headerFilterParams:{valuesLookup:"active",autocomplete:true},
frozen:true,
width: 200
});
Creating Table
table = new Tabulator("#spreadsheet", {
columnDefaults:{
headerHozAlign:"center",
},
height:"65vh",
columns: arrCol,
columnCalcs:"both",
groupClosedShowCalcs:true,
});
Video showcase

Label gets selected on clicking enter key in the tabulator cell

I have a js fiddle to show the issue that I am facing.
Tabulator 'email' column has freetext set to true to allow the user to set the value of the cell to a free text entry as follows:
editorParams:{
values:{
"steve#boberson.com":"steve",
"bob#jimmerson.com":"bob",
"jim#stevenson.com":"jim",
"harvy#david.com":"Harvy",
"ken#thompson.com":"Ken",
"denny#beckham.com":"Denny"
},
freetext:true,
searchFunc:function(term, values){
console.log("term and val "+term +" \n"+values);
var matchedEntries = {};
var matchFound = false;
for(var key in values) {
if(key.includes(term)){
matchFound = true;
matchedEntries[key] = values[key];
}
}
if(matchFound){
return matchedEntries;
}
else{
return {term: term};
}
}
}}
Select one of the values from the selector list displayed, say steve, value being 'steve#bobberson.com'.
Then after the value is selected, click on the same tabulator cell, the value displayed suddenly changes to the label.When user clicks enter key now, the label is selected instead of the value,.ie. steve will be displayed instead of steve#bobberson.com
If this is not a bug, how do I make sure that the value steve#bobberson.com remains selected after clicking enter. This is because freetext option is set to true in the editorParams of the column
Attached a gif showing the issue
That is not a bug,
With freetext enabled, users are able to enter any text they like in that field and it will be saved which is exactly what is happening in the example
If they select the email address again from the list then it is correctly saved.
It is an either/or scenario, you can either restrict the users to selecting specific values from the list OR you can allow them freetext in which case anything goes.
If you want a different behaviour then you can always build a custom editor that works in the way you want. Checkout the Custom Editor Documentation for more information

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!

Search Bar return Button

I have a searchBar in a tableview, searching for results in a .csv file (coredata). The list is huge so the user has to scroll up many times to reach the search bar after the first search OR select the "A" letter in the Indexbar. Is there a way to add a button in the NavigationBar to show the searchBar when the user wants to get back to the beginning of the list? Thanks in advance.
searchController = UISearchController(searchResultsController: nil)
tableView.tableHeaderView = searchController.searchBar
searchController.searchResultsUpdater = self
searchController.dimsBackgroundDuringPresentation = false
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return sectionTitles[section]
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
//assume a single section after a search
return (searchController.active) ? 1 : sectionTitles.count
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if searchController.active {
return searchResults.count
} else {
// Return the number of rows in the section.
let wordKey = sectionTitles[section]
if let items = cockpitDict[wordKey] {
return items.count
}
return 0
}
}
I don't know how to send the user direct to a search bar, but there are always other ways to do things, what you can do is: Reload the storyboard and then it will show again the search bar in the initial states. Take a look on this interesting post: How do I perform an auto-segue in Xcode 6 using Swift? maybe you can go to another VC and return immediately with an simple animation so the user will not notice the tricker. :)
Yes, you can add a UIBarButtonItem to your navigation bar where the action you do will scroll the table back to the top.
Just replace the code from tableView.tableHeaderView = searchController.searchBar to navigationItem.titleView = searchController.searchBar which shows the searchBar on the NavigationBar.
But when you select the searchBar then it goes upward and might be not visible on the screen, so you can take the UISearchBar instead of UISearchController. For more information please look into these thread.
This is not exactly an answer to your question, but still a solution to your problem of quickly returning to the top of your table view. You could overwrite the table view's scrollsToTop: -property to return YES. By doing so, you will enable the user to jump to the top of the table by simply tapping the status bar. This is standard behavior in many stock apps, such as Contacts, Mail, Safari, and Photos.
Beware that only one scroll view / table view / collection view on the screen may return YES in order to achieve this behavior. In the case of multiple scroll views, you can alternatively implement the UIScrollViewDelegate -protocol's
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
callback and dynamically check, if the given scroll view should respond to the tap.
Although this is the Objective-C -way, I guess you should be able to transfer the concept over to Swift.
This approach has two advantages:
You will not clutter your navigation bar. Apples iOS Human Interface Guidelines explicitly suggest to
Avoid crowding a navigation bar with additional controls, even if it looks like there’s enough space. In general, a navigation bar should contain no more than the view’s current title, the back button, and one control that manages the view’s contents.
You will be consistent with the OS' standard behavior.

Resources