Skip to content

Agent: set the model's effort on a slider in the model chip - #1511

Closed
matthewrball wants to merge 20 commits into
MaplePrivacyLabs:masterfrom
matthewrball:ux/effort-slider
Closed

matthewrball wants to merge 20 commits into
MaplePrivacyLabs:masterfrom
matthewrball:ux/effort-slider

Conversation

@matthewrball

@matthewrball matthewrball commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

The composer's model chip and the separate brain (thinking) button become one control. The chip names the model and, in a quieter grey, its effort: "Kimi K3 High". Pressing it opens the model list with the selected model's effort slider docked under it:

  • Models first. The models a task can use, the selected one checked. A pick switches the model and closes the panel, as the plain list did, so changing models still takes two clicks. /model opens the same panel. Design review pointed out that Maple's users switch models more often than effort, unlike apps built around one frontier model, so the model leads and effort sits under it.
  • Effort. Under the models: the level, tinted by how hard the model thinks, over a thick track with one dot per level the selected model offers. Drag the thumb, click a stop, or use Left and Right; Up and Down move through the models and Enter picks one. The level under the thumb previews while you drag, and the pick saves on release.
  • Reset. ↺ returns to the level the model runs at when nobody picked one: the runtime's own fallback, Medium or the nearest level the model accepts. It rests, dimmed, while that is the level. Every stop is the same plain dot.
  • No slider when there is nothing to slide. A model that does not think, levels still loading, or levels that failed to load show a status line where the track would be. When they failed, a Retry row above it reloads them; it's a row so the keyboard reaches it, and the panel stays open.
  • Long lists. Past 480 px the models scroll and the effort footer stays in view.
  • Groups. The models list under Most capable, Uncensored, and Fast & cheap, in that order, with a Popular badge on DeepSeek Uncensored. On dark it's coral on the dark coral container (7:1); on light, where coral read like an alert, it's dark grey on a grey pill a step darker than a highlighted row, so it stays visible when the row is hovered (5.2:1). New badge_fill and badge_text tokens carry the pair, held to 4.5:1 by the contrast test. The catalog carries no group yet, so for now the app keeps a table of the current model ids. A model deployed after it lists under More models until the table learns it; once the catalog serves groups (the plan in the comment to Anthony), the table goes.

Adapting to each model's levels

Models offer different sets of levels: GLM 5.3, GLM-5.3 Flash and both Kimis offer Low / High / Max, DeepSeek V4.1 Flash offers Off / Low / High / Extra high / Max, and Gemma 4 offers Off through High. The slider spreads whatever the model offers evenly across the track, so it never shows a stop the model rejects. Each level also has a heat on one scale shared by every model, from Off to Max, and that heat drives the fill, its glow and the header colour. High is the same colour on every model even when it sits at a different stop. "Faster" and "Deeper" under the ends say which way is which.

Motion

The slider is built from a few springs, so it feels liquid:

  • Thumb. It follows the pointer through a stiff spring, so a drag is direct but smooth. It's drawn into each stop it passes, like a soft notch, and settles with a jelly overshoot on release. It stretches along its motion and squashes across it, lifts under the pointer, and glows in the level's colour while held. Off has no colour, so the thumb doesn't glow there, and the glow fades as it nears Off. The cursor is an open hand over the thumb and a closed hand while dragging.
  • Fill. Its edge is a spring close to critical damping, chasing the thumb. On a quick move right, a neck of fill thins between them. The fill never passes the thumb, so no orange shows beyond the white, whether sliding back or while the thumb settles in. Colour flows between the stops' heats instead of stepping.
  • Feedback. Dots swell as the fill flows over them. A drag ripples each stop it crosses and blooms once where it lets go; a click or reset ripples and blooms at the stop it picks. A key step only moves the thumb: no ripple, bloom, pulse, morph or spark. Hovering a stop shows a faint halo where a click would land.
  • Entrances. The panel fades in and the thumb settles from slightly large without a bounce, the fill already in place, since the panel opens on every model switch. The next opening glides the old dots to the new model's stops. When levels arrive or fail, the slider or the status line fades in, and the status line holds the slider's height so the panel doesn't jump.
  • Top level. When the thumb arrives at the model's top level (Max, or High on Gemma 4), the brain sparks: a warm flash behind it and a burst of rays. While the level stays at the top, the thumb keeps a warm halo and the chip's effort word turns from grey to the level's colour; the halo fades out, quicker than it came, when the thumb leaves. Opening the panel already at the top, or switching models onto it, shows the halo without the spark. Reduced motion and key steps keep the halo and the colour and skip the spark.

Changes of state morph instead of swapping, after torph:

  • A new MorphText element: letters both values share glide to their new places, leaving letters fade out, arriving ones rise in, and width and colour ease (400 ms, exponential ease-out).
  • It's used for the panel's level name and the chip's effort. "High" becomes "Extra high" by keeping its "igh", and the chip's width eases with it. During a drag or a key step the panel's name swaps at once, and it morphs on a click or reset.
  • The brain pulses once for a pick by pointer or reset, never for a key step, and doesn't replay when the panel reopens. Reset spins back one turn as it acts, once.

Everything asks for frames only while it moves; at rest the panel is idle. Reduced motion skips the springs and effects and jumps.

Saving

Picks stay optimistic, as before. A pick made while another is saving now waits instead of being dropped, and only the latest one goes out, for the task and model it was made on even if you switch away first. Sweeping the slider across stops saves at most one more time. The chip shows a waiting pick at once, as the panel does. When a save fails while a newer pick for the same model waits, only the newer one's result is reported. An effort pick keeps the panel open; a model pick closes it.

Implementation

  • ui/effort_slider.rs: the slider as a painted gpui element. Thumb, fill edge, lift and entrance are springs; notches, ripples, dot swells, bloom and the stop morph are timed effects. Its state is held by its owner, so a model switch still glides when the panel reopens.
  • ui/morph_text.rs: MorphText, a text element that morphs between values (a longest-common-subsequence match on letters, then glide, fade and rise).
  • ui/chat/effort.rs: the panel's effort footer, level heat, and recommended_level, which mirrors pi-ai's clamp_thinking_level(Medium).
  • ui/chat/composer.rs: model_menu docks the effort footer under the model rows and steps effort on Left and Right.
  • ui/popup.rs: Menu::on_adjust, so Left and Right step a control inside a menu where they would otherwise enter or leave a submenu; Menu::footer, content docked under the rows that stays in view while they scroll (the keyboard skips it); and MenuItem::keep_open, for a row like Retry whose result shows in the menu.
  • ui/chat/thinking.rs: thinking_menu is removed. pick_thinking no longer closes the popup. A pick made during a save waits behind it and goes out for its own task and model (save_thinking), and the save's result is handled in thinking_saved.
  • ChatPopup::Thinking and ComposerControl::Thinking are removed; ChatPopup::Model is the panel. Application Vim's row loses one stop.
  • New strings in English and Spanish: chat-effort, chat-effort-reset, chat-effort-faster, chat-effort-deeper, chat-model-effort-chip (the chip's accessible name, "Kimi K3, High effort"), the group headings chat-model-group-capable, -uncensored, -fast and -more, chat-model-popular, and chat-model-popular-row (the badged row's accessible name, "DeepSeek Uncensored, Popular"). Spanish revisions are recorded. New icons: rotate-ccw (Lucide) and effort-burst, the brain's ring of rays.
  • Chip row: the effort makes the chip wider than the old brain button. When the row runs out of room the chips wrap onto a second line beside Send, which with the context ring never shrinks. A chip only gives way when it is alone on its line, the model's name first, so the effort stays readable. On master a window about 760 px wide pushes Send out of the composer; a single shrinking row instead drew the effort word over Integrations.

Testing

  • cargo test -p maple-agent-app --bin maple-agent: 1361 passed, 3 ignored. Clippy is clean apart from two lint groups that already fail on master with the local toolchain (unexpected_cfgs in the macOS objc files, nonminimal_bool in five untouched files).

  • New tests:

    • Left and Right step through the selected model's own levels and stop at the ends, while Up, Down and Enter pick a model and close the panel.
    • The same point on the track is High on a Low / High / Max model and Low on an Off / Low / High / Extra high / Max model. A drag previews the level and its release picks it.
    • Reset goes to the recommended level and is inert at it.
    • The panel lists the models above the slider; a pick closes it, and /model opens the same panel.
    • Known models list in their groups, in the table's order; a model the table doesn't know lists last under More models; a catalog it knows none of shows no headers.
    • A model that does not think shows no slider.
    • recommended_level matches the runtime's fallback for each catalog shape.
    • The slider's spring settles with a small overshoot, and reduced motion jumps.
    • The top level's spark waits for the thumb to reach the end, plays once per arrival, and not for an opening already at the top; reduced motion shows the halo without it.
    • In a 760 px window the chips wrap: the model chip keeps its full size, no chip overlaps another, and none reaches under Send. The chat test fixture now follows the window's size so a test can narrow it.
    • A pick waiting behind a save still goes out for the model it was made on after another model is selected, and the failed save it replaces raises no notice.
    • Levels that failed to load offer Retry as a row the keyboard reaches; it keeps the panel open and loads them again.
  • The updated chip and application Vim tests cover the merged control. The composer-menu float test now lays the chat out in a column, as the app does: the taller panel needs the room above the composer that the app gives it.

  • Rendered in both themes with real fonts through gpui's headless Metal renderer, using the catalog's real model names and level sets (images below).

  • Live catalog. In a signed-in debug build (the local PR stack with this branch merged, before the top-level spark and the models-first panel), each model's levels came from the runtime: DeepSeek Uncensored and DeepSeek V4.1 Flash showed five stops, GLM 5.3 three, and Gemma 4 five (Off through High). To run this branch alone in its own profile, sign in once:

    cd apps/maple-agent && just build
    XDG_DATA_HOME="$HOME/Library/Caches/maple-effort/data" \
    XDG_CONFIG_HOME="$HOME/Library/Caches/maple-effort/config" \
    MAPLE_DISABLE_UPDATE_CHECK=1 ./target/debug/maple-agent

    The separate data root gives it its own store, sign-in and host, so it runs beside an installed or debug Maple Work.

Screenshots

Headless renders of this branch in a 900 px window, using the catalog's real model names and level sets.

Motion, recorded frame by frame at about 30 fps, so timing is approximate, before the models were grouped and before the motion fixes above. In order: the panel opens on DeepSeek's models and slider, a drag to Maximum (the brain sparks, the chip's effort turns coral) and down to Low, a one-click switch to GLM 5.3 that closes the panel, reopening on GLM's three stops, and the same to Gemma 4.

The model panel in motion: opening, effort drags, and one-click model switches

Stills, from the head of this branch:

Grouped, DeepSeek V4.1 Flash at High Grouped, light theme
The model panel with Most capable, Uncensored (Popular) and Fast and cheap groups above DeepSeek's slider The grouped model panel in the light theme, with the Popular badge in dark grey on a grey pill
GLM 5.3 at Maximum: three stops, warm halo, coral effort Light theme, Gemma 4 at Medium
The model panel on GLM 5.3 at Maximum, three stops The model panel on Gemma 4 at Medium in the light theme

Not in this PR

  • Groups served by the catalog. Models deploy without an app release, so the app's table can't keep up on its own: each new model lists under More models until a release adds it. Adding a model to a group should be part of releasing that model, with the catalog serving the group, its order and the Popular mark, and the app only rendering them. Flagged to @AnthonyRonning to decide how that's stored.
  • Gemma 4's slider shows Off / Minimal / Low / Medium / High, but Gemma only has a thinking switch: every level above Off means "on" on the server. That comes from the runtime's levels for models without effort tiers (Model::thinking_levels). Collapsing it to Off / On is a runtime change and belongs in its own PR.

The model chip and the separate thinking button become one control. The
chip names the model and, in a quieter grey, its effort ("Kimi K3 High"),
and pressing it opens an effort popover:

- The level in large type, tinted by how hard the model thinks, over the
  model's name. The name opens the model list, and a pick there returns
  to the popover on the new model's levels. Enter does the same from the
  keyboard. `/model` still opens the list on its own.
- A thick stepped slider with one stop per level the selected model
  offers: Low / High / Max on GLM and Kimi, Off through Max on DeepSeek,
  and so on. Drag it, click a stop, or press Left and Right. The level
  under the thumb previews while dragging and saves on release.
- Reset returns to the level the runtime uses when nobody picked one
  (Medium, or the nearest level the model accepts). That stop is drawn
  as a ring.
- A model that does not think, and levels that are loading, saving or
  unavailable (with Retry), show a status line in the slider's place.

Each level has a heat on one scale shared by every model. Heat drives
the fill, its glow and the label, so High is the same colour wherever
its stop sits. The thumb springs to its stop with a small overshoot,
lifts while held, and the dots glide to new stops after a model switch.
Frames are drawn only while something moves, and reduced motion jumps
instead of animating.

A pick made while another is saving now waits for it, and only the
latest waiting pick goes out. The popover stays open after a pick.

The level makes the chip wider than the old button. Send and the
context ring no longer shrink; when the row runs out of room, the
model's name truncates first and the level stays readable.

Menus get two hooks for content that is not rows: on_adjust, which Left
and Right call, and on_confirm, which Enter and Space call with no row
highlighted.
The reset is an icon button while it can act and a plain dimmed icon at the recommended level. Both arms now return an element of one type, so the popover still builds once icon buttons carry their own hover animation (#1509).
…state

Slider, as a few springs:

- The thumb follows the pointer through a stiff spring, so a drag is
  direct but smooth. It is drawn into each stop it passes as a soft notch,
  and on release it settles with a jelly overshoot. It stretches along
  its motion and squashes across it.
- The fill's edge is a softer spring chasing the thumb. When the thumb
  runs ahead, a neck of fill thins between them. When it runs back, the
  fill drains after it with a droplet at the tip.
- Dots swell as the fill flows over them. A ripple spreads from each stop
  a drag crosses and from each level that lands, and the thumb blooms in
  the level's colour.
- Colour flows between the stops' heats instead of stepping.
- Opening the popover, the content rises in, the thumb pops and the fill
  pours to it.
- The hand cursor opens over the thumb and closes while it is held.

Text and state, after torph's TextMorph: a new MorphText element. Letters
two values share glide to their new places, leaving letters fade out,
arriving ones rise in, and width and colour ease between them. The
popover's level name and the chip's effort use it, so "High" becomes
"Extra high" by keeping its "igh". The brain gives a small pulse as a
level lands, and reset spins back as it acts.

Everything asks for frames only while it moves, and reduced motion jumps
instead.
The fill's edge still trails a thumb that runs ahead, but it no longer
passes it. A thumb running back takes the edge with it, so the draining
tail and its droplet are gone. The edge's spring is now close to critical
damping (stiffness 220, damping ratio 0.9), so it doesn't slosh past the thumb on
the opening pour or when the thumb settles. The fill's rounded end stays
under the thumb, and the thumb's squash stops at the track's height. On
open the thumb now settles in from slightly large (112%) instead of
popping up from small, so it covers the track from the first frame.

Changes of state:

- The popover's level name swaps at once while a drag crosses stops, and
  morphs only on a pick, a key step or reset. A morph per stop garbled a
  fast sweep.
- Arriving letters start fading in at 10% of a morph rather than 25%, so
  the text is never blank between values.
- Reset's spin plays once, when it acts. It no longer replays every time
  the popover opens.
@matthewrball

Copy link
Copy Markdown
Collaborator Author

@AnthonyRonning flagging a decision for model grouping. It's not in this PR.

We want the model list grouped again, like before: complex thinking, cheap and fast, and uncensored, with uncensored second. Models deploy without an app release, so if the grouping lives in the app, each new model sits ungrouped (or in the wrong group) until the next release ships.

So adding a model to a group should be part of releasing the model. The catalog would serve each model's group and the group order, and the app would only render it. Can you decide how and where that's stored on the model side? The app side is small once the catalog carries it.

Arriving at the selected model's top level (Max, or High on Gemma 4) by drag, click or arrow key flashes a warm disc behind the popover's brain and bursts a ring of rays from it. While the level stays at the top, the thumb keeps a warm halo, the fill glows a little more, and the chip's effort word turns from grey to the level's colour. An opening already at the top, or a model switch onto it, shows the halo without the spark; reduced motion keeps the halo and skips the spark.
Design review: Maple's users switch models more often than effort, so the chip now opens the model list with the selected model's effort slider docked under it, instead of an effort popover whose model name led to the list. A model pick closes the panel, as the plain list did, so switching models takes two clicks again; Left and Right step the effort, Up, Down and Enter pick a model. /model opens the same panel. Menu gains a footer that stays in view while the rows scroll, and loses on_confirm, which only the old popover used. ChatPopup::Effort, effort_return and the chat-effort-change-model string go with it.
Most capable, Uncensored, then Fast & cheap, as the list was grouped before, with a Popular badge on DeepSeek Uncensored. The catalog carries no group yet, so the app keeps a table of the current model ids; a model deployed after it lists under More models, and a catalog the table knows none of shows no headers at all.
The slider and the status line cross-fade when levels arrive, and the status line holds the slider's height, so the panel no longer jumps. A key step moves the thumb but plays no ripple, bloom, pulse, morph or spark. A drag ripples the stops it crosses and blooms once where it lets go, instead of a landing ripple, bloom and brain pulse at every stop. The brain pulses for a pointer pick or reset only, and never replays when the panel reopens. The halo fades out when the thumb leaves the top. Opening the panel, which happens on every model switch, settles the thumb without a bounce and with the fill already in place.
The ring that marked the level reset returns to read as a different kind of stop. Reset still dims at that level.
The brand coral on a grey pill read at under 2:1 in the light theme. The badge now sets deep coral on the soft coral container, 5.1:1 in light and 7:1 in dark, from a new accent_text token the contrast test holds to 4.5:1.
@matthewrball
matthewrball marked this pull request as ready for review November 9, 2026 07:30
@matthewrball

Copy link
Copy Markdown
Collaborator Author

Moved to #1520 so the branch lives in this repo and can sit at the top of the bundle 2 stack (#1519). Same commits, plus a merge of the layer below. The model-grouping question for @AnthonyRonning above is still open; #1520's description links it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants