33 *
44 * Shows different sections and states of the Settings modal:
55 * - General (theme toggle)
6+ * - Agents (task parallelism / nesting)
67 * - Providers (API key configuration)
78 * - Models (custom model management)
9+ * - Modes (per-mode default model / reasoning)
810 * - Experiments
911 *
1012 * NOTE: Projects/MCP stories live in App.mcp.stories.tsx
@@ -19,6 +21,7 @@ import { selectWorkspace } from "./storyHelpers";
1921import { createMockORPCClient } from "../../../.storybook/mocks/orpc" ;
2022import { within , userEvent , waitFor } from "@storybook/test" ;
2123import { getExperimentKey , EXPERIMENT_IDS } from "@/common/constants/experiments" ;
24+ import type { ModeAiDefaults } from "@/common/types/modeAiDefaults" ;
2225import type { TaskSettings } from "@/common/types/tasks" ;
2326
2427export default {
@@ -34,6 +37,7 @@ export default {
3437function setupSettingsStory ( options : {
3538 providersConfig ?: Record < string , { apiKeySet : boolean ; baseUrl ?: string ; models ?: string [ ] } > ;
3639 providersList ?: string [ ] ;
40+ modeAiDefaults ?: ModeAiDefaults ;
3741 taskSettings ?: Partial < TaskSettings > ;
3842 /** Pre-set experiment states in localStorage before render */
3943 experiments ?: Partial < Record < string , boolean > > ;
@@ -54,6 +58,7 @@ function setupSettingsStory(options: {
5458 projects : groupWorkspacesByProject ( workspaces ) ,
5559 workspaces,
5660 providersConfig : options . providersConfig ?? { } ,
61+ modeAiDefaults : options . modeAiDefaults ,
5762 providersList : options . providersList ?? [ "anthropic" , "openai" , "xai" ] ,
5863 taskSettings : options . taskSettings ,
5964 } ) ;
@@ -229,6 +234,35 @@ export const ModelsConfigured: AppStory = {
229234 } ,
230235} ;
231236
237+ /** Modes section - global default model/reasoning per mode */
238+ export const Modes : AppStory = {
239+ render : ( ) => (
240+ < AppWithMocks
241+ setup = { ( ) =>
242+ setupSettingsStory ( {
243+ modeAiDefaults : {
244+ plan : { modelString : "anthropic:claude-sonnet-4-5" , thinkingLevel : "medium" } ,
245+ exec : { modelString : "openai:gpt-5.2" , thinkingLevel : "xhigh" } ,
246+ compact : { modelString : "openai:gpt-5.2-pro" , thinkingLevel : "high" } ,
247+ } ,
248+ } )
249+ }
250+ />
251+ ) ,
252+ play : async ( { canvasElement } : { canvasElement : HTMLElement } ) => {
253+ await openSettingsToSection ( canvasElement , "modes" ) ;
254+
255+ const body = within ( canvasElement . ownerDocument . body ) ;
256+ const dialog = await body . findByRole ( "dialog" ) ;
257+ const modal = within ( dialog ) ;
258+
259+ await modal . findByText ( / M o d e D e f a u l t s / i) ;
260+ await modal . findByText ( / ^ P l a n $ / i) ;
261+ await modal . findByText ( / ^ E x e c $ / i) ;
262+ await modal . findByText ( / ^ C o m p a c t $ / i) ;
263+ } ,
264+ } ;
265+
232266/** Experiments section - shows available experiments */
233267export const Experiments : AppStory = {
234268 render : ( ) => < AppWithMocks setup = { ( ) => setupSettingsStory ( { } ) } /> ,
0 commit comments