Tools menuPro
Choose which tools the agent may use: grouped switches, group toggles, a filter, and connectors that ask you to sign in first.
oxyn add tools-menuThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- The "+" is where the user adds things the text cannot carry: a file from disk, an image, a repo or URL as context, a connector (MCP server), a skill, or a mode such as Plan or Research.
- Research across coding agents found two different jobs hiding behind one "+": attaching a file from disk, and adding context or capabilities (skills, connectors, plugins) (research notes 03: Claude Code desktop, Lovable, Zed, Verdent).
- Consumer chat apps put modes there too (research notes 04: ChatGPT, Claude, Gemini).
- The menu therefore has sections, search, nested submenus, and per-item states for tools that are on, need sign-in, are broken, or are not allowed right now.
When not to use
- Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
- The model menu of an AI chat: use Model Picker instead.
- The prompt box for an agent, in six layouts: use Composer instead.
Installation
Tools menu is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add tools-menuUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Open
Grouped tools with switches.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Closed
The tools chip in the composer.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Minimal
No search or group switches.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Connected
Connectors already signed in.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ToolsMenu
| Prop | Type | Default | Description |
|---|---|---|---|
toolsrequired | Vec<Tool> | — | Tools. |
open | bool | true | Start open. |
group_toggles | bool | true | Group switches. |
search | bool | true | Search field. |
on_change | EventHandler<Vec<String>> | — | Changed: enabled ids. |
on_connect | EventHandler<String> | — | Connect pressed for a tool that needs sign-in. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Move through tools |
| EnterorSpace | Toggle a tool |
| Escape | Close the menu |
Accessibility
- Each tool is a switch (role switch, aria-checked); groups are labelled.
- Group buttons read “Turn all on” or “Turn all off”; changes are announced politely.
From the spec
- Trigger: button with
aria-haspopup="menu",aria-expanded, label "Add files, tools and more" (closed) / "Close menu" (open). With active items: "Add files, tools and more, 2 active". - Menu:
menuwithgroups labelled by section headers; toggles aremenuitemcheckbox, exclusive modesmenuitemradio, submenusaria-haspopup+aria-expanded. Incommandvariant the search is a combobox witharia-activedescendant, so focus stays in the field. - Each connector row's name includes status and count: "GitHub, connected, 5 tools". Status is icon + word, never colour alone.
- Live region (polite): "3 results", "No results", "GitHub needs sign in", "Connected to Linear, found 5 tools", "Research on. Turns off Think.".
- Disabled items stay focusable and expose the reason via
aria-describedby. - Focus order: "+" → (menu opens) search → first item; Esc returns focus to "+"; picking returns focus to the composer text area.
- Contrast: item text 4.5:1 minimum, descriptions 4.5:1, disabled text exempt but the reason line meets 4.5:1.
- Reduced motion per §5.
Motion & interaction
- + → × morph. The glyph rotates 45° into a cross as the menu opens (≈200 ms in [R013]); reversed on close. The button keeps its size; only the glyph turns.
- Open. The menu scales from 0.96 to 1 with origin at the "+" (bottom-left when the menu is above), rises 4 px and fades in. Rows do not stagger by default (a list that appears whole reads faster);
expressivemotion adds a 20 ms stagger capped at 6 rows. - Close. Faster than open, toward the origin, no overshoot. Picking an item closes after the row's press feedback (80 ms), so the click is felt.
- Highlight. One highlight glides between rows on a snappy spring for both pointer and arrows (as in A command palette and morph select, research notes 12); it snaps instead of gliding on jumps over more than 6 rows.
- Search. Typing filters live; matched letters render in medium weight (shared matcher with composer-slash-mentions.md). The panel height springs to the result count.
- Submenu. Opens after 120 ms hover intent; the child slides 8 px from the parent edge and fades. A safe-triangle (pointer heading toward the child) keeps it open for up to 300 ms.
- Toggle on. Switch thumb springs; a chip for the active mode grows in under the composer (scale 0.85 → 1) at the same moment, so the user sees where the state now lives.
- Status changes. Connector status label and pill cross-fade (≈100 ms out, 160 ms in, the Arc MCP timing); discovered tools appear one by one with a 4 px fade-in.
- Error. The row's icon does one 4 px shake; the Retry pill fades in. No toast.
- Drop on "+". Files dragged onto the closed "+" make it swell to 1.12 and show a paperclip; drop forwards to attachments without opening the menu.
Timing
| Transition | Duration | Delay | Easing / spring | Notes |
|---|---|---|---|---|
| Hover fill | 100 ms | 0 | ease-out | |
| Press scale 0.94 | 80 ms | 0 | ease-out | release springs back |
| + → × rotate 45° | 200 ms | 0 | spring, critically damped (stiffness 400, damping 40, proposed) | ≈200 ms observed in [R013] |
| Menu open (scale 0.96→1, y 4→0, fade) | 180 ms | 0 | ease-out cubic-bezier(0.22, 1, 0.36, 1) | proposed |
| Menu close | 120 ms | 80 ms after pick feedback | ease-in | |
Row stagger (expressive only) | 20 ms per row | — | — | cap 6 rows (≤ 120 ms total) |
| Highlight glide | 140 ms | 0 | spring (stiffness 600, damping 40, proposed) | snap on jumps > 6 rows |
| Panel height on filter | 160 ms | 0 | spring, no overshoot | |
| Submenu open / close | 160 ms / 100 ms | 120 ms hover intent | ease-out / ease-in | safe triangle 300 ms |
| Loading skeleton | appears after 150 ms | 150 ms | 2 s linear sweep | never flashes for fast lists |
| Status cross-fade | 100 ms out + 160 ms in | 0 | ease-out | |
| Tool discovered row | 140 ms each | 60 ms stagger | ease-out, 4 px | |
| Active chip grow-in | 160 ms | 0 | spring | scale 0.85 → 1 |
| Error shake | 240 ms, 2 cycles, 4 px | 0 | linear | |
| Reduced motion | 0–80 ms opacity cross-fades | — | linear | no rotate (glyph cross-fades + → ×), no scale, no glide, no slide, no shake; skeleton static |
Sizes (proposed): menu width 280 px (min 240, max 360), max height 360 px or 60 % of viewport, row 32 px (28 px dense, 44 px touch), section header 24 px, 8 px panel padding, 4 px gap between sections with a 1 px divider.
Responsive behaviour
- The menu scrolls past 360 px of height.
Edge cases (spec)
- Long labels and descriptions ellipsize to one line each; full text in tooltip and accessible name. Connector names over 24 characters truncate in the middle ("Google Dr…Sheets") to keep the brand ends.
- Many items. 40 skills or 30 connectors: search auto-shows (threshold 8 items, the Arc morph-select rule), list virtualises, recent/favourite items pin to the top.
- No room above. Flip below the trigger; on tiny windows (height < 420 px) use the sheet.
- RTL. The menu anchors to the "+"'s mirrored side; submenus open to the left; chevrons and back arrows mirror; the + → × rotation stays 45° (symmetrical glyph).
- Tiny sizes (16–20 px). The "+" becomes a 16 px glyph in
minimalandterminal; hit area stays ≥ 24 px (44 px on touch). Submenus collapse into an inline accordion below 280 px width. - Touch. No hover intent: tap opens submenus; long-press on a connector shows its details.
- Slow networks. Async sections show skeleton after 150 ms; a section that fails shows one inline error row with Retry, the rest of the menu still works. OAuth tabs that never return time out after 120 s (proposed) to
Error("Sign-in timed out"). - Busy agent. Attach and Context stay available (they add to the next or queued message). Modes that would change the running turn are disabled with a reason, or queued for the next turn (app choice).
- Environment limits. Some environments only allow some items (Claude limits WSL sessions to "Add image", research notes 03); items are
HiddenorDisabledwith a reason, never silently missing. - Model limits. If the chosen model cannot use tools, connectors show "Not available with this model" (Zed shows a "No tools" label and warning for MCP-incompatible models, research notes 03/08).
- Re-auth. A connector that loses auth mid-session flips to
NeedsAuthand the "+" gets an amber dot; no modal interrupts typing. - Very fast actions. Upload picker returns instantly → menu is already closed; no flash of the item's loading state under 150 ms.
Notes for AI
- Import
ToolsMenufromoxyn_dioxusand includeCOMPOSER_CSSplus the token stylesheet once. - A GPUI version exists:
ToolsMenuElinoxyn_gpui. - Props to set first:
tools. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.