Skip to content
Back

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-control
MCP
Dioxus
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-control
Rust
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

PropTypeDefaultDescription
viewrequiredEffortView—The frame from `EffortControl::view`.
supportrequiredReasoningSupport—The model's reasoning support.
variantString"signal-bars"`segmented` · `signal-bars` · `slider` · `chevrons` · `toggle` · `menu`.
openboolDefault::default()Menu open.
modelStringDefault::default()Model name for the disabled tooltip.
on_toggleEventHandler<()>—Chip pressed.
on_pickEventHandler<EffortSetting>—A setting chosen.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
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: radiogroup with radio items; slider and dial: slider with aria-valuemin, aria-valuemax, aria-valuenow (index) and aria-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 and glyph variants, 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
TransitionDurationDelayEasing / springNotes
Hover bg80 ms0ease-out—
Press~120 ms0spring 600 / 30—
Menu open / close~200 ms / 120 ms0spring 380 / 32 / ease-insame as model popover
Signal-bar fill / drain140 ms per bar30 ms staggerease-out—
Ring arc tween220 ms0cubic-bezier(0.22, 1, 0.36, 1)—
Slider thumb snap~160 ms0spring 520 / 34—
Detent tick90 ms0ease-out—
Label roll220 ms0cubic-bezier(0.22, 1, 0.36, 1)—
Key auto-repeat (Alt+. held)180 ms interval400 ms initial——
Ignition charge ramp150 ms0linear[research 08 §1.1]
Ignition Wave A / B1000 / 1300 ms0cubic in-out, linear envelope33 ms tick in source; GPUI may render at display rate with the same envelope
Ignition Aurora A / B1300 / 1600 ms0cubic in-out—
Ignition Pulse A / B900 / 1250 ms0cubic in-out—
Sparks100 ms / frame900 msstep—
Ignition cool-down (no replay)10 s——proposed
Discharge200 ms0ease-out—
Clamped note in / hold / out160 / 2400 / 160 ms0ease-out / — / ease-in—
Hide (unsupported)160 ms0ease-in-outneighbours glide
Reduced motionno bands, no sparks, no rolls; glyph and tint change instantly with an 80 ms opacity crossfade; bars set instantly—linearCodex 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: menu variant; 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: PendingNext persists; 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 EffortChip from oxyn_dioxus and include COMPOSER_CSS plus the token stylesheet once.
  • A GPUI version exists: EffortChipEl in oxyn_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.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI