Repository navigation
feat(settings): dynamic thinking effort experimental toggle (DTE-1) #1521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
710bf61
521e0e6
e2f249a
53f22dc
39762bf
e89cced
9189386
8fc8d1e
01a111e
bd914cf
ba3a970
e99560c
1c6b465
a00994e
730d04f
3123eea
89fee5b
44f6e90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { experimentIds, experimentIdsSchema, experimentsSchema } from "../experiment.js" | ||
|
|
||
| describe("dynamicThinkingEffort experiment", () => { | ||
| it("is part of the experiment id enum", () => { | ||
| expect(experimentIds).toContain("dynamicThinkingEffort") | ||
| expect(experimentIdsSchema.safeParse("dynamicThinkingEffort").success).toBe(true) | ||
| }) | ||
|
|
||
| it("parses enabled and disabled states", () => { | ||
| expect(experimentsSchema.parse({ dynamicThinkingEffort: true })).toEqual({ dynamicThinkingEffort: true }) | ||
| expect(experimentsSchema.parse({ dynamicThinkingEffort: false })).toEqual({ dynamicThinkingEffort: false }) | ||
| expect(experimentsSchema.parse({})).toEqual({}) | ||
| }) | ||
|
|
||
| it("rejects non-boolean values", () => { | ||
| expect(experimentsSchema.safeParse({ dynamicThinkingEffort: "yes" }).success).toBe(false) | ||
| expect(experimentIdsSchema.safeParse("dynamic-thinking-effort").success).toBe(false) | ||
| }) | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { useState } from "react" | ||
|
|
||
| import type { Experiments } from "@roo-code/types" | ||
|
|
||
| import { EXPERIMENT_IDS, experimentDefault } from "@roo/experiments" | ||
|
|
||
| import { ExperimentalSettings } from "../ExperimentalSettings" | ||
| import { AppProviders } from "../../../../playwright/AppProviders" | ||
|
|
||
| export function ExperimentalSettingsStory() { | ||
| const [experiments, setExperiments] = useState<Experiments>({ | ||
| ...experimentDefault, | ||
| [EXPERIMENT_IDS.DYNAMIC_THINKING_EFFORT]: true, | ||
| }) | ||
|
|
||
| return ( | ||
| <AppProviders> | ||
| <div | ||
| data-testid="experimental-settings-story" | ||
| className="w-[488px] max-w-full rounded-lg border border-vscode-panel-border bg-vscode-editor-background p-4 text-vscode-editor-foreground"> | ||
| <ExperimentalSettings | ||
| experiments={experiments} | ||
| setExperimentEnabled={(id, enabled) => setExperiments((current) => ({ ...current, [id]: enabled }))} | ||
| /> | ||
| </div> | ||
| </AppProviders> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { expect, test } from "../../../../playwright/coverage-fixture" | ||
| import { mountedStory } from "../../../../playwright/mounted-story" | ||
| import { applyVisualTheme, visualThemes } from "../../../../playwright/themes" | ||
|
|
||
| for (const theme of visualThemes) { | ||
| test(`renders the experimental settings section in the VS Code ${theme.name} theme`, async ({ mount, page }) => { | ||
| const component = mountedStory(await mount("experimental-settings")) | ||
| await applyVisualTheme(page, theme) | ||
| const story = component.getByTestId("experimental-settings-story") | ||
| await expect(story).toHaveScreenshot(`experimental-settings-${theme.name}.png`) | ||
|
Check failure on line 10 in webview-ui/src/components/settings/__tests__/ExperimentalSettings.visual.tsx
|
||
| }) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.