Effort control
How hard the model thinks: signal bars, segments, a slider, chevrons, a menu or a toggle; a change made mid-run applies to the next message.
oxyn add effort-controlDioxus
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}Rendered from Rust at build time · goes live when visible
When to use
- Reasoning models expose a dial between "answer fast" and "think hard".
- The effort control lives in the composer row next to the model pill (or inside the model popover in the combined layout).
- The user is deciding how much time and how many tokens the next turn may spend thinking.
- They need to see the current level at a glance, change it in one gesture or one key, know which levels this model allows, and understand when the control does nothing (non-reasoning model).
When not to use
- The model menu of an AI chat: use Model Picker instead.
- Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
- The prompt box for an agent, in six layouts: use Composer instead.
Installation
Effort control is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add effort-controlRust
use crate::oxyn::{EffortChip, COMPOSER_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{EffortChip, COMPOSER_CSS};
Usage
Dioxus · rust
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}Examples
Signal bars
Bars that fill.
Code
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}Segmented
Low to Max segments.
Code
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
variant: "segmented",
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}Menu
A menu with descriptions.
Code
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
variant: "menu",
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}Pending
Lowered mid-run, applies next turn.
→ Low
Code
let mut effort = use_signal(|| EffortControl::new(EffortSetting::Level(EffortLevel::High)));
let view = effort.write().view(&model.caps.reasoning, clock.now());
rsx! {
EffortChip {
view: view,
support: model.caps.reasoning.clone(),
on_pick: move |e: EffortSetting| effort.write().commit(e, &agent.state(), &support, clock.now()),
}
}API reference
EffortChip
| Prop | Type | Default | Description |
|---|---|---|---|
viewrequired | EffortView | — | The frame from `EffortControl::view`. |
supportrequired | ReasoningSupport | — | The model's reasoning support. |
variant | String | "signal-bars" | `segmented` · `signal-bars` · `slider` · `chevrons` · `toggle` · `menu`. |
open | bool | Default::default() | Menu open. |
model | String | Default::default() | Model name for the disabled tooltip. |
on_toggle | EventHandler<()> | — | Chip pressed. |
on_pick | EventHandler<EffortSetting> | — | A setting chosen. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Alt.orAlt, | Raise / lower (from the composer) |
| ←or→ | Move between levels (segmented, slider) |
Accessibility
- Segmented and menu are a radiogroup; slider is a slider with aria-valuetext ("High, deeper reasoning, slower").
- Tier colours never carry meaning alone: label and glyph shape change too.
From the spec
- Segmented / menu:
radiogroupwithradioitems; slider and dial:sliderwitharia-valuemin,aria-valuemax,aria-valuenow(index) andaria-valuetext("High, deeper reasoning, slower"). - Labels per state: "Thinking effort: High. Change effort", "Thinking effort: Max, applies to your next message", "Thinking effort unavailable: Sonnet 5 doesn't use adjustable reasoning", "Thinking effort set by workspace: Medium".
- Live region (polite): on commit "Effort set to Max"; on clamp "Effort lowered to High, Ultra isn't available on Sonnet 5"; ignition itself is decorative (
aria-hidden). - Tier colours never carry meaning alone: label + glyph shape always change too.
- Ignition bands keep draft text contrast ≥ 4.5:1 (alpha cap 0.6 and text layer above the wash; verify per theme in the Studio contrast check).
- No flashing above 3 Hz: Pulse style must stay under 3 flashes per second (it does at ≥ 900 ms).
- Focus order: model pill → effort → mode → permission → context → send.
Motion & interaction
- Hover / press / focus: same chip grammar as the model pill (bg fade, 0.97 press spring, 2 px ring).
- Signal bars glyph: 4 bars in a 14 × 14 px box, bar width 2 px, gap 1.5 px, heights 4 / 7 / 10 / 13 px. Filled bars = level position scaled to 4 (a 7-level ladder maps 1,1,2,2,3,4,4). Raising fills the next bar bottom-up (scaleY 0 → 1); lowering drains top-down.
- Chevrons glyph:
›(neutral) →›amber (tier A) →»violet (tier B); the glyph is also the composer prompt glyph in TUI andglyphvariants, the Codex pattern [research 08 §1.1]. - Ring glyph: quarter-filled ring
○ ◔ ◑ ◕ ●style (our own drawing, 12 px, 1.5 px stroke); arc length tweens on change. - Slider detents: the thumb snaps to the nearest detent with a spring; passing a detent while dragging gives a 1 px thumb "tick" (scale 1.08 → 1) and an optional haptic on touch.
- Label roll: level label rolls up on raise, down on lower (tabular width fixed to the longest label).
- Ignition (re-implemented from Codex CLI numbers; Codex licence is permissive, see §10):
- Three styles Wave / Aurora / Pulse, picked at random and never repeating the previous style.
- Durations for tier A / tier B: Wave 1000 / 1300 ms, Aurora 1300 / 1600 ms, Pulse 900 / 1250 ms.
- Accent "charge" on the prompt glyph ramps in over 150 ms; glyph accent alpha 0.86.
- Bands painted across the composer background, alpha capped at 0.6; colours (dark bg) tier A (255,178,66), (255,214,120), (255,120,60); tier B (186,130,255), (255,120,220), (120,170,255); light-bg sets are darker (Oxyn tokens
effort.ignite.a.*,effort.ignite.b.*). - Band profile: cosine crest; Wave half-width 9 columns (GUI: 9 × 8 px = 72 px proposed), Pulse 4.5 columns (36 px proposed); easing cubic in-out; envelope linear fade-in/out.
- Sparks
· ✦ ✧start at 900 ms, 100 ms per frame. - Protected regions: bands and sparks never paint over the draft text or attachment rows; in GUI the draft text layer sits above the wash, and the wash is clipped to the composer's padding box.
- All values in [research 08 §1.1, SRC].
- Discharge (ours): the tier tint and glyph colour fade to neutral over 200 ms; no bands.
- Clamped: label cross-fades to the clamped level, and a 1-line note slides down from the chip (y −4 → 0) and auto-hides after 2.4 s.
- PendingNext: dashed badge slides out of the chip; merges back when the run ends.
- Unsupported → Hidden: chip shrinks width → 0 and fades; neighbours glide left.
Timing
| Transition | Duration | Delay | Easing / spring | Notes |
|---|---|---|---|---|
| Hover bg | 80 ms | 0 | ease-out | — |
| Press | ~120 ms | 0 | spring 600 / 30 | — |
| Menu open / close | ~200 ms / 120 ms | 0 | spring 380 / 32 / ease-in | same as model popover |
| Signal-bar fill / drain | 140 ms per bar | 30 ms stagger | ease-out | — |
| Ring arc tween | 220 ms | 0 | cubic-bezier(0.22, 1, 0.36, 1) | — |
| Slider thumb snap | ~160 ms | 0 | spring 520 / 34 | — |
| Detent tick | 90 ms | 0 | ease-out | — |
| Label roll | 220 ms | 0 | cubic-bezier(0.22, 1, 0.36, 1) | — |
Key auto-repeat (Alt+. held) | 180 ms interval | 400 ms initial | — | — |
| Ignition charge ramp | 150 ms | 0 | linear | [research 08 §1.1] |
| Ignition Wave A / B | 1000 / 1300 ms | 0 | cubic in-out, linear envelope | 33 ms tick in source; GPUI may render at display rate with the same envelope |
| Ignition Aurora A / B | 1300 / 1600 ms | 0 | cubic in-out | — |
| Ignition Pulse A / B | 900 / 1250 ms | 0 | cubic in-out | — |
| Sparks | 100 ms / frame | 900 ms | step | — |
| Ignition cool-down (no replay) | 10 s | — | — | proposed |
| Discharge | 200 ms | 0 | ease-out | — |
| Clamped note in / hold / out | 160 / 2400 / 160 ms | 0 | ease-out / — / ease-in | — |
| Hide (unsupported) | 160 ms | 0 | ease-in-out | neighbours glide |
| Reduced motion | no bands, no sparks, no rolls; glyph and tint change instantly with an 80 ms opacity crossfade; bars set instantly | — | linear | Codex also disables ignition without animation support [research 08 §1.1] |
Responsive behaviour
- signal-bars and chevrons fit a dense toolbar; segmented needs the most width.
Edge cases (spec)
- Long labels / i18n ("Erweitert"): chip width fixed to the longest label in the active ladder; slider end labels drop below 200 px width.
- Ladders of different lengths (2 to 8 levels): segmented shows ≤ 4, otherwise menu; slider spacing = track width / (n − 1), min 16 px per detent, else falls back to menu.
- RTL: slider and bars mirror (low on the right); chevron glyphs mirror to
‹/«. - Tiny sizes (16–20 px): signal bars scale to 12 px box (heights 3/5/8/11), label hidden, tooltip only.
- Dense IDE panels:
menuvariant; ignition reduced to the glyph recolour (no bands) when the composer is < 280 px wide. - Touch: slider thumb hit area 44 px; dial becomes a horizontal wheel.
- Slow networks: effort is local state; nothing waits on the network.
- Very fast agents: if the turn ends within 300 ms of a mid-run change, skip
PendingNext. - Very slow agents:
PendingNextpersists; repeated changes just update the badge. - Model switch while menu open: menu re-renders with the new ladder; highlighted level clamps.
- Per-message override: a queued message keeps the effort it was queued with; its chip shows it.
- Ignition during typing: must never steal focus, move the caret or repaint draft glyphs.
- Unfocused window: ignition does not play if the window is unfocused at commit time (shared clock slows in background, architecture.md); the glyph simply recolours.
Notes for AI
- Import
EffortChipfromoxyn_dioxusand includeCOMPOSER_CSSplus the token stylesheet once. - A GPUI version exists:
EffortChipElinoxyn_gpui. - Props to set first:
view,support. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.