Implementation:0xranx OpenContext IntentSelector
| Knowledge Sources | |
|---|---|
| Domains | UI, Agent_Chat, React |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Dropdown selector component for choosing agent intent/quick-actions in the agent chat input bar, with active state highlighting and i18n labels.
Description
The IntentSelector component in src/ui/src/components/agent/ renders a pill-shaped button that opens a dropdown menu of intent options (auto, create, iterate, search). Each option shows an icon and i18n label, with a checkmark on the active selection. The "auto" option clears the active intent, while other options set the intent that modifies the agent's behavior.
Usage
Import this component in AgentInputBar to provide intent selection in the agent chat.
Code Reference
Source Location
- Repository: 0xranx_OpenContext
- File: src/ui/src/components/agent/IntentSelector.jsx
- Lines: 1-81
Signature
export function IntentSelector({
activeIntent, intentLabel, IntentIcon,
showIntentMenu, setShowIntentMenu, handleQuickAction,
t, intentMenuRef, quickActions
})
Import
import { IntentSelector } from './components/agent/IntentSelector';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| activeIntent | null | Yes | Currently active intent ID |
| quickActions | Array | Yes | [{id, icon, labelKey, placeholderKey}] |
| showIntentMenu | boolean | Yes | Menu open state |
| handleQuickAction | Function | Yes | Called with intent ID |
Usage Examples
Intent Selection
<IntentSelector
activeIntent={activeIntent}
intentLabel={intentLabel}
IntentIcon={IntentIcon}
showIntentMenu={showMenu}
setShowIntentMenu={setShowMenu}
handleQuickAction={handleQuickAction}
t={t}
intentMenuRef={menuRef}
quickActions={quickActions}
/>