Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

feat(composer): refine model picker with a text rail and segmented reasoning

vastsa2fa78dea4c1c
diff --git a/apps/desktop/src/features/chat/composer/ComposerModelList.tsx b/apps/desktop/src/features/chat/composer/ComposerModelList.tsx
index 60869610e..d80f0e340 100644
--- a/apps/desktop/src/features/chat/composer/ComposerModelList.tsx
+++ b/apps/desktop/src/features/chat/composer/ComposerModelList.tsx
@@ -1,7 +1,7 @@
import { formatTokenCount, type ModelInfo, type ProviderPublic } from "@pi-desktop/shared";
import type { TFunction } from "i18next";
import type { CSSProperties, RefObject } from "react";
-import { IconCheck, IconClock, IconEye, IconSearch, IconSparkles } from "../../../components/icons";
+import { IconCheck, IconEye, IconSearch, IconSparkles, IconX } from "../../../components/icons";
import {
composerModelBadges,
composerModelBinding,
@@ -17,18 +17,6 @@ export type ComposerModelGroup = {
models: ModelInfo[];
};
-/** First visible character of the source name; the rail's only glyph. */
-export function providerMonogram(name: string): string {
- return Array.from(name.trim())[0]?.toUpperCase() ?? "?";
-}
-
-/** Stable per-source hue so a provider keeps its colour across sessions. */
-export function providerHue(providerId: string): number {
- let hash = 0;
- for (const char of providerId) hash = (hash * 31 + char.charCodeAt(0)) >>> 0;
- return hash % 360;
-}
-
type ModelRowProps = {
t: TFunction;
provider: ProviderPublic;
@@ -97,7 +85,7 @@ function ModelRow({ t, provider, model, index, highlighted, active, showProvider
</span>
</span>
<span className="composer-model-check-slot" aria-hidden="true">
- {active ? <IconCheck size={14} className="composer-model-check" /> : null}
+ {active ? <IconCheck size={13} className="composer-model-check" /> : null}
</span>
</button>
);
@@ -111,12 +99,14 @@ function ModelRow({ t, provider, model, index, highlighted, active, showProvider
export function ComposerModelList({
t, query, setQuery, modelSearchRef, modelListRef, modelGroups,
modelHighlight, setModelHighlight, selectedProviderId, selectedModelId, selectModel,
- recentEntries, sections, activeSection, selectSection, showSectionRail, searching, paneRows,
+ recentEntries, sections, activeSection, sectionStep, selectSection, showSectionRail, searching, paneRows,
}: {
paneRows: number;
recentEntries: Array<{ provider: ProviderPublic; model: ModelInfo }>;
sections: ComposerModelSection[];
activeSection: string | null;
+ /** Direction of the last rail move; 0 before the first move. */
+ sectionStep: number;
selectSection: (id: string) => void;
showSectionRail: boolean;
searching: boolean;
@@ -135,6 +125,7 @@ export function ComposerModelList({
const isActive = (provider: ProviderPublic, model: ModelInfo) =>
selectedProviderId === provider.id && sameComposerModelId(selectedModelId ?? "", model.modelId);
const flatCount = recentEntries.length + modelGroups.reduce((sum, group) => sum + group.models.length, 0);
+ const railIndex = sections.findIndex((section) => section.id === activeSection);
let flatIndex = recentEntries.length;
return <>
<label className="composer-model-search">
@@ -152,6 +143,22 @@ export function ComposerModelList({
onChange={(event) => setQuery(event.target.value)}
onBlur={() => setModelHighlight(-1)}
/>
+ {query ? (
+ <button
+ type="button"
+ className="composer-model-search-clear"
+ aria-label={t("settings.clearSearch")}
+ // Keep focus in the field so typing continues after the clear.
+ onMouseDown={(event) => event.preventDefault()}
+ onClick={() => {
+ setQuery("");
+ setModelHighlight(-1);
+ modelSearchRef.current?.focus();
+ }}
+ >
+ <IconX size={11} aria-hidden="true" />
+ </button>
+ ) : null}
</label>
<div
className="composer-model-body"
@@ -160,6 +167,12 @@ export function ComposerModelList({
>
{showSectionRail ? (
<div className="composer-model-rail" role="group" aria-label={t("chat.modelSources")}>
+ <span
+ className="composer-model-rail-indicator"
+ aria-hidden="true"
+ data-hidden={railIndex < 0 ? "true" : undefined}
+ style={{ "--rail-index": Math.max(railIndex, 0) } as CSSProperties}
+ />
{sections.map((section) => {
const label = section.kind === "recent" ? t("chat.recentModels") : section.label;
const current = section.id === activeSection;
@@ -174,19 +187,6 @@ export function ComposerModelList({
className={`composer-model-rail-item ${current ? "active" : ""}`}
onClick={() => selectSection(section.id)}
>
- {section.kind === "recent" ? (
- <span className="composer-model-rail-avatar is-recent" aria-hidden="true">
- <IconClock size={12} />
- </span>
- ) : (
- <span
- className="composer-model-rail-avatar"
- aria-hidden="true"
- style={{ "--provider-hue": providerHue(section.provider.id) } as CSSProperties}
- >
- {providerMonogram(section.label)}
- </span>
- )}
<span className="composer-model-rail-label">{label}</span>
{section.kind === "provider" ? (
<span className="composer-model-rail-count">{section.count}</span>
@@ -197,46 +197,53 @@ export function ComposerModelList({
</div>
) : null}
<div className="composer-model-list" ref={modelListRef}>
- {recentEntries.length > 0 ? (
- <div className="composer-model-group" role="group" aria-label={t("chat.recentModels")}>
- {recentEntries.map(({ provider, model }, index) => (
- <ModelRow
- key={`${provider.id}:${model.modelId}`}
- t={t} provider={provider} model={model} index={index}
- highlighted={modelHighlight === index}
- active={isActive(provider, model)}
- showProvider selectModel={selectModel}
- />
- ))}
- </div>
- ) : null}
- {modelGroups.map((group) => (
- <div
- key={group.provider.id}
- className="composer-model-group"
- role="group"
- aria-label={group.providerDisplayName}
- >
- {searching ? (
- <div className="composer-model-group-label">{group.providerDisplayName}</div>
- ) : null}
- {group.models.map((model) => {
- const index = flatIndex++;
- return (
+ {/* Keyed by source so a rail move replays the entry motion once. */}
+ <div
+ key={activeSection ?? "search"}
+ className="composer-model-pane"
+ data-step={sectionStep === 0 ? undefined : sectionStep < 0 ? "back" : "forward"}
+ >
+ {recentEntries.length > 0 ? (
+ <div className="composer-model-group" role="group" aria-label={t("chat.recentModels")}>
+ {recentEntries.map(({ provider, model }, index) => (
<ModelRow
- key={`${group.provider.id}:${model.modelId}`}
- t={t} provider={group.provider} model={model} index={index}
+ key={`${provider.id}:${model.modelId}`}
+ t={t} provider={provider} model={model} index={index}
highlighted={modelHighlight === index}
- active={isActive(group.provider, model)}
- showProvider={false} selectModel={selectModel}
+ active={isActive(provider, model)}
+ showProvider selectModel={selectModel}
/>
- );
- })}
- </div>
- ))}
- {flatCount === 0 ? (
- <div className="composer-model-empty">{t("chat.noModelResults")}</div>
- ) : null}
+ ))}
+ </div>
+ ) : null}
+ {modelGroups.map((group) => (
+ <div
+ key={group.provider.id}
+ className="composer-model-group"
+ role="group"
+ aria-label={group.providerDisplayName}
+ >
+ {searching ? (
+ <div className="composer-model-group-label">{group.providerDisplayName}</div>
+ ) : null}
+ {group.models.map((model) => {
+ const index = flatIndex++;
+ return (
+ <ModelRow
+ key={`${group.provider.id}:${model.modelId}`}
+ t={t} provider={group.provider} model={model} index={index}
+ highlighted={modelHighlight === index}
+ active={isActive(group.provider, model)}
+ showProvider={false} selectModel={selectModel}
+ />
+ );
+ })}
+ </div>
+ ))}
+ {flatCount === 0 ? (
+ <div className="composer-model-empty">{t("chat.noModelResults")}</div>
+ ) : null}
+ </div>
</div>
</div>
</>;
diff --git a/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx b/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
index 11c24b396..b9142e6ff 100644
--- a/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
+++ b/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
@@ -43,6 +43,7 @@ export function ComposerModelPicker({
setOpen,
sections,
activeSection,
+ sectionStep,
selectSection,
showSectionRail,
paneRows,
@@ -116,13 +117,16 @@ export function ComposerModelPicker({
modelSearchRef={modelSearchRef} modelListRef={modelListRef}
modelGroups={modelGroups} modelHighlight={modelHighlight}
recentEntries={recentEntries} sections={sections}
- activeSection={activeSection} selectSection={selectSection}
+ activeSection={activeSection} sectionStep={sectionStep} selectSection={selectSection}
showSectionRail={showSectionRail} searching={searching} paneRows={paneRows}
setModelHighlight={setModelHighlight} selectModel={selectModel}
selectedProviderId={selectedProviderId} selectedModelId={selectedModelId}
/>
{thinkingMenuLevels.length > 1 ? (
<div className="composer-model-reasoning">
+ <span className="composer-model-reasoning-label" aria-hidden="true">
+ {t("chat.reasoningShort")}
+ </span>
<ThinkingLevelSlider
key={`${selectedProviderId}:${selectedModelId}:${thinkingMenuLevels.join("|")}`}
levels={thinkingMenuLevels}
diff --git a/apps/desktop/src/features/chat/composer/ThinkingLevelSlider.tsx b/apps/desktop/src/features/chat/composer/ThinkingLevelSlider.tsx
index a2188b261..48af4561e 100644
--- a/apps/desktop/src/features/chat/composer/ThinkingLevelSlider.tsx
+++ b/apps/desktop/src/features/chat/composer/ThinkingLevelSlider.tsx
@@ -13,7 +13,11 @@ type Props = {
commit: (level: SessionThinkingLevel) => Promise<boolean>;
};
-/** Native input owns interaction; the decorative thumb owns visual motion. */
+/**
+ * Segmented reasoning control. A native range overlays the segments and owns
+ * keyboard, drag and accessibility; the raised pill (the thumb) and the labels
+ * underneath it are decoration that share the range's column geometry.
+ */
export function ThinkingLevelSlider({ levels, level, label, commit }: Props) {
const [pendingIndex, setPendingIndex] = useState<number | null>(null);
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
@@ -48,8 +52,8 @@ export function ThinkingLevelSlider({ levels, level, label, commit }: Props) {
data-dragging={dragging ? "true" : undefined}
onPointerMove={(event) => {
if (event.pointerType === "touch" || !rail.current) return;
- // The native range covers the decorative dots. Resolve both rows against
- // the same equal-width columns, including the gap between dot and label.
+ // The native range covers the labels; resolve the pointer against the
+ // same equal-width columns the labels and the pill use.
const bounds = rail.current.getBoundingClientRect();
const next = Math.floor((event.clientX - bounds.left) / bounds.width * levels.length);
setHoveredIndex(next >= 0 && next < levels.length ? next : null);
@@ -62,13 +66,14 @@ export function ThinkingLevelSlider({ levels, level, label, commit }: Props) {
} as CSSProperties}
>
<div className="composer-thinking-rail" ref={rail}>
- <div className="composer-thinking-dots" aria-hidden="true">
- {levels.map((candidate, stop) => <span key={candidate}
- data-filled={stop < index ? "true" : undefined}
+ <span className="composer-thinking-thumb" aria-hidden="true" />
+ <div className="composer-thinking-ticks" aria-hidden="true">
+ {levels.map((candidate, stop) => <button key={candidate} type="button" tabIndex={-1}
data-hovered={hoveredIndex === stop ? "true" : undefined}
- className={`composer-thinking-dot ${index === stop ? "active" : ""}`} />)}
+ className={`composer-thinking-tick ${index === stop ? "active" : ""}`}
+ onMouseDown={(event) => event.preventDefault()}
+ onClick={() => select(stop)}>{candidate}</button>)}
</div>
- <span className="composer-thinking-thumb" aria-hidden="true" />
<input
type="range"
className="composer-thinking-range"
@@ -92,12 +97,5 @@ export function ThinkingLevelSlider({ levels, level, label, commit }: Props) {
}}
/>
</div>
- <div className="composer-thinking-ticks" aria-hidden="true">
- {levels.map((candidate, stop) => <button key={candidate} type="button" tabIndex={-1}
- data-hovered={hoveredIndex === stop ? "true" : undefined}
- className={`composer-thinking-tick ${index === stop ? "active" : ""}`}
- title={candidate} onMouseDown={(event) => event.preventDefault()}
- onClick={() => select(stop)}>{candidate}</button>)}
- </div>
</div>;
}
diff --git a/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts b/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
index bfa85a4ae..734ff3ded 100644
--- a/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
+++ b/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
@@ -80,6 +80,8 @@ export function useComposerModelMenu({
const [open, setOpen] = useState(false);
// null follows the default section; a rail click pins one until close.
const [section, setSection] = useState<string | null>(null);
+ // Direction of the last rail move, so the pane slides in from that side.
+ const [sectionStep, setSectionStep] = useState(0);
const [query, setQuery] = useState("");
const [modelHighlight, setModelHighlight] = useState(-1);
const modelSearchRef = useRef<HTMLInputElement>(null);
@@ -263,6 +265,7 @@ export function useComposerModelMenu({
useEffect(() => {
if (open) return;
setSection(null);
+ setSectionStep(0);
setQuery("");
setModelHighlight(-1);
}, [open]);
@@ -338,6 +341,10 @@ export function useComposerModelMenu({
/** Show one rail section. Picking a source ends any search in progress. */
const selectSection = (id: string) => {
+ const from = sections.findIndex((candidate) => candidate.id === activeSection);
+ const to = sections.findIndex((candidate) => candidate.id === id);
+ // The pane is keyed by section, so an unchanged section never replays.
+ setSectionStep(to < from ? -1 : 1);
setSection(id);
setQuery("");
setModelHighlight(-1);
@@ -360,6 +367,12 @@ export function useComposerModelMenu({
if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;
if (event.key === "Escape") {
event.preventDefault();
+ // A search in progress is the innermost state: Escape clears it first.
+ if (query && event.target instanceof HTMLInputElement) {
+ setQuery("");
+ setModelHighlight(-1);
+ return;
+ }
setOpen(false);
return;
}
@@ -388,6 +401,7 @@ export function useComposerModelMenu({
setOpen,
sections,
activeSection: searching ? null : activeSection,
+ sectionStep,
selectSection,
showSectionRail: sections.length > 1,
paneRows,
diff --git a/apps/desktop/src/styles/composer-menus.css b/apps/desktop/src/styles/composer-menus.css
index 9cd16b2b8..4bec87b5a 100644
--- a/apps/desktop/src/styles/composer-menus.css
+++ b/apps/desktop/src/styles/composer-menus.css
@@ -111,16 +111,19 @@
*/
width: min(320px, calc(100vw - 24px));
padding: 6px;
+ border-radius: var(--radius-lg);
}
-/* With several sources the menu becomes two panes: a source rail on the
- left and the selected source's models on the right. */
+/* With several sources the menu becomes two panes: a text-only source rail on
+ the left and the selected source's models on the right. */
.composer-model-thinking-menu.has-rail {
- width: min(460px, calc(100vw - 24px));
+ width: min(420px, calc(100vw - 24px));
}
+/* Rises from the trigger: a short lift and a near-imperceptible scale, so the
+ surface feels anchored rather than popping in. */
.composer-model-thinking-menu.is-open {
- animation: composer-menu-in var(--motion-duration-fast) var(--motion-ease-out);
+ animation: composer-menu-in var(--motion-duration-normal) var(--motion-ease-out);
transform-origin: bottom right;
}
@@ -207,7 +210,9 @@
.composer-model-thinking-chevron {
flex: 0 0 auto;
color: var(--ds-text-faint);
- transition: color var(--motion-duration-fast) var(--motion-ease-out);
+ transition:
+ color var(--motion-duration-fast) var(--motion-ease-out),
+ transform var(--motion-duration-normal) var(--motion-ease-out);
}
.composer-model-thinking-chip:hover .composer-model-thinking-chevron,
@@ -215,10 +220,15 @@
color: var(--ds-text-secondary);
}
+/* The caret turns toward the open menu, which sits above the trigger. */
+.composer-model-thinking-chip.active .composer-model-thinking-chevron {
+ transform: rotate(180deg);
+}
+
.composer-model-thinking-menu .composer-menu-root {
display: flex;
flex-direction: column;
- gap: 4px;
+ gap: 0;
}
.composer-menu-entry,
@@ -280,17 +290,56 @@
background: var(--ds-border-subtle);
}
+/* Search is the menu's header: flush with the surface, closed by a hairline
+ that runs edge to edge. */
.composer-model-thinking-menu .composer-model-search {
- margin: 0 0 2px;
+ margin: 0 -6px 6px;
+}
+
+.composer-model-thinking-menu .composer-menu-root > .composer-model-search:first-child {
+ margin-top: -6px;
}
+/* Rows are compact and quiet. Selection is a weight change plus a drawn
+ check, not a filled slab, so hover and keyboard focus own the only fill. */
.composer-model-thinking-menu .composer-plus-item {
- min-height: 32px;
- padding: 6px 8px;
+ min-height: 28px;
+ gap: 8px;
+ padding: 0 8px;
+ border-radius: var(--radius-2xs);
+ transition: background var(--motion-duration-fast) var(--motion-ease-out);
+}
+
+.composer-model-thinking-menu .composer-model-option.active,
+.composer-model-thinking-menu .composer-model-option.active.kb-active {
+ background: transparent;
+}
+
+.composer-model-thinking-menu .composer-model-option.active:hover,
+.composer-model-thinking-menu .composer-model-option.active.kb-active {
+ background: var(--ds-bg-hover);
+}
+
+.composer-model-thinking-menu .composer-model-option.active .composer-model-label {
+ font-weight: var(--font-weight-medium);
+}
+
+.composer-model-thinking-menu .composer-model-group-label {
+ padding: 8px 8px 3px;
+ font-size: var(--text-2xs);
+}
+
+.composer-model-thinking-menu .composer-model-group:first-child .composer-model-group-label {
+ padding-top: 2px;
+}
+
+.composer-model-thinking-menu .composer-model-empty {
+ padding: 28px 8px;
+ color: var(--ds-text-faint);
}
-/* Two-pane body: rail | models. One hairline separates the panes; the list
- keeps a fixed height so switching sources never resizes the menu. */
+/* Two-pane body: rail | models. One hairline separates the panes; both keep
+ one height so switching sources never resizes the menu. */
.composer-model-body {
display: flex;
min-height: 0;
@@ -298,41 +347,51 @@
.composer-model-body[data-rail] {
display: grid;
- grid-template-columns: 148px minmax(0, 1fr);
- gap: 6px;
+ grid-template-columns: 116px minmax(0, 1fr);
}
.composer-model-body[data-rail] .composer-model-list,
.composer-model-body[data-rail] .composer-model-rail {
- height: min(280px, calc(var(--model-pane-rows, 8) * 33px + 2px));
+ height: min(264px, calc(var(--model-pane-rows, 8) * 30px + 4px));
max-height: none;
}
+.composer-model-body[data-rail] .composer-model-list {
+ padding-left: 6px;
+}
+
.composer-model-rail {
+ position: relative;
display: flex;
flex-direction: column;
- gap: 1px;
- overflow-y: auto;
+ gap: 2px;
padding-right: 6px;
border-right: 1px solid var(--ds-border-subtle);
+ overflow-y: auto;
+}
+
+/* The rail scrolls only with many sources; its bar stays out of the way. */
+.composer-model-rail::-webkit-scrollbar {
+ width: 0;
}
.composer-model-rail-item {
display: flex;
+ flex: 0 0 auto;
min-width: 0;
- min-height: 32px;
+ height: 28px;
align-items: center;
- gap: 8px;
- padding: 0 8px 0 6px;
- border-radius: var(--radius-sm);
- color: var(--ds-text-secondary);
+ gap: 6px;
+ padding: 0 8px;
+ border-radius: var(--radius-2xs);
+ color: var(--ds-text-muted);
font-size: var(--text-sm);
text-align: left;
cursor: pointer;
transition:
background var(--motion-duration-fast) var(--motion-ease-out),
color var(--motion-duration-fast) var(--motion-ease-out),
- opacity var(--motion-duration-fast) var(--motion-ease-out);
+ opacity var(--motion-duration-normal) var(--motion-ease-out);
}
.composer-model-rail-item:hover,
@@ -342,39 +401,35 @@
}
.composer-model-rail-item.active {
- background: var(--ds-bg-active);
color: var(--ds-text-primary);
+ font-weight: var(--font-weight-medium);
}
/* While searching, sources without a match step back instead of vanishing,
so the rail never reflows under the pointer. */
.composer-model-rail-item[data-empty] {
- opacity: 0.4;
+ opacity: 0.38;
}
-/* Monogram tile: a stable per-source hue keeps sources recognisable at a
- glance without shipping vendor artwork. */
-.composer-model-rail-avatar {
- /* The hue arrives per element; mixing it with theme tokens keeps one rule
- legible on both light and dark surfaces. */
- --source-tile-tint: oklch(0.62 0.15 var(--provider-hue, 250));
- display: inline-flex;
- flex: 0 0 auto;
- width: 20px;
- height: 20px;
- align-items: center;
- justify-content: center;
- border-radius: var(--radius-xs);
- background: color-mix(in oklab, var(--source-tile-tint) 18%, transparent);
- color: color-mix(in oklab, var(--source-tile-tint) 72%, var(--ds-text-primary));
- font-size: var(--text-2xs);
- font-weight: var(--font-weight-strong);
- line-height: var(--leading-none);
+/* One hairline marker travels between sources instead of each item switching
+ its own state: the eye follows the move. Rows are 28px + a 2px gap. */
+.composer-model-rail-indicator {
+ position: absolute;
+ top: 8px;
+ left: 0;
+ width: 2px;
+ height: 12px;
+ border-radius: var(--radius-full);
+ background: var(--ds-text-primary);
+ transform: translateY(calc(var(--rail-index, 0) * 30px));
+ transition:
+ transform var(--motion-duration-normal) var(--motion-ease-out),
+ opacity var(--motion-duration-fast) var(--motion-ease-out);
+ pointer-events: none;
}
-.composer-model-rail-avatar.is-recent {
- background: var(--ds-tile-deep);
- color: var(--ds-text-secondary);
+.composer-model-rail-indicator[data-hidden] {
+ opacity: 0;
}
.composer-model-rail-label {
@@ -389,22 +444,32 @@
flex: 0 0 auto;
color: var(--ds-text-faint);
font-size: var(--text-2xs);
+ font-weight: var(--font-weight-normal);
font-variant-numeric: tabular-nums;
}
-/* Narrow windows keep both panes: the rail folds to its monograms and the
- full source name stays the item's title. */
-@media (max-width: 520px) {
- .composer-model-body[data-rail] {
- grid-template-columns: 40px minmax(0, 1fr);
+/* A new source's rows drift in from the side the rail moved toward. */
+.composer-model-pane[data-step] {
+ animation: composer-model-pane-in var(--motion-duration-normal) var(--motion-ease-out);
+}
+
+.composer-model-pane[data-step="back"] {
+ --pane-shift: -6px;
+}
+
+@keyframes composer-model-pane-in {
+ from {
+ opacity: 0;
+ transform: translateY(var(--pane-shift, 6px));
}
+}
- .composer-model-rail-item {
- justify-content: center;
- padding: 0;
+/* Narrow windows keep both panes and narrow the rail; counts give way first. */
+@media (max-width: 480px) {
+ .composer-model-body[data-rail] {
+ grid-template-columns: 92px minmax(0, 1fr);
}
- .composer-model-rail-label,
.composer-model-rail-count {
display: none;
}
@@ -412,124 +477,139 @@
.composer-model-check-slot {
display: inline-flex;
- flex: 0 0 14px;
+ flex: 0 0 13px;
justify-content: center;
}
+/* The check is drawn, short stroke first, the moment a row becomes current. */
+.composer-model-check path {
+ stroke-dasharray: 24;
+ animation: composer-model-check-draw var(--motion-duration-slow) var(--motion-ease-out) both;
+}
+
+@keyframes composer-model-check-draw {
+ from {
+ stroke-dashoffset: -24;
+ }
+
+ to {
+ stroke-dashoffset: 0;
+ }
+}
+
.composer-model-option-provider {
color: var(--ds-text-faint);
- font-size: var(--text-xs);
+ font-size: var(--text-2xs);
}
-/* Reasoning lives in its own footer under a hairline: it configures the
- selected model, so it reads as a setting rather than another list row. */
+/* Reasoning is a footer setting for the selected model, under one hairline. */
.composer-model-reasoning {
display: flex;
- flex-direction: column;
- margin: 2px -6px -6px;
- padding: 10px 6px 4px;
+ align-items: center;
+ gap: 10px;
+ margin: 6px -6px -6px;
+ padding: 8px 8px 8px 14px;
border-top: 1px solid var(--ds-border-subtle);
}
+.composer-model-reasoning-label {
+ flex: 0 0 auto;
+ color: var(--ds-text-muted);
+ font-size: var(--text-2xs);
+}
-/* Reasoning slider (issue #417): the menu root carries the slider itself, so a
- level is one drag instead of opening a list of levels.
+.composer-model-reasoning .composer-thinking-slider {
+ min-width: 0;
+ flex: 1;
+}
- Stop/label alignment contract: the rail and the labels are full-width
- n-column grids, so dot i, label i and the thumb at index i all sit on the
- same column center W/(2n) + i·W/n. The range input overlays the rail at
- full width and is inset on both sides by half a column minus half the thumb
- (W/(2n) - r) — that inset is what moves the native thumb's first/last stops
- inward from the radius edge onto the grid's first/last column centers. The
- input's own track is transparent — the rail line and dots are drawn on the
- grids instead — so the thumb glides over the dots. The thumb radius lives
- in --thinking-thumb-radius so the formula stays correct if it changes. */
+@media (max-width: 480px) {
+ .composer-model-reasoning-label {
+ display: none;
+ }
+}
+
+/* Reasoning control (issue #417): a segmented track with a raised pill.
+
+ Column contract: the labels are a full-width n-column grid, and the pill is
+ one column wide (minus a 2px gutter each side) offset by index/n, so pill i
+ and label i share the column center W/(2n) + i·W/n. The native range
+ overlays the track at full width, inset on both sides by half a column minus
+ its (invisible) thumb radius, which puts each native stop on the same
+ center. The range owns keyboard, drag and accessibility; the pill and the
+ labels underneath it are decoration. */
.composer-thinking-slider {
--thinking-thumb-radius: 7px;
- --thinking-dot-radius: 2px;
- --thinking-track-height: 4px;
- --thinking-track-center: 7px; /* (18 - 4) / 2 inside the 18px input */
+ --thinking-gutter: 2px;
--thinking-inset: calc(100% / (2 * var(--stop-count, 1)) - var(--thinking-thumb-radius));
- display: flex;
- flex-direction: column;
- gap: 2px;
- padding: 0 6px 4px;
}
-/* Rail: full-width positioning context for the dots row and the input. */
.composer-thinking-rail {
position: relative;
- height: 18px;
+ height: 24px;
+ border-radius: var(--radius-xs);
+ background: color-mix(in oklab, var(--ds-text-primary) 6%, transparent);
}
-/* The rail line spans the stop-to-stop distance: it starts and ends half a
- column in from the edges so its tips land on the first/last dot centers.
- The muted base rail is ::before and the accent fill is ::after, a separate
- layer whose width transitions smoothly between stops. */
-.composer-thinking-rail::before,
-.composer-thinking-rail::after {
- content: "";
- pointer-events: none;
+.composer-thinking-thumb {
+ z-index: 1;
position: absolute;
- top: var(--thinking-track-center);
- left: calc(100% / (2 * var(--stop-count, 1)));
- height: var(--thinking-track-height);
- border-radius: var(--radius-full);
+ top: var(--thinking-gutter);
+ bottom: var(--thinking-gutter);
+ left: calc(var(--composer-thinking-progress, 0%) + var(--thinking-gutter));
+ width: calc(100% / var(--stop-count, 1) - 2 * var(--thinking-gutter));
+ border-radius: var(--radius-2xs);
+ background: var(--ds-raised);
+ box-shadow: var(--ds-raised-shadow);
+ pointer-events: none;
+ transition:
+ left var(--motion-duration-normal) var(--motion-ease-out),
+ transform var(--motion-duration-fast) var(--motion-ease-out);
}
-.composer-thinking-rail::before {
- right: calc(100% / (2 * var(--stop-count, 1)));
- background: var(--ds-border-subtle);
+/* Pressing gives the pill a slight give before it travels. */
+.composer-thinking-slider:has(.composer-thinking-range:active) .composer-thinking-thumb {
+ transform: scale(0.96);
}
-.composer-thinking-rail::after {
- /* Cover the first dot's full rounded cap without moving the target end. */
- left: calc(100% / (2 * var(--stop-count, 1)) - var(--thinking-dot-radius));
- width: calc(var(--composer-thinking-progress, 0%) + var(--thinking-dot-radius));
- background: var(--ds-accent);
- transition: width var(--motion-duration-normal) var(--motion-ease-out);
+.composer-thinking-slider[data-dragging] .composer-thinking-thumb {
+ transform: none;
+ transition: none;
}
-/* One dot per stop, centered on the rail at each full-width column center. */
-.composer-thinking-dots {
+.composer-thinking-ticks {
+ z-index: 2;
position: absolute;
inset: 0;
display: grid;
grid-template-columns: repeat(var(--stop-count, 1), minmax(0, 1fr));
- align-items: center;
pointer-events: none;
}
-.composer-thinking-dot {
- justify-self: center;
- width: calc(2 * var(--thinking-dot-radius));
- height: calc(2 * var(--thinking-dot-radius));
- border-radius: var(--radius-full);
- background: var(--ds-text-muted);
- opacity: 0.55;
- transition:
- background-color var(--motion-duration-fast) var(--motion-ease-out),
- opacity var(--motion-duration-fast) var(--motion-ease-out),
- transform var(--motion-duration-fast) var(--motion-ease-out);
+.composer-thinking-tick {
+ min-width: 0;
+ overflow: hidden;
+ padding: 0 2px;
+ color: var(--ds-text-muted);
+ font-size: var(--text-2xs);
+ line-height: var(--leading-compact);
+ text-align: center;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ cursor: pointer;
+ transition: color var(--motion-duration-fast) var(--motion-ease-out);
}
-/* The thumb covers the selected dot; accent keeps a partial cover readable. */
-.composer-thinking-dot.active {
- background: var(--ds-accent);
- opacity: 1;
+.composer-thinking-tick[data-hovered],
+.composer-thinking-tick:focus-visible {
+ color: var(--ds-text-primary);
}
-.composer-thinking-dot[data-hovered]:not([data-filled]):not(.active) {
- position: relative;
- z-index: 1;
- background: var(--ds-accent);
- opacity: 1;
- transform: scale(1.3);
+.composer-thinking-tick.active {
+ color: var(--ds-text-primary);
+ font-weight: var(--font-weight-medium);
}
-/* The accessible control overlays the rail at full width; the inset padding
- moves the thumb stops onto the column centers. Its track stays transparent
- so the rail line and dots show through under the thumb. */
.composer-thinking-range {
z-index: 3;
-webkit-appearance: none;
@@ -537,7 +617,7 @@
position: absolute;
inset: 0;
width: 100%;
- height: 18px;
+ height: 100%;
margin: 0;
padding: 0 var(--thinking-inset);
background: transparent;
@@ -545,99 +625,40 @@
}
.composer-thinking-range:focus-visible {
- border-radius: var(--radius-sm);
+ border-radius: var(--radius-xs);
outline: 2px solid var(--ds-accent);
outline-offset: 2px;
}
.composer-thinking-range::-webkit-slider-runnable-track {
- height: var(--thinking-track-height);
+ height: 100%;
background: transparent;
}
.composer-thinking-range::-webkit-slider-thumb {
-webkit-appearance: none;
- width: 14px;
- height: 14px;
- margin-top: calc((var(--thinking-track-height) - 14px) / 2);
+ width: calc(2 * var(--thinking-thumb-radius));
+ height: 100%;
border: 0;
- border-radius: var(--radius-full);
background: transparent;
}
.composer-thinking-range::-moz-range-track {
- height: var(--thinking-track-height);
+ height: 100%;
background: transparent;
}
.composer-thinking-range::-moz-range-thumb {
- width: 14px;
- height: 14px;
+ width: calc(2 * var(--thinking-thumb-radius));
+ height: 100%;
border: 0;
- border-radius: var(--radius-full);
background: transparent;
}
-/* Decoration never changes the native range's hit target or accessible value.
- Equal-width, gapless columns share the same center formula as the input. */
-.composer-thinking-thumb {
- z-index: 2;
- position: absolute;
- top: 2px;
- left: calc(100% / (2 * var(--stop-count, 1)) + var(--composer-thinking-progress, 0%));
- width: 14px;
- height: 14px;
- border: 2px solid var(--ds-bg-elevated-opaque);
- border-radius: var(--radius-full);
- background: var(--ds-accent);
- transform: translateX(-50%);
- pointer-events: none;
- transition: left var(--motion-duration-normal) var(--motion-ease-out);
-}
-
-
-.composer-thinking-slider[data-dragging] .composer-thinking-thumb,
-.composer-thinking-slider[data-dragging] .composer-thinking-rail::after {
- transition: none;
-}
-
-/* Labels form the same full-width n-column grid as the dots, so label i
- centers under dot i and the thumb at index i. Long words ellipsize inside
- the column; every label stays visible. */
-.composer-thinking-ticks {
- display: grid;
- grid-template-columns: repeat(var(--stop-count, 1), minmax(0, 1fr));
-}
-
-.composer-thinking-tick {
- min-width: 0;
- overflow: hidden;
- padding: 0;
- border-radius: var(--radius-sm);
- color: var(--ds-text-muted);
- font-size: var(--text-2xs);
- line-height: var(--leading-compact);
- text-align: center;
- text-overflow: ellipsis;
- white-space: nowrap;
- cursor: pointer;
- transition: color var(--motion-duration-fast) var(--motion-ease-out);
-}
-
-.composer-thinking-tick[data-hovered],
-.composer-thinking-tick:focus-visible {
- color: var(--ds-text-primary);
-}
-
-.composer-thinking-tick.active {
- color: var(--ds-accent);
- font-weight: var(--font-weight-strong);
-}
-
@keyframes composer-menu-in {
from {
opacity: 0;
- transform: translateY(6px) scale(0.97);
+ transform: translateY(4px) scale(0.985);
}
to {
@@ -647,14 +668,17 @@
}
@media (prefers-reduced-motion: reduce) {
- .composer-model-thinking-menu {
+ .composer-model-thinking-menu,
+ .composer-model-pane[data-step],
+ .composer-model-check path,
+ .composer-model-search-clear {
animation: none;
}
.composer-thinking-thumb,
- .composer-thinking-rail::after,
- .composer-thinking-dot,
- .composer-thinking-tick {
+ .composer-thinking-tick,
+ .composer-model-rail-indicator,
+ .composer-model-thinking-chevron {
transition: none;
}
}
@@ -687,7 +711,7 @@
.composer-model-list {
min-width: 0;
flex: 1;
- max-height: 280px;
+ max-height: 264px;
overflow-y: auto;
}
@@ -827,23 +851,50 @@
display: flex;
align-items: center;
gap: 8px;
- height: 34px;
- margin: 4px 3px 5px;
- padding: 0 10px;
- border-radius: var(--radius-md);
- background: var(--ds-bg-inset);
- color: var(--ds-text-muted);
- transition: box-shadow var(--motion-duration-fast) var(--motion-ease-out);
+ height: 38px;
+ padding: 0 10px 0 14px;
+ border-bottom: 1px solid var(--ds-border-subtle);
+ color: var(--ds-text-faint);
+ transition: color var(--motion-duration-fast) var(--motion-ease-out);
}
.composer-model-search:focus-within {
- box-shadow: 0 0 0 1px var(--ds-border-strong);
+ color: var(--ds-text-secondary);
}
.composer-model-search svg {
flex: 0 0 auto;
}
+.composer-model-search-clear {
+ display: inline-flex;
+ flex: 0 0 auto;
+ width: 18px;
+ height: 18px;
+ align-items: center;
+ justify-content: center;
+ border-radius: var(--radius-full);
+ background: var(--ds-tile-deep);
+ color: var(--ds-text-secondary);
+ cursor: pointer;
+ animation: composer-model-clear-in var(--motion-duration-fast) var(--motion-ease-out);
+ transition:
+ background var(--motion-duration-fast) var(--motion-ease-out),
+ color var(--motion-duration-fast) var(--motion-ease-out);
+}
+
+.composer-model-search-clear:hover {
+ background: var(--ds-bg-active);
+ color: var(--ds-text-primary);
+}
+
+@keyframes composer-model-clear-in {
+ from {
+ opacity: 0;
+ transform: scale(0.6);
+ }
+}
+
.composer-model-search input {
min-width: 0;
flex: 1;
@@ -852,11 +903,11 @@
background: transparent;
outline: none;
color: var(--ds-text-primary);
- font-size: var(--text-sm);
+ font-size: var(--text-sm-plus);
}
.composer-model-search input::placeholder {
- color: var(--ds-text-muted);
+ color: var(--ds-text-faint);
}
.composer-model-empty {
diff --git a/apps/desktop/test/composer-model-thinking-menu.test.mjs b/apps/desktop/test/composer-model-thinking-menu.test.mjs
index 5781ca8cd..13e972be6 100644
--- a/apps/desktop/test/composer-model-thinking-menu.test.mjs
+++ b/apps/desktop/test/composer-model-thinking-menu.test.mjs
@@ -24,10 +24,39 @@ test("Composer uses one searchable model menu with a source rail", () => {
assert.match(listSource, /onClick=\{\(\) => selectSection\(section\.id\)\}/);
assert.match(modelMenuSource, /showSectionRail: sections\.length > 1/);
assert.match(modelMenuSource, /searching\s*\? filteredModelGroups/);
- assert.match(stylesSource, /\.composer-model-body\[data-rail\] \{[^}]*grid-template-columns: 148px minmax\(0, 1fr\)/);
+ assert.match(stylesSource, /\.composer-model-body\[data-rail\] \{[^}]*grid-template-columns: 116px minmax\(0, 1fr\)/);
// Switching sources never resizes the menu under the pointer.
assert.match(modelMenuSource, /const paneRows = Math\.max\(/);
- assert.match(stylesSource, /\.composer-model-body\[data-rail\] \.composer-model-list,[\s\S]*?height: min\(280px, calc\(var\(--model-pane-rows, 8\) \* 33px \+ 2px\)\)/);
+ assert.match(stylesSource, /\.composer-model-body\[data-rail\] \.composer-model-list,[\s\S]*?height: min\(264px, calc\(var\(--model-pane-rows, 8\) \* 30px \+ 4px\)\)/);
+});
+
+test("the source rail and pane move with the selection instead of snapping", () => {
+ // One marker travels between rail items; its step matches the 28px row
+ // plus the 2px gap, and it fades out while search releases the rail.
+ assert.match(listSource, /className="composer-model-rail-indicator"/);
+ assert.match(listSource, /data-hidden=\{railIndex < 0 \? "true" : undefined\}/);
+ assert.match(stylesSource, /\.composer-model-rail-item \{[^}]*height: 28px;/);
+ assert.match(stylesSource, /\.composer-model-rail \{[^}]*gap: 2px;/);
+ assert.match(stylesSource, /transform: translateY\(calc\(var\(--rail-index, 0\) \* 30px\)\)/);
+ // The pane is keyed by source and slides in from the side the rail moved
+ // toward; the first render after opening does not animate.
+ assert.match(listSource, /key=\{activeSection \?\? "search"\}/);
+ assert.match(listSource, /data-step=\{sectionStep === 0 \? undefined : sectionStep < 0 \? "back" : "forward"\}/);
+ assert.match(modelMenuSource, /setSectionStep\(to < from \? -1 : 1\)/);
+ assert.match(modelMenuSource, /setSectionStep\(0\)/);
+ // A current row is marked by a drawn check, and every motion has a
+ // reduced-motion opt-out.
+ assert.match(stylesSource, /\.composer-model-check path \{[^}]*animation: composer-model-check-draw/);
+ assert.match(stylesSource, /@media \(prefers-reduced-motion: reduce\) \{[\s\S]*?\.composer-model-pane\[data-step\][\s\S]*?\.composer-model-rail-indicator/);
+});
+
+test("Escape clears a search before it closes the menu", () => {
+ assert.match(
+ modelMenuSource,
+ /if \(event\.key === "Escape"\) \{\s*event\.preventDefault\(\);[\s\S]*?if \(query && event\.target instanceof HTMLInputElement\) \{\s*setQuery\(""\);[\s\S]*?return;\s*\}\s*setOpen\(false\);/,
+ );
+ assert.match(listSource, /className="composer-model-search-clear"/);
+ assert.match(listSource, /aria-label=\{t\("settings\.clearSearch"\)\}/);
});
test("model selection does not itself record usage", () => {
@@ -72,27 +101,24 @@ test("the menu root carries the reasoning slider itself", () => {
assert.doesNotMatch(composerSource, /thinkingMode|showThinkingMode|ThinkingSelectionMode|thinkingCommitChainRef/);
});
-test("the reasoning slider aligns each track dot and label to the thumb", () => {
- // The dots row and the labels row are separate full-width n-column grids
- // keyed to --stop-count; the range input overlays the dots row at full
- // width and is inset by half a column minus the thumb radius, which moves
- // the native thumb's stops onto the same column centers for every n.
+test("the reasoning control aligns each label under its pill column", () => {
+ // The labels are a full-width n-column grid inside the track; the raised
+ // pill is one column wide, offset by index/n, and the range overlays the
+ // track inset by half a column minus its thumb radius, so pill i, label i
+ // and native stop i share one column center for every stop count.
assert.match(sliderSource, /className="composer-thinking-rail"/);
- assert.match(sliderSource, /className="composer-thinking-dots" aria-hidden="true"/);
assert.match(sliderSource, /className="composer-thinking-ticks" aria-hidden="true"/);
-
- // Rail, dots and labels all key off --stop-count; the dots and labels are
- // full-width grids and the input carries the inset.
+ assert.doesNotMatch(sliderSource, /composer-thinking-dot/);
assert.match(stylesSource, /--thinking-thumb-radius: 7px/);
assert.match(stylesSource, /--thinking-inset: calc\(100% \/ \(2 \* var\(--stop-count, 1\)\) - var\(--thinking-thumb-radius\)\)/);
- assert.match(stylesSource, /\.composer-thinking-dots \{[\s\S]*?grid-template-columns: repeat\(var\(--stop-count, 1\), minmax\(0, 1fr\)\)/);
assert.match(stylesSource, /\.composer-thinking-ticks \{[\s\S]*?grid-template-columns: repeat\(var\(--stop-count, 1\), minmax\(0, 1fr\)\)/);
assert.match(stylesSource, /\.composer-thinking-range \{[\s\S]*?padding: 0 var\(--thinking-inset\)/);
-
- // Track dots sit on the rail (accent for the selected, muted for the rest)
- // and labels stay visible; the input's own track is transparent.
- assert.match(stylesSource, /\.composer-thinking-dot\.active/);
- assert.match(stylesSource, /\.composer-thinking-range::-webkit-slider-runnable-track \{\s*height: var\(--thinking-track-height\);\s*background: transparent;/);
+ assert.match(stylesSource, /\.composer-thinking-thumb \{[\s\S]*?left: calc\(var\(--composer-thinking-progress, 0%\) \+ var\(--thinking-gutter\)\);\s*width: calc\(100% \/ var\(--stop-count, 1\) - 2 \* var\(--thinking-gutter\)\);/);
+ // The pill is the shared raised surface; dragging follows the pointer
+ // without easing.
+ assert.match(stylesSource, /\.composer-thinking-thumb \{[\s\S]*?background: var\(--ds-raised\);\s*box-shadow: var\(--ds-raised-shadow\);/);
+ assert.match(stylesSource, /\.composer-thinking-slider\[data-dragging\] \.composer-thinking-thumb \{\s*transform: none;\s*transition: none;/);
+ assert.match(stylesSource, /\.composer-thinking-range::-webkit-slider-runnable-track \{\s*height: 100%;\s*background: transparent;/);
});
test("opening the combined menu preloads model metadata before its submenu", () => {
diff --git a/apps/desktop/test/helpers/composer-toolbar.mjs b/apps/desktop/test/helpers/composer-toolbar.mjs
index f8fdc2aa0..eee59805c 100644
--- a/apps/desktop/test/helpers/composer-toolbar.mjs
+++ b/apps/desktop/test/helpers/composer-toolbar.mjs
@@ -31,7 +31,7 @@ export const TOOLBAR_PROPS = {
modelMenu: {
open: false,
setOpen: noop,
- sections: [], activeSection: null, selectSection: noop, showSectionRail: false, paneRows: 0, searching: false,
+ sections: [], activeSection: null, sectionStep: 0, selectSection: noop, showSectionRail: false, paneRows: 0, searching: false,
query: "",
setQuery: noop,
modelHighlight: -1,
diff --git a/docs/spec/03-runtime/13-model-catalog-and-selection.md b/docs/spec/03-runtime/13-model-catalog-and-selection.md
index 13f39ea43..9b33788e3 100644
--- a/docs/spec/03-runtime/13-model-catalog-and-selection.md
+++ b/docs/spec/03-runtime/13-model-catalog-and-selection.md
@@ -478,7 +478,8 @@ provider as well as the model or alias. Search spans all providers, shows groupe
results, and dims rail sources without matches. With a single source (for
example no history and one provider) the rail is hidden and all models are
visible immediately. The pane height is fixed by the tallest source so switching
-sources never resizes the menu. The current model is checked; reasoning controls
+sources never resizes the menu. Escape clears a typed search before it closes
+the menu. The current model is checked; reasoning controls
sit in a footer below the list. Discovery enriches exact
configured IDs without adding unconfigured choices. Model and reasoning changes
retain the existing session configuration and permission boundaries.
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 5872c0f36..d1360dc96 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -3363,26 +3363,21 @@ reasoning-level control.
- The combined model × reasoning menu opens at `bottom: calc(100% + 8px)` with
`role="menu"`. Its root has exactly two `role="menuitem"` entries and, when
the menu lists more than one level, a drag slider with one labeled stop per
- level directly beneath the Reasoning level entry (D458). The slider shows a
- rail with one track dot per stop and a label under each stop; every label
- stays visible and ellipsizes inside its column. The dots row and the labels
- row are full-width n-column grids and the range input overlays the rail at
- full width, inset on both sides by half a column minus the thumb radius, so
- the track dot, the thumb and the label all land on the same column center
- for every stop count. The selected stop's dot and label use the accent
- token, the rest a muted token; the thumb covers the selected dot. Tick
- labels are clickable but not tab stops; the range input is the accessible
- control.
- Hovering either a stop or its label highlights the corresponding label.
- Only unfilled dots brighten and scale to 1.3x; filled stops and the selected
- thumb have no hover effect. Leaving
- the slider clears the preview without selecting or persisting a level.
- A decorative, non-interactive thumb and the filled rail share the range's
- gapless column geometry. The fill starts at the first dot's outer left edge
- and ends at the selected thumb's center, covering the starting dot fully.
- Clicks and keyboard changes move the thumb and
- fill over `--motion-duration-normal` (200ms); a new click retargets from
- the current visual position. Native pointer dragging bypasses transitions.
+ level in the menu footer (D458, D685). The control is a segmented track:
+ one label per stop inside a full-width n-column grid, and a raised pill
+ (`--ds-raised`) one column wide, inset by a 2px gutter, under the selected
+ label. Every label stays visible and ellipsizes inside its column. The range
+ input overlays the track at full width, inset on both sides by half a column
+ minus its invisible thumb radius, so the pill, the label and the native stop
+ share one column center for every stop count. The selected label uses the
+ primary ink at medium weight, the rest a muted token. Labels are clickable
+ but not tab stops; the range input is the accessible control.
+ Hovering a column brightens its label without moving the pill; leaving the
+ control clears the preview without selecting or persisting a level.
+ Clicks and keyboard changes move the pill over `--motion-duration-normal`
+ (200ms); a new click retargets from the current visual position. Pressing
+ the control scales the pill to 0.96; native pointer dragging bypasses all
+ transitions.
Only the requested levels are persisted, never interpolated animation
positions. Pending selection is optimistic; failure restores the confirmed
level, and stale completions cannot overwrite a newer choice. Reopening
@@ -4180,9 +4175,10 @@ responses cannot restore an earlier order. Composer All models groups follow the
default nor provider configuration. OAuth accounts remain in their separate section.
1. **Model selection** — chat models are selected in the Composer. Its first
- menu has persistent search over a source rail (Recent, then each provider)
- and the chosen source's models. With a single source the rail is hidden and
- all models show directly.
+ menu has persistent search over a text-only source rail (Recent, then each
+ provider) and the chosen source's models. A single marker slides between
+ rail items, and the pane slides in from the direction of the move. With a
+ single source the rail is hidden and all models show directly.
New chats inherit the last actually used available model. Only accepted
message submission updates that preference; selection and reasoning changes
alone do not count as usage.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index dda93f84e..44fe8f19c 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -4879,13 +4879,12 @@ window; opening a normal panel afterward must still work.
- **Preconditions**: One catalogued reasoning model, one non-reasoning model,
and one unknown free-form model id.
- **Steps**: 1) Open the Composer model × reasoning chip. 2) Confirm the root
- contains the Model and Reasoning level entries with current values, plus a
- slider with one track dot per supported level on a rail directly beneath the
- Reasoning level entry; confirm every level keeps a visible label under the
- rail, each centered on its track dot. 3) Drag and click the slider across
- multiple supported levels and click a tick label, confirming the chip
- updates while the menu stays at the root and the selected track dot sits
- under the thumb. 4) Open Model, search for a model, and select a
+ contains the model list plus a segmented reasoning control in the footer
+ with one labeled column per supported level; confirm every level keeps a
+ visible label, each centered in its column. 3) Drag and click the control
+ across multiple supported levels and click a label, confirming the chip
+ updates while the menu stays open and the raised pill sits under the
+ selected label. 4) Open Model, search for a model, and select a
model from a provider group; confirm the menu remains open at the root.
5) Open Reasoning level and choose a level from the radio list. 6) Repeat
with a non-reasoning provider and an unknown free-form model id; exercise
@@ -19194,7 +19193,9 @@ host-created files. The full app's file-preview viewer is covered separately.
rail and verify each of its models appears once. Move from a recent row to the
rail, and tab out of search after arrow navigation: no stale keyboard
highlight remains on a model row. Without history and with one provider, the
- rail is hidden and all configured models are directly visible. Verify thinking
+ rail is hidden and all configured models are directly visible. With a
+ search typed, Escape clears it and keeps the menu open; a second Escape
+ closes the menu. Verify thinking
defaults still follow the selected binding and manual same-model levels survive.
- Create a new chat: it inherits the last actually used model. Reload local preferences
and create another chat: the same binding is restored. An existing chat keeps
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index 992b74d8a..c112cbe03 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -461,6 +461,7 @@ section mirrors only marketplace/catalog items still blocking nothing.
| D143 | Settings directory rail icons | **The five settings destinations use fixed Lucide glyphs: Basics=`SlidersHorizontal`, Model configuration=`Bot`, Import=`Download`, Project archive=`Archive`, Info=`Info`. Refresh/rotate glyphs are not used on this rail.** | Prior mapping reused Settings/RefreshCcw/RotateCw, which read as generic gear/reload rather than the destination semantics; monochrome Lucide keeps the compact directory scannable. |
| D166 | Settings directory split into AI and Shortcuts destinations | **The Settings rail grows from five to seven destinations in order: Basics (`SlidersHorizontal`), 全局 AI/AI (`Sparkles`, new), Shortcuts (`Keyboard`, new), Model configuration (`Bot`), Import (`Download`), Project archive (`Archive`), Info (`Info`). Permissions and Context management move from Basics to the new AI destination; Keyboard shortcuts moves from Basics to the new Shortcuts destination; Developer moves from Basics to Info. Basics keeps only Appearance and Defaults. This supersedes the five-destination count/order of D133 and the five-icon set of D143 (adding `Sparkles` and `Keyboard`) without changing any setting's semantics, the full-page shell, or rail metrics.** | Basics accumulated six unrelated cards, burying global AI behavior (permission mode, context compaction) and shortcut configuration alongside look-and-feel; splitting them gives each concern a scannable home while keeping provider/connection config separate in Model configuration. |
| D684 | One settings destination owns one subject | **Amend D143 / D166 / D678 and see ADR 0345: the Settings directory is fifteen destinations in order — Appearance (`Palette`), Conversation (`MessageSquare`), Shortcuts (`Keyboard`), Voice (`Mic`), Behavior (`SlidersHorizontal`), Models (`Bot`), Instructions (`FileText`), Skills (`BookOpen`), MCP (`Server`), Subagents (`Sparkles`), Projects (`Archive`), System (`Monitor`), Cloud sync (`CloudDownload`), Remote Hosts (`Globe`), Info (`Info`) — in the four existing clusters. `general` and `ai` are retired: General's appearance rows become Appearance (cards Interface / Sidebar / Radial context menu / Startup) and its machine rows become System (Network / Storage / Power / Close behavior); the AI Defaults catch-all splits into Conversation (Display / Input & links) and Behavior (Session defaults / Execution / Computer use). Both retired ids stay resolvable to their successor and appear in neither the rail nor search. A card may carry one visible caption line and a destination one subtitle line; each page repeats its rail glyph at page scale on an accent-tinted fill, and the selected rail row takes an accent-tinted pill with an accent glyph. No persisted field, IPC, host protocol, or storage schema change — only which page renders which row. See E2E-SETTINGS-one-destination-one-subject and E2E-SETTINGS-retired-destination-ids-resolve.** | Two destinations had become landing places rather than subjects: General mixed theme and type with proxies, disk maintenance, sleep blockers and the close button, and the AI Defaults card had grown to thirteen rows spanning transcript presentation, composer input and run behavior. A reader could not predict which page held a setting, and with every explanation behind a help mark the only way to find one was to hover the whole page. Reordering cards cannot repair a page that owns two subjects. |
+| D685 | Composer model picker: text rail and segmented reasoning | **Amend D458: the reasoning control in the combined Composer model menu is a segmented track with a raised pill under the selected level, placed in the menu footer, instead of a rail with track dots. The native range input, its column geometry, latest-wins commits and keyboard ownership are unchanged. The model list uses a text-only source rail with one sliding marker; Escape clears a typed search before closing the menu. Renderer only. See `04-ux/08-component-spec.md` and E2E-050.** | The dot rail and colored source tiles read heavy next to compact model rows; a segmented pill and a text rail match the rest of the menu chrome. |
## R. Decision rules going forward
@@ -8404,3 +8405,16 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
`features/settings/pages/`, which keeps `SettingsPage.tsx` from growing a
fifth subject and leaves the settings source contract intact, since it reads
the facade plus everything under `features/settings`.
+
+## 2026-11-06 — Composer model picker: text rail and segmented reasoning (D685)
+
+- The two-pane model picker shipped with monogram tiles in its source rail and
+ the dot-rail reasoning slider. Both read heavy next to the compact rows.
+- The rail is now text only, with one 2px marker that slides between sources;
+ the model pane slides in from the direction of the move, and the current
+ row's check is drawn rather than filled.
+- The reasoning control becomes a segmented track in the menu footer with a
+ raised pill under the selected level. The native range still owns
+ keyboard, drag and accessibility, and the column geometry contract of D458
+ holds: pill, label and native stop share one center for every stop count.
+- Escape clears a typed search first; a second Escape closes the menu.
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 3ab638206..97a1eb828 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -720,6 +720,7 @@ export const de = {
"model": "Modell",
recentModels: "Zuletzt verwendet",
modelSources: "Modellquellen",
+ reasoningShort: "Denken",
"searchModels": "Modelle suchen",
"noModelResults": "Keine passenden Modelle",
"modelBadgeReasoning": "Begründung",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index b22293822..d2fca3307 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -732,6 +732,7 @@ export const en = {
model: "Model",
recentModels: "Recently used",
modelSources: "Model sources",
+ reasoningShort: "Reasoning",
searchModels: "Search models",
noModelResults: "No matching models",
modelBadgeReasoning: "reasoning",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index 0696652cc..dbcbcfa2a 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -720,6 +720,7 @@ export const es = {
"model": "Modelo",
recentModels: "Usados recientemente",
modelSources: "Fuentes de modelos",
+ reasoningShort: "Razonamiento",
"searchModels": "Buscar modelos",
"noModelResults": "No hay modelos coincidentes",
"modelBadgeReasoning": "razonamiento",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index 70aa807e4..08e46c617 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -720,6 +720,7 @@ export const fr = {
"model": "Modèle",
recentModels: "Récemment utilisés",
modelSources: "Sources de modèles",
+ reasoningShort: "Raisonnement",
"searchModels": "Rechercher des modèles",
"noModelResults": "Aucun modèle correspondant",
"modelBadgeReasoning": "raisonnement",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index d450cf7fc..35056275d 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -729,6 +729,7 @@ export const ko = {
model: "모델",
recentModels: "최근 사용",
modelSources: "모델 소스",
+ reasoningShort: "추론",
searchModels: "모델 검색",
noModelResults: "일치하는 모델 없음",
modelBadgeReasoning: "추론",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index 03a4ba9bc..4a8e6a49b 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -719,6 +719,7 @@ export const ptBR = {
model: "Modelo",
recentModels: "Usados recentemente",
modelSources: "Fontes de modelos",
+ reasoningShort: "Raciocínio",
searchModels: "Pesquisar modelos…",
noModelResults: "Nenhum modelo encontrado",
modelBadgeReasoning: "Raciocínio",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index ae2078e1d..f72a7d3ea 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -729,6 +729,7 @@ export const tr = {
model: "Model",
recentModels: "Son kullanılanlar",
modelSources: "Model kaynakları",
+ reasoningShort: "Akıl yürütme",
searchModels: "Model ara",
noModelResults: "Eşleşen model yok",
modelBadgeReasoning: "akıl yürütme",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index a5bb95d2b..8120b7f08 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -725,6 +725,7 @@ export const zhCN = {
model: "模型",
recentModels: "最近使用",
modelSources: "模型来源",
+ reasoningShort: "推理",
searchModels: "搜索模型",
noModelResults: "没有匹配的模型",
modelBadgeReasoning: "推理",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index 77700b447..2c3bb6d5b 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -725,6 +725,7 @@ export const zhTW = {
model: "模型",
recentModels: "最近使用",
modelSources: "模型來源",
+ reasoningShort: "推理",
searchModels: "搜尋模型",
noModelResults: "沒有匹配的模型",
modelBadgeReasoning: "推理",
diff --git a/scripts/e2e-composer-thinking-layout.mjs b/scripts/e2e-composer-thinking-layout.mjs
index 8cc0ea670..4f9f1f19d 100644
--- a/scripts/e2e-composer-thinking-layout.mjs
+++ b/scripts/e2e-composer-thinking-layout.mjs
@@ -78,36 +78,28 @@ app.whenReady().then(async()=>{
await click();
await click('low');
const hoverSnapshot=()=>window.webContents.executeJavaScript(\`(() => {
- const dots=[...document.querySelectorAll('.composer-thinking-dot')];
const ticks=[...document.querySelectorAll('.composer-thinking-tick')];
- const hovered=dots.findIndex(dot=>dot.hasAttribute('data-hovered'));
- return {hovered, tick:ticks.findIndex(tick=>tick.hasAttribute('data-hovered')),
- width:hovered<0?0:dots[hovered].getBoundingClientRect().width,
- halo:hovered<0?'none':getComputedStyle(dots[hovered]).boxShadow,
- thumbWidth:document.querySelector('.composer-thinking-thumb').getBoundingClientRect().width,
- thumbHalo:getComputedStyle(document.querySelector('.composer-thinking-thumb')).boxShadow,
+ return {tick:ticks.findIndex(tick=>tick.hasAttribute('data-hovered')),
+ thumb:document.querySelector('.composer-thinking-thumb').getBoundingClientRect().left,
value:document.querySelector('.composer-thinking-range').getAttribute('aria-valuetext')};
})()\`);
result.hover=[];
+ const restingThumb=(await hoverSnapshot()).thumb;
for(const stop of [0,1,2,4]){
- for(const row of ['dot','tick']){
- const point=await window.webContents.executeJavaScript(\`(() => {
- const r=document.querySelectorAll('.composer-thinking-\${row}')[\${stop}].getBoundingClientRect();
- return {x:Math.round(r.left+r.width/2),y:Math.round(r.top+r.height/2)};
- })()\`);
- window.webContents.sendInputEvent({type:'mouseMove',...point});
- await probe('settle()');
- const hovered=await hoverSnapshot();
- result.hover.push({stop,row,...hovered});
- if(hovered.halo!=='none' || hovered.thumbHalo!=='none')
- result.failures.push('Hover unexpectedly added a halo');
- if(hovered.hovered!==stop || hovered.tick!==stop || Math.abs(hovered.width-(stop>2?5.2:4))>0.1 || hovered.value!=='low' || Math.abs(hovered.thumbWidth-14)>0.1)
- result.failures.push('Hover did not link dot and label without selection: '+JSON.stringify({stop,row,...hovered}));
- }
+ const point=await window.webContents.executeJavaScript(\`(() => {
+ const r=document.querySelectorAll('.composer-thinking-tick')[\${stop}].getBoundingClientRect();
+ return {x:Math.round(r.left+r.width/2),y:Math.round(r.top+r.height/2)};
+ })()\`);
+ window.webContents.sendInputEvent({type:'mouseMove',...point});
+ await probe('settle()');
+ const hovered=await hoverSnapshot();
+ result.hover.push({stop,...hovered});
+ if(hovered.tick!==stop || hovered.value!=='low' || Math.abs(hovered.thumb-restingThumb)>0.1)
+ result.failures.push('Hover did not preview the label without moving the selection: '+JSON.stringify({stop,...hovered}));
}
window.webContents.sendInputEvent({type:'mouseMove',x:5,y:5});
await probe('settle()');
- if((await hoverSnapshot()).hovered!==-1 || (await hoverSnapshot()).tick!==-1)
+ if((await hoverSnapshot()).tick!==-1)
result.failures.push('Hover remained after leaving slider');
await click('omit');
await probe('focusRange()');
diff --git a/scripts/e2e/composer-thinking-layout.tsx b/scripts/e2e/composer-thinking-layout.tsx
index 8f214d9cf..e579bd583 100644
--- a/scripts/e2e/composer-thinking-layout.tsx
+++ b/scripts/e2e/composer-thinking-layout.tsx
@@ -20,11 +20,11 @@ function Fixture({ width, crowded, model }: { width: number; crowded: boolean; m
const listRef = useRef<HTMLDivElement>(null);
const searchRef = useRef<HTMLInputElement>(null);
const controller: ReturnType<typeof useComposerModelMenu> = {
- open, setOpen, sections: [], activeSection: null, selectSection: noop, showSectionRail: false, paneRows: 0, searching: false, query: "", setQuery: noop,
+ open, setOpen, sections: [], activeSection: null, sectionStep: 0, selectSection: noop, showSectionRail: false, paneRows: 0, searching: false, query: "", setQuery: noop,
modelHighlight: -1, setModelHighlight: noop,
thinkingHighlight: -1, setThinkingHighlight: noop,
modelSearchRef: searchRef, modelListRef: listRef,
- thinkingListRef: listRef, modelGroups: [], flatModels: [],
+ thinkingListRef: listRef, modelGroups: [], recentEntries: [], flatModels: [],
thinkingMenuLevels: levels,
selectModel: async () => {}, selectThinkingLevel: async () => {},
commitThinkingLevel: async (next) => { setLevel(next); return true; },
@@ -131,17 +131,17 @@ globalThis.composerThinkingPointerProbe = {
},
pressed: () => element(".composer-model-thinking-chip").matches(":active"),
railTarget(index) {
- const dot = document.querySelectorAll(".composer-thinking-dot")[index].getBoundingClientRect();
+ const stop = document.querySelectorAll(".composer-thinking-tick")[index].getBoundingClientRect();
const range = element(".composer-thinking-range").getBoundingClientRect();
- return { x: Math.round(dot.left + dot.width / 2), y: Math.round(range.top + range.height / 2) };
+ return { x: Math.round(stop.left + stop.width / 2), y: Math.round(range.top + range.height / 2) };
},
focusRange: () => element(".composer-thinking-range").focus(),
motionState() {
const thumb = element(".composer-thinking-thumb");
const visual = thumb.getBoundingClientRect();
- const dot = element(".composer-thinking-dot.active").getBoundingClientRect();
+ const stop = element(".composer-thinking-tick.active").getBoundingClientRect();
return { dragging: element(".composer-thinking-slider").hasAttribute("data-dragging"),
- gap: visual.left + visual.width / 2 - dot.left - dot.width / 2,
+ gap: visual.left + visual.width / 2 - stop.left - stop.width / 2,
animations: thumb.getAnimations().length,
focused: document.activeElement === element(".composer-thinking-range") };
},
diff --git a/scripts/e2e/thinking-slider-motion.tsx b/scripts/e2e/thinking-slider-motion.tsx
index b9d6c8344..54d09fa73 100644
--- a/scripts/e2e/thinking-slider-motion.tsx
+++ b/scripts/e2e/thinking-slider-motion.tsx
@@ -57,7 +57,7 @@ globalThis.thinkingSliderMotionProbe = async () => {
try {
await mount("motion");
const initial = center(thumb());
- const end = center(node(".composer-thinking-dot:last-child"));
+ const end = center(node(".composer-thinking-tick:last-child"));
click("max");
await frame();
const animation = thumb().getAnimations()[0];
@@ -71,7 +71,7 @@ globalThis.thinkingSliderMotionProbe = async () => {
const redirected = center(thumb());
assert(Math.abs(redirected - midway) < 1, "rapid click starts from the current visual position");
await finish();
- assert(Math.abs(center(thumb()) - center(node(".composer-thinking-dot.active"))) < 0.6, "redirected thumb lands on the selected dot");
+ assert(Math.abs(center(thumb()) - center(node(".composer-thinking-tick.active"))) < 0.6, "redirected pill lands on the selected label");
assert(requested.join(",") === "max,low", "animation never commits intermediate levels");
deferred = true;
@@ -115,13 +115,10 @@ globalThis.thinkingSliderMotionProbe = async () => {
click(level);
await finish();
const tick = [...host.querySelectorAll<HTMLButtonElement>("button")].find((item) => item.textContent === level)!;
- assert(Math.abs(center(thumb()) - center(tick)) < 0.6, `${ladder.length} stops: ${level} thumb and label align`);
- const rail = node(".composer-thinking-rail");
- const fill = getComputedStyle(rail, "::after");
- const fillLeft = rail.getBoundingClientRect().left + Number.parseFloat(fill.left);
- const firstDot = node(".composer-thinking-dot").getBoundingClientRect();
- assert(Math.abs(fillLeft - firstDot.left) < 0.05, `${ladder.length} stops: ${level} fill covers the first dot's left edge`);
- assert(Math.abs(fillLeft + Number.parseFloat(fill.width) - center(thumb())) < 0.05, `${ladder.length} stops: ${level} fill still ends at the thumb center`);
+ assert(Math.abs(center(thumb()) - center(tick)) < 0.6, `${ladder.length} stops: ${level} pill and label align`);
+ const pill = thumb().getBoundingClientRect().width;
+ const column = tick.getBoundingClientRect().width;
+ assert(Math.abs(pill - (column - 4)) < 0.6, `${ladder.length} stops: ${level} pill fills its column inside the gutter`);
}
}
return { ok: true, checks };