Launchers
Put Droppy's commands, droplets, settings and content in a launcher you draw.
A droplet that draws a launcher (a command palette with its own window and search) can list everything Droppy offers beside its own entries: Droppy's commands, its droplets and their settings pages and widgets, the droplets that can be installed, Droppy's settings, and what only Droppy can search, such as clipboard history, notes, OCR results, recordings, tasks, the shelf and web answers. Tinycast, the first launcher droplet, lists all of them this way.
Declare the launcher capability and minAPI 1.12.0 in droplet.json, then read launcher:
func activate(host: DropletHost) throws {
let launcher = host.launcher
guard launcher.isAvailable else { return }
index(launcher.catalog)
cancellable = launcher.catalogDidChange.sink { [weak self] in
self?.index(launcher.catalog)
}
}The catalog and the search
catalog is everything Droppy lists without a query. Index it with your own search, so its items rank, learn and take favorites like your own. Refresh it when catalogDidChange fires: a droplet was installed, or a setting switched a command off.
search(_:) answers a typed query with content, best first. Ask it as the query changes, after the keystrokes of a word still being typed, and drop an answer that arrives for a query that is no longer in the field. A content item's keywords hold the text it matched, which may be nowhere in its title.
Running an item
Hand an item's id back to perform(itemID:actionID:query:), with nil for the primary action or one of the item's actions. Then do what the outcome says:
dismiss: close the launcher at once and hand focus back to the app underneath. Droppy runs the action a moment later, once your window is gone, so a capture does not capture your launcher and a paste lands in the app the user was in.stay: keep the launcher up.presentDetail: showmakeDetailView(itemID:context:)inside your window, with a way back. It is a droplet's widget or settings page, or a web answer, and it takes the keyboard.failed(_:): say the message, in a sentence.
The panel's surface
Put DroppyPanelSurface behind your launcher's content and clip the content to the same corner radius. It is the surface Droppy's own launcher sits on and follows the user's Theming preference, Dynamic Glass included, so a launcher droplet looks like Droppy rather than like a second app.
The service
Items
DropletLauncherItemDropletLauncherIconDropletLauncherActionDropletLauncherOutcomeDropletLauncherDetailContext