Smartbar & Quick Actions
Relevant source files
The following files were used as context for generating this wiki page:
The Smartbar is a multi-functional toolbar situated at the top of the Ownkey Keyboard. It serves as a primary interface for contextual information, such as word suggestions and inline autofill, while providing immediate access to "Quick Actions"—shortcuts for common tasks like clipboard management, AI-powered text rewriting, and voice input.
Quick Actions are highly customizable, allowing users to reorder or hide specific tools to suit their typing workflow. The system is designed to maintain high responsiveness, ensuring that background AI tasks do not block everyday input through the Smartbar UI.
Sources: README.md:1-10, app/src/main/res/values/strings.xml:1351-1360, app/src/main/res/values/strings.xml:1372-1380
Smartbar Architecture and Layouts
The Smartbar supports several layout configurations to balance space between predictive text candidates and functional buttons. These layouts are defined in the SmartbarLayout enum and can be toggled via user preferences.
Layout Types
The following table describes the available structural configurations for the Smartbar:
| Layout Type | Description |
|---|---|
SUGGESTIONS_ONLY | Shows only the candidate row for word/emoji suggestions. |
ACTIONS_ONLY | Shows only the actions row without suggestions or a sticky action. |
SUGGESTIONS_ACTIONS_SHARED | A shared, toggleable row that switches between candidates and actions. |
SUGGESTIONS_ACTIONS_EXTENDED | Static candidate row with an additional toggleable row for extended actions. |
| Sources: app/src/main/kotlin/dev/patrickgold/florisboard/ime/smartbar/SmartbarLayout.kt:18-24, app/src/main/res/values/strings.xml:1519-1528 |
Visual Representation of Layout Flow
The following diagram illustrates how the Smartbar manages different input states:
The Smartbar acts as a container that dynamically swaps or stacks rows based on the selected SmartbarLayout configuration.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/ime/smartbar/SmartbarLayout.kt:18-24
Quick Actions System
Quick Actions are discrete functional units that can be placed within the Smartbar. They provide shortcuts to internal keyboard states or external system functions.
Core Quick Actions
Ownkey Keyboard includes several specialized actions, particularly focusing on AI and clipboard integration:
- AI Rewrite: Uses a configured LLM provider to rewrite selected text.
- Voice Input: Activates the Mistral Voxtral ASR for dictation.
- Incognito Toggle: Enables/disables learning from user input.
- Clipboard Manager: Opens the clipboard history panel.
- Cursor Control: Arrows (Up, Down, Left, Right) for precise text navigation.
Sources: app/src/main/res/values/strings.xml:107-160, README.md:19-24
Quick Action Properties
Each action is defined by a set of visual and functional resources in the project's string and theme assets.
| Property | Resource Example | Purpose |
|---|---|---|
| Label | quick_action__clipboard_copy | Text label displayed in the actions editor. |
| Tooltip | quick_action__undo__tooltip | Content description for accessibility. |
| Icon | snygg__rule_element__smartbar_action_tile_icon | The symbol representing the action. |
| Grouping | quick_actions_editor__subheader_sticky_action | Categorization in the customization UI. |
| Sources: app/src/main/res/values/strings.xml:107-175, app/src/main/res/values/strings.xml:656-665 |
Customization and Editing
The Smartbar allows users to define the order and visibility of Quick Actions through a dedicated editor. This system categorizes actions into three states:
- Sticky Action: A primary action that remains visible even when the row is collapsed.
- Dynamic Actions: Actions that populate the main row and can be reordered.
- Hidden Actions: Disabled actions that are moved to the overflow menu or removed from the Smartbar entirely.
Sources: app/src/main/res/values/strings.xml:175-180, app/src/main/res/values/strings.xml:1406-1415
Customization Sequence
The following sequence diagram shows the logic for resetting or modifying the Smartbar arrangement through developer tools or settings:
Updates to the action arrangement trigger an invalidation of the Smartbar UI, forcing it to rebuild the row with the new tile sequence.
Sources: app/src/main/res/values/strings.xml:1034-1040, app/src/main/kotlin/dev/patrickgold/florisboard/lib/devtools/Devtools.kt:133-145
Diagnostic and Feature Configuration
The Devtools module tracks the status of the Smartbar to assist in debugging and performance tuning. It captures metrics such as whether the Smartbar is enabled and how it interacts with other features like Glide typing or Autofill.
// Example of feature logging for Smartbar in Devtools.kt
fun generateFeatureConfigLog(prefs: FlorisPreferenceModel, withTitle: Boolean = true): String {
return buildString {
if (withTitle) appendLine("======= FEATURE CONFIG =======")
append("Smartbar enabled : ").appendLine(prefs.smartbar.enabled.get())
// ...
}
}
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/lib/devtools/Devtools.kt:133-145
Summary
The Smartbar & Quick Actions system provides a flexible, high-performance interface for both predictive input and advanced productivity tools. By decoupling the UI arrangement from the functional implementation of actions, Ownkey Keyboard allows users to integrate complex AI features like Mistral Voxtral dictation and LLM rewriting directly into the primary toolbar without sacrificing the speed of standard typing suggestions.