Commit 5d7bb89f4 for llama.cpp

commit 5d7bb89f4719243dc52fe387bcb67c3518256565
Author: Aleksander Grygier <aleksander.grygier@gmail.com>
Date:   Thu Nov 26 19:58:57 2026 +0100

    ui: fix the phone model sheet's search field and reasoning row (#33144)

    * ui: fix the phone model sheet's search width and reasoning row

    Give the sheet's foot the lists' gutter, so the search field lines up
    with the inset groups above it. Draw the reasoning effort as an inset
    group like the All models row, with its levels sliding open inside it.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: give the sheet search and header values the plain text field look

    The phone model sheet's search borrowed the chat form's glass surface,
    gradient edge and all; it is now a plain SearchInput in the chat form's
    pill shape. The header value fields drew their own transparent textarea
    next to Input keys; they use the shared Textarea, so every text field has
    the same background and border.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: hide the reasoning row while the phone model sheet searches

    A typed search gives the sheet to its results; the reasoning row comes
    back once the search is cleared.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: use a model for dictation from the phone model sheet

    Holding a model that hears offers Use for dictation, as the desktop row's
    microphone does, and the model chosen for it can hand the choice back to
    Automatic.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: tidy the phone model sheet after review

    - Keep for dictation on the model Automatic picked, instead of Use for
      dictation on a model that already transcribes it.
    - Keep the reasoning row mounted while a search hides it, so its levels
      are as they were left.
    - Name the Reasoning row label once for both pickers.
    - Restore the stores the dictation test changes, and cover the keep case.
    - Mention the dictation options on the Mobile Flows page.

    Assisted-by: Claude (Opus 5.5 Medium)

diff --git a/ui/apps/chat/src/lib/components/app/forms/KeyValuePairs.svelte b/ui/apps/chat/src/lib/components/app/forms/KeyValuePairs.svelte
index 3a3571ea6..861c08fc6 100644
--- a/ui/apps/chat/src/lib/components/app/forms/KeyValuePairs.svelte
+++ b/ui/apps/chat/src/lib/components/app/forms/KeyValuePairs.svelte
@@ -1,5 +1,6 @@
 <script lang="ts">
 	import { Input } from '@ggml-org/llama-ui/ui/input';
+	import { Textarea } from '@ggml-org/llama-ui/ui/textarea';
 	import { Plus, Trash2 } from '@lucide/svelte';
 	import {
 		KEY_VALUE_PAIR_KEY_MAX_LENGTH,
@@ -140,9 +141,9 @@
 						value={pair.key}
 					/>

-					<textarea
+					<Textarea
 						{@attach autoResizeTextarea}
-						class="flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-body leading-5 md:text-body-sm placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
+						class="min-h-0 flex-1 resize-none leading-5"
 						maxlength={KEY_VALUE_PAIR_VALUE_MAX_LENGTH}
 						onblur={(e) => trimPairValue(index, e.currentTarget.value)}
 						oninput={(e) => {
@@ -150,9 +151,9 @@
 							autoResizeTextarea(e.currentTarget);
 						}}
 						placeholder={valuePlaceholder}
-						rows="1"
+						rows={1}
 						value={pair.value}
-					></textarea>
+					/>

 					<button
 						aria-label="Remove item"
diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoning.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoning.svelte
index c412dc905..fa942cae1 100644
--- a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoning.svelte
+++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorReasoning.svelte
@@ -1,13 +1,18 @@
 <!--
 	The chat's reasoning effort, at the foot of the model picker: one row with the level in use, which opens the levels
 	under it, sliding open and shut (CollapsibleSection). `menu` is the desktop dropdown's (its rows are menu items),
-	`list` the phone drawer's.
+	`list` the phone sheet's, an inset group that opens in place.
 -->
 <script lang="ts">
+	import { InsetList, InsetListRow } from '@ggml-org/llama-ui/app/sheets';
 	import * as DropdownMenu from '@ggml-org/llama-ui/ui/dropdown-menu';
 	import { Check, Lightbulb, LightbulbOff } from '@lucide/svelte';
 	import { CollapsibleSection } from '#lib/components/app/index.ts';
-	import { ICON_CLASS_DEFAULT, REASONING_EFFORT_LABELS } from '#lib/constants/index.ts';
+	import {
+		ICON_CLASS_DEFAULT,
+		REASONING_EFFORT_LABELS,
+		REASONING_EFFORT_ROW_LABEL
+	} from '#lib/constants/index.ts';
 	import { useReasoningMenu } from '#lib/hooks/use-reasoning-menu.svelte.ts';
 	import type { ReasoningEffortLevel } from '#lib/types/index.ts';

@@ -29,11 +34,26 @@
 		<Lightbulb class="size-icon-md shrink-0 text-muted-foreground" />
 	{/if}

-	<span class="flex-1">Reasoning</span>
+	<span class="flex-1">{REASONING_EFFORT_ROW_LABEL}</span>

 	<span class="text-caption text-muted-foreground">{current}</span>
 {/snippet}

+<!-- the phone row, laid out as an InsetListRow: the icon outside the body, the value at its end -->
+{#snippet listHeader()}
+	{#if reasoning.isOff}
+		<LightbulbOff class="{ICON_CLASS_DEFAULT} shrink-0 text-muted-foreground" />
+	{:else}
+		<Lightbulb class="{ICON_CLASS_DEFAULT} shrink-0 text-muted-foreground" />
+	{/if}
+
+	<span class="inset-list-row-body">
+		<span class="flex-1">{REASONING_EFFORT_ROW_LABEL}</span>
+
+		<span class="text-muted-foreground">{current}</span>
+	</span>
+{/snippet}
+
 {#snippet levelLabel(level: ReasoningEffortLevel)}
 	{@const tokenLabel = reasoning.tokenLabel(level)}

@@ -64,24 +84,34 @@
 		</CollapsibleSection>
 	</DropdownMenu.Group>
 {:else}
-	<div class="flex flex-col px-2 pt-1" data-slot="models-selector-reasoning">
-		<CollapsibleSection
-			defaultOpen={false}
-			trigger={header}
-			triggerClass="flex min-h-11 w-full cursor-pointer items-center gap-2 rounded-md px-3 text-left text-body-sm transition-colors hover:bg-accent"
-		>
-			<div class="flex flex-col">
-				{#each reasoning.levels as level (level.value)}
-					<button
-						aria-pressed={reasoning.isSelected(level)}
-						class="flex min-h-11 w-full cursor-pointer items-center gap-3 rounded-md pr-3 pl-6 text-left text-body-sm transition-colors hover:bg-accent"
-						onclick={() => reasoning.select(level)}
-						type="button"
-					>
-						{@render levelLabel(level)}
-					</button>
-				{/each}
-			</div>
+	<!-- an inset group, as the sheet's other rows: the row with the level in use, and the levels
+	     sliding open under it inside the same group -->
+	<InsetList data-slot="models-selector-reasoning">
+		<CollapsibleSection defaultOpen={false} trigger={listHeader} triggerClass="inset-list-row">
+			{#each reasoning.levels as level (level.value)}
+				{@const tokenLabel = reasoning.tokenLabel(level)}
+
+				<!-- every level keeps its divider, the first one included: the trigger is above it -->
+				<InsetListRow
+					aria-pressed={reasoning.isSelected(level)}
+					bodyClass="border-t!"
+					onclick={() => reasoning.select(level)}
+				>
+					{#snippet leading()}
+						{#if reasoning.isSelected(level)}
+							<Check class="{ICON_CLASS_DEFAULT} shrink-0 text-(--action-primary)" />
+						{:else}
+							<span class="{ICON_CLASS_DEFAULT} shrink-0"></span>
+						{/if}
+					{/snippet}
+
+					<span class="min-w-0 flex-1 truncate">{level.label}</span>
+
+					{#if tokenLabel}
+						<span class="shrink-0 text-caption text-muted-foreground">{tokenLabel}</span>
+					{/if}
+				</InsetListRow>
+			{/each}
 		</CollapsibleSection>
-	</div>
+	</InsetList>
 {/if}
diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte
index f9ecb3a7d..02c8fc184 100644
--- a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte
+++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte
@@ -3,9 +3,9 @@
 	few models in reach (loaded, favorite, recent), each marked when it is the chat's or the
 	dictation's, and a row that opens all models as a page, in groups of the
 	same rows. Tapping a model switches the chat to it, loading it if need be, as on a desktop;
-	holding it opens its menu, as a held chat row does: unload it, or open its details over the
-	sheet. A search shows its results in place; it stays at the sheet's foot, under the reasoning
-	effort as the desktop picker has it.
+	holding it opens its menu, as a held chat row does: unload it, use it for dictation when it
+	hears, or open its details over the sheet. A search shows its results in place; it stays at
+	the sheet's foot, under the reasoning effort as the desktop picker has it.
 -->
 <script lang="ts">
 	import ModelAvatar from '../ModelAvatar.svelte';
@@ -22,7 +22,7 @@
 	} from '@ggml-org/llama-ui/app/sheets';
 	import { SHEET_CONTENT_CLASS } from '@ggml-org/llama-ui/constants';
 	import * as Drawer from '@ggml-org/llama-ui/ui/drawer';
-	import { Check, Info, Loader2, Mic, MoreHorizontal, PowerOff } from '@lucide/svelte';
+	import { Check, Info, Loader2, Mic, MicOff, MoreHorizontal, PowerOff } from '@lucide/svelte';
 	import DropdownMenuActions from '#lib/components/app/navigation/DropdownMenuActions.svelte';
 	import {
 		MODELS_SHEET_GROUP_KEYS,
@@ -30,7 +30,8 @@
 		ROW_LONG_PRESS_MS,
 		SETTINGS_KEYS,
 		SHEET_AUTO_HEIGHT_CLASS,
-		SHEET_FULL_HEIGHT_CLASS
+		SHEET_FULL_HEIGHT_CLASS,
+		VOICE_DICTATION_MODEL_LABEL
 	} from '#lib/constants/index.ts';
 	import { ModelsSheetPage } from '#lib/enums/index.ts';
 	import { useLongPress } from '#lib/hooks/use-long-press.svelte.ts';
@@ -197,6 +198,25 @@
 			}
 		}

+		// as the desktop row's microphone: a router model that hears can be chosen to transcribe
+		// dictation (the one Automatic picked is kept so), and the chosen one can hand the choice
+		// back to Automatic
+		if (serverStore.isRouterMode && voiceStore.roleOf(model) !== null) {
+			const dictates = voiceStore.isDictationModel(model);
+			const chosen = dictates && !voiceStore.dictationIsAutomatic;
+
+			let label: string = VOICE_DICTATION_MODEL_LABEL.use;
+
+			if (chosen) label = VOICE_DICTATION_MODEL_LABEL.pickAutomatically;
+			else if (dictates) label = VOICE_DICTATION_MODEL_LABEL.keep;
+
+			actions.push({
+				icon: chosen ? MicOff : Mic,
+				label,
+				onclick: () => voiceStore.toggleDictation(model)
+			});
+		}
+
 		actions.push({
 			icon: Info,
 			label: MODELS_SHEET_TEXT.MORE_DETAILS,
@@ -376,16 +396,19 @@
 			{/if}
 		</SheetPages>

-		<!-- the reasoning effort, then the search at the sheet's foot, in the chat form's own
-		     surface and shape -->
-		<div class="shrink-0 px-2 pt-2 pb-[max(0.5rem,var(--safe-area-bottom))]">
+		<!-- the reasoning effort, then the search at the sheet's foot: a plain text field in the chat
+		     form's shape; both keep the lists' gutter -->
+		<div class="flex shrink-0 flex-col gap-3 px-4 pt-2 pb-[max(0.5rem,var(--safe-area-bottom))]">
+			<!-- a search gives the sheet to its results: the reasoning row steps aside until it is
+			     cleared, and stays mounted so its levels are as they were left -->
 			{#if hasEffort}
-				<ModelsSelectorReasoning variant="list" />
+				<div class={isSearching ? 'hidden' : 'contents'}>
+					<ModelsSelectorReasoning variant="list" />
+				</div>
 			{/if}

 			<SearchInput
-				class="chat-form-surface overflow-hidden rounded-(--chat-form-single-row-radius)"
-				inputClass="h-12 max-md:h-12 border-0 bg-transparent shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent"
+				inputClass="h-12 max-md:h-12 rounded-(--chat-form-single-row-radius)"
 				onInput={(value) => onSearchChange?.(value)}
 				onKeyDown={handleSearchKeyDown}
 				placeholder={MODELS_SHEET_TEXT.SEARCH_PLACEHOLDER}
diff --git a/ui/apps/chat/src/lib/constants/reasoning-effort.constants.ts b/ui/apps/chat/src/lib/constants/reasoning-effort.constants.ts
index bafda1a69..aef8b8b4e 100644
--- a/ui/apps/chat/src/lib/constants/reasoning-effort.constants.ts
+++ b/ui/apps/chat/src/lib/constants/reasoning-effort.constants.ts
@@ -5,6 +5,9 @@ import type { ReasoningEffortLevel } from '#lib/types/index.ts';
  * Reasoning effort UI labels.
  * Keys match the ReasoningEffort enum values for type-safe lookups.
  */
+/** The reasoning effort row's label, in the desktop and phone model pickers. */
+export const REASONING_EFFORT_ROW_LABEL = 'Reasoning';
+
 export const REASONING_EFFORT_LABELS: Record<string, string> = {
 	[ReasoningEffort.DEFAULT]: 'Default',
 	[ReasoningEffort.HIGH]: 'High',
diff --git a/ui/apps/chat/src/lib/constants/voice.constants.ts b/ui/apps/chat/src/lib/constants/voice.constants.ts
index 7fb1a80d0..87992700b 100644
--- a/ui/apps/chat/src/lib/constants/voice.constants.ts
+++ b/ui/apps/chat/src/lib/constants/voice.constants.ts
@@ -117,6 +117,10 @@ export const VOICE_DICTATION_MODEL_LABEL = {
 	automatic: 'Transcribes dictation, picked automatically. Click to keep it',
 	chosen: 'Transcribes dictation. Click to pick automatically',
 	current: 'transcribes dictation',
+	/** The phone menu's keep on the model Automatic picked. */
+	keep: 'Keep for dictation',
+	/** The phone menu's way back from a chosen model to Automatic. */
+	pickAutomatically: 'Pick dictation model automatically',
 	use: 'Use for dictation'
 } as const;

diff --git a/ui/apps/chat/tests/client/components/ModelsSelectorSheetWrapper.svelte b/ui/apps/chat/tests/client/components/ModelsSelectorSheetWrapper.svelte
new file mode 100644
index 000000000..284f1592f
--- /dev/null
+++ b/ui/apps/chat/tests/client/components/ModelsSelectorSheetWrapper.svelte
@@ -0,0 +1,12 @@
+<script lang="ts">
+	import * as Tooltip from '@ggml-org/llama-ui/ui/tooltip';
+	import ModelsSelectorSheet from '#lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte';
+	import type { ComponentProps } from 'svelte';
+
+	let props: ComponentProps<typeof ModelsSelectorSheet> = $props();
+</script>
+
+<!-- The held-row menu mounts a tooltip, which needs the provider +layout.svelte supplies. -->
+<Tooltip.Provider>
+	<ModelsSelectorSheet {...props} />
+</Tooltip.Provider>
diff --git a/ui/apps/chat/tests/client/models-sheet-dictation.svelte.test.ts b/ui/apps/chat/tests/client/models-sheet-dictation.svelte.test.ts
new file mode 100644
index 000000000..319e96b6a
--- /dev/null
+++ b/ui/apps/chat/tests/client/models-sheet-dictation.svelte.test.ts
@@ -0,0 +1,123 @@
+// Guards the phone model sheet's held-row menu: a model that hears offers to transcribe
+// dictation, as the desktop row's microphone does, and a model that cannot hear does not.
+
+import ModelsSelectorSheetWrapper from './components/ModelsSelectorSheetWrapper.svelte';
+import {
+	MODELS_SHEET_TEXT,
+	SETTINGS_KEYS,
+	VOICE_DICTATION_MODEL_LABEL,
+	VOICE_TRANSCRIPTION_MODEL_AUTO
+} from '#lib/constants/index.ts';
+import { ServerRole, VoiceModelRole } from '#lib/enums/index.ts';
+import { serverStore, settingsStore, voiceStore } from '#lib/stores/index.ts';
+import type { ModelItem } from '#lib/utils/index.ts';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { page } from 'vitest/browser';
+import { render } from 'vitest-browser-svelte';
+
+const HEARS = 'org/Voxtral-Mini-3B';
+const DEAF = 'org/Qwen3-8B';
+const item = (model: string): ModelItem => ({
+	option: { capabilities: [], id: model, model, name: model }
+});
+
+let previousConfig: typeof settingsStore.config;
+let previousRole: typeof serverStore.role;
+
+beforeEach(async () => {
+	previousConfig = settingsStore.config;
+	previousRole = serverStore.role;
+	settingsStore.config = {
+		...settingsStore.config,
+		[SETTINGS_KEYS.VOICE_TRANSCRIPTION_MODEL]: VOICE_TRANSCRIPTION_MODEL_AUTO
+	};
+	serverStore.role = ServerRole.ROUTER;
+	vi.spyOn(voiceStore, 'roleOf').mockImplementation((model) =>
+		model === HEARS ? VoiceModelRole.VOICE : null
+	);
+	// the drawer captures the pointer of a press on its content, and a dispatched touch has none
+	vi.spyOn(Element.prototype, 'setPointerCapture').mockImplementation(() => {});
+	await page.viewport(390, 844);
+});
+
+afterEach(() => {
+	vi.restoreAllMocks();
+	settingsStore.config = previousConfig;
+	serverStore.role = previousRole;
+});
+
+/** Holds a row with a finger: a touch press, then the context menu a long touch raises. */
+async function hold(row: HTMLElement) {
+	row.dispatchEvent(
+		new PointerEvent('pointerdown', { bubbles: true, isPrimary: true, pointerType: 'touch' })
+	);
+	row.dispatchEvent(new MouseEvent('contextmenu', { bubbles: true, cancelable: true }));
+}
+
+function renderSheet() {
+	return render(ModelsSelectorSheetWrapper, {
+		activeId: DEAF,
+		open: true,
+		quickItems: [item(DEAF), item(HEARS)]
+	});
+}
+
+it('offers a model that hears for dictation, and picks it', async () => {
+	const screen = renderSheet();
+	const row = screen.getByRole('button', { name: /Voxtral/ });
+
+	await expect.element(row).toBeVisible();
+	await hold(row.element() as HTMLElement);
+
+	const use = page.getByRole('menuitem', { name: VOICE_DICTATION_MODEL_LABEL.use });
+
+	await expect.element(use).toBeVisible();
+	await use.click();
+
+	expect(settingsStore.config[SETTINGS_KEYS.VOICE_TRANSCRIPTION_MODEL]).toBe(HEARS);
+});
+
+it('does not offer a model that cannot hear', async () => {
+	const screen = renderSheet();
+	const row = screen.getByRole('button', { name: /Qwen3/ });
+
+	await expect.element(row).toBeVisible();
+	await hold(row.element() as HTMLElement);
+
+	await expect
+		.element(page.getByRole('menuitem', { name: MODELS_SHEET_TEXT.MORE_DETAILS }))
+		.toBeVisible();
+	expect(page.getByRole('menuitem', { name: VOICE_DICTATION_MODEL_LABEL.use }).query()).toBeNull();
+});
+
+it('hands the chosen model back to Automatic', async () => {
+	settingsStore.config = {
+		...settingsStore.config,
+		[SETTINGS_KEYS.VOICE_TRANSCRIPTION_MODEL]: HEARS
+	};
+	vi.spyOn(voiceStore, 'isDictationModel').mockImplementation((model) => model === HEARS);
+
+	const screen = renderSheet();
+	const row = screen.getByRole('button', { name: /Voxtral/ });
+
+	await expect.element(row).toBeVisible();
+	await hold(row.element() as HTMLElement);
+	await page.getByRole('menuitem', { name: VOICE_DICTATION_MODEL_LABEL.pickAutomatically }).click();
+
+	expect(settingsStore.config[SETTINGS_KEYS.VOICE_TRANSCRIPTION_MODEL]).toBe(
+		VOICE_TRANSCRIPTION_MODEL_AUTO
+	);
+});
+
+it('keeps the model Automatic picked', async () => {
+	vi.spyOn(voiceStore, 'isDictationModel').mockImplementation((model) => model === HEARS);
+
+	const screen = renderSheet();
+	const row = screen.getByRole('button', { name: /Voxtral/ });
+
+	await expect.element(row).toBeVisible();
+	await hold(row.element() as HTMLElement);
+	await page.getByRole('menuitem', { name: VOICE_DICTATION_MODEL_LABEL.keep }).click();
+
+	expect(settingsStore.config[SETTINGS_KEYS.VOICE_TRANSCRIPTION_MODEL]).toBe(HEARS);
+});
diff --git a/ui/apps/chat/tests/stories/mobile/MobileFlows.svx b/ui/apps/chat/tests/stories/mobile/MobileFlows.svx
index 495e297fe..278939bc3 100644
--- a/ui/apps/chat/tests/stories/mobile/MobileFlows.svx
+++ b/ui/apps/chat/tests/stories/mobile/MobileFlows.svx
@@ -62,7 +62,7 @@ Stories: `Llama Chat/Chat/ChatForm/ChatFormActionAddDrawer`.
 	<SheetFlow flow={MODELS_FLOW} />
 </Figure>

-The sheet opens short, with up to six models: the chat's, the one that transcribes dictation, then the loaded, favorite and recent ones. A tap switches the chat to a model and loads it if need be. Holding a row opens its menu: Unload, or More details over the sheet. The search stays at the sheet's foot, under the reasoning effort, and shows its results in place at full height.
+The sheet opens short, with up to six models: the chat's, the one that transcribes dictation, then the loaded, favorite and recent ones. A tap switches the chat to a model and loads it if need be. Holding a row opens its menu: Unload, Use for dictation on a model that hears (Keep for dictation on the one picked automatically, Pick dictation model automatically on the one chosen), or More details over the sheet. The search stays at the sheet's foot, under the reasoning effort, and shows its results in place at full height.

 Stories: `Llama Chat/Models/ModelsSelectorSheet`.

diff --git a/ui/apps/chat/tests/stories/models/ModelsSelectorSheet.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsSelectorSheet.stories.svelte
index 1a0a38a5c..aae551549 100644
--- a/ui/apps/chat/tests/stories/models/ModelsSelectorSheet.stories.svelte
+++ b/ui/apps/chat/tests/stories/models/ModelsSelectorSheet.stories.svelte
@@ -3,7 +3,7 @@
 	import ModelsSelectorSheet from '#lib/components/app/models/ModelsSelector/ModelsSelectorSheet.svelte';
 	import { MODELS_SHEET_TEXT } from '#lib/constants/index.ts';
 	import type { GroupedModelOptions, ModelItem } from '#lib/utils/index.ts';
-	import { screen } from 'storybook/test';
+	import { expect, screen } from 'storybook/test';

 	// a phone's model picker: a short sheet with the models in reach (the chat's, the loaded,
 	// favorite and recent ones) and a row to all of them, a page of groups. The search stays at
@@ -31,6 +31,7 @@
 	const LLAMA = model('Llama-3.2-3B-Instruct', 'meta');
 	const PHI = model('Phi-4-mini', 'microsoft');
 	const REMOVED_MODEL = 'acme/Removed-7B';
+	const REASONING_ROW_NAME = /^Reasoning/;

 	const groups: GroupedModelOptions = {
 		available: [
@@ -45,7 +46,8 @@
 		groups,
 		loadedItems: [QWEN],
 		open: true,
-		quickItems: [QWEN, GEMMA]
+		quickItems: [QWEN, GEMMA],
+		showReasoning: true
 	};
 </script>

@@ -62,7 +64,25 @@
 	}}
 />

-<Story args={{ ...args, searchTerm: 'phi' }} name="Search results" />
+<!-- the reasoning row opens its levels in place, inside its own inset group -->
+<Story
+	{args}
+	name="Reasoning effort"
+	play={async ({ userEvent }) => {
+		await userEvent.click(await screen.findByRole('button', { name: REASONING_ROW_NAME }));
+		await screen.findByRole('button', { name: /^Off$/ });
+	}}
+/>
+
+<!-- a search hides the reasoning row until it is cleared -->
+<Story
+	args={{ ...args, searchTerm: 'phi' }}
+	name="Search results"
+	play={async () => {
+		await screen.findByRole('heading', { name: MODELS_SHEET_TEXT.LOADED });
+		await expect(screen.queryByRole('button', { name: REASONING_ROW_NAME })).toBeNull();
+	}}
+/>

 <Story
 	args={{ ...args, activeId: null, quickItems: [GEMMA], unavailableModel: REMOVED_MODEL }}