Repository navigation
Agent: set the model's effort on a slider in the model chip - #1520
Conversation
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.
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.
Master moved the Web switch from the composer to Settings > Tools. The chip keeps #1520's quieter detail value and loses the highlight state that only the Web chip used; the keyboard walk test lands on Attachments one step sooner, since the model chip and thinking button are one control.
ab003cb to
c0a95ee
Compare
c54ee24 to
c065f90
Compare
|
Going to add the categories PR stack on top of this: #1538 |
|
A few changes I would like before this merges, mostly so the panel is driven by the server instead of tables in the app. 1. Keep this PR to the slider; take the model groups out. 2. Use the server's default effort, not Medium. 3. Reset goes to that same server default. 4. Switching models takes the new model's default. What is remembered: one model and effort pair, and only when the user picks it themselves on the New Task view. Opening an existing task that uses another model or level does not change it. There is no memory per model. Example:
Someone who always wants a non-default level on one model and switches models a lot will have to set it again each time. I'm fine with that for now for the sake of consistency, and we can revisit it later. 5. Tone the slider down a little. |
The model panel kept its own table of model ids to sections and its own list of Popular models, so a model deployed after a release listed under More models until the next one. The catalog now serves groups and badges, and #1540 builds the sections from it; until then the panel lists the models flat, in the catalog's order. The group headings, the Popular badge, its theme tokens and their strings go with the table.
A model with no remembered level started at Medium, moved to the nearest level it accepts, and a switch carried the previous model's level over. Both now take the model's `default_effort` from the catalog, which follows the model makers' recommendations (Max for Kimi K3.1 Pro, Kimi K3 and GLM 5.3, High for DeepSeek V4.1 Flash); a model the catalog gives no default it accepts keeps the old rule. The runtime serves that level with the levels, and Reset to recommended returns to it. New Task remembers one model and level, and only what the user picks there: picking a level remembers it with the model, and picking another model starts that model at its default and forgets the level. A task's picks, and opening a task, leave it alone, so a task's model pick no longer becomes the default. A level picked for a task's next model waits in the runtime for the switch, instead of riding on the account default.
The slider was larger than the model rows above it and glowed strongly at the top level, so it pulled the eye from the model list. The track is 24 px instead of 36, the thumb 27 (30 held) instead of 40 (44), and the dots 4 instead of 5; the panel's status line keeps the slider's new height. The fill's glow, the thumb's shadows, its held glow, the bloom where a level lands, the top level's halo and the brain's spark there are all softer and smaller.
|
Done, in three commits on top of a merge of master (nothing rewritten):
App suite: 1,400 passed, 0 failed. The screenshots in the description predate these changes. |
# Conflicts: # apps/maple-agent/app/src/ui/chat/composer.rs # apps/maple-agent/crates/maple-agent/src/agent/runtime.rs
Current review stack
Standalone on
master; not part of a stack.The effort slider in the model chip's panel. #1540 is stacked on this branch and adds the catalog's model groups.
Review changes from @AnthonyRonning's comment, as three commits on top of a merge of master
ab27a666(no commits were rewritten):reasoning.default_effort; Medium (or the nearest accepted level) applies only when the catalog gives none. A paired computer on an older build doesn't send the default, so Reset is hidden there.Local tests on this head: app suite 1,400 passed, 0 failed, 3 ignored; the runtime library's thinking, new-task, switch and config tests pass. Overlaps #1516 in
composer.rs(4 hunks); whichever lands second gets an update from me. The screenshots and recording below predate these changes: they show the grouped list and the larger slider.Current head:
98ed2861.The original scope and validation are retained below.
Moved from #1511 so the branch lives in this repo. Same commits, plus a merge of master; earlier discussion is on #1511.
The model list's grouping is served by the catalog (#1538) and rendered by #1540; it is not part of this PR.
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:
/modelopens 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.reasoning.default_effort). It rests, dimmed, while that is the level. Every stop is the same plain dot.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:
Changes of state morph instead of swapping, after torph:
MorphTextelement: 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).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 and level heat. The recommended level comes from the runtime, which reads the catalog'sdefault_effort.ui/chat/composer.rs:model_menudocks 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); andMenuItem::keep_open, for a row like Retry whose result shows in the menu.ui/chat/thinking.rs:thinking_menuis removed.pick_thinkingno 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 inthinking_saved.ChatPopup::ThinkingandComposerControl::Thinkingare removed;ChatPopup::Modelis the panel. Application Vim's row loses one stop.chat-effort,chat-effort-reset,chat-effort-faster,chat-effort-deeper,chat-model-effort-chip(the chip's accessible name, "Kimi K3, High effort"). Spanish revisions are recorded. New icons:rotate-ccw(Lucide) andeffort-burst, the brain's ring of rays.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_cfgsin the macOS objc files,nonminimal_boolin five untouched files).New tests:
/modelopens the same panel.default_effort; New Task remembers one model and level, and a pick inside a task leaves it.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:
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.
Stills, from the head of this branch:
Not in this PR
Model::thinking_levels). Collapsing it to Off / On is a runtime change and belongs in its own PR.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.