UI

The UI Aptitude provides access to the Olive Helps search bar and global search.

Starting with the v0.25 release of Olive Helps, if a Loop utilizes listenSearchbar or listenGlobalSearch, the Search Bar will focus when the Loop is selected from the dropdown. If a Loop does not use these methods, the Search Bar will not focus when the Loop is selected from the dropdown.

listenGlobalSearch

Creates a listener receiving updates whenever the user enters a search in the Olive Helps Global Search. The Global Search is different from the search bar at the top of Olive Helps, and is triggered by using Command+Shift+O on Mac or Ctrl+Shift+O on Windows.

import { ui } from '@oliveai/ldk';

ui.listenGlobalSearch((text) => {
    // Code to run using the text that the user
    // entered into the Global Search
})

listenSearchbar

Creates a listener receiving updates whenever the user enters a search in the Olive Helps Search bar. The Search Bar can be found at the top of Olive Helps, by clicking the magnifying glass icon.

import { ui } from '@oliveai/ldk';

ui.listenSearchbar((text) => {
    // Code to run using the text that the user
    // entered into the Searchbar
})

loopOpenHandler

Registers a handler function for the Olive Helps Loop Open Button. This function runs when you open the Search bar, click All, and select your Loop. This will also run when a user first installs, restarts, or unpauses your Loop. Click here for more detail.

import { ui } from '@oliveai/ldk';

ui.loopOpenHandler(() => {
    // Code to run when the user selects your loop
    // from the Searchbar list
})

Last updated