-
Notifications
You must be signed in to change notification settings - Fork 226
issue #685 - point 8 - Allow disabling the follow-up auto-select timer #1214
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
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 @@ | ||
| {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,7 +254,7 @@ export const AutoApproveSettings = ({ | |
| label={t("settings:autoApprove.followupQuestions.timeoutLabel")}> | ||
| <div className="flex items-center gap-2"> | ||
| <Slider | ||
| min={1000} | ||
| min={0} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing |
||
| max={300000} | ||
| step={1000} | ||
| value={[followupAutoApproveTimeoutMs]} | ||
|
|
@@ -263,7 +263,11 @@ export const AutoApproveSettings = ({ | |
| } | ||
| data-testid="followup-timeout-slider" | ||
| /> | ||
| <span className="w-20">{followupAutoApproveTimeoutMs / 1000}s</span> | ||
| <span className="w-20"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a user-visible settings state, consider adding a Playwright CT snapshot of the auto-approve timeout row showing the "Disabled" label. The settings screen already has visual tests to follow ( |
||
| {followupAutoApproveTimeoutMs === 0 | ||
| ? t("settings:autoApprove.followupQuestions.timeoutDisabled") | ||
| : `${followupAutoApproveTimeoutMs / 1000}s`} | ||
| </span> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| </div> | ||
| <div className="text-vscode-descriptionForeground text-sm mt-1"> | ||
| {t("settings:autoApprove.followupQuestions.timeoutLabel")} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* v8 ignore file -- Playwright component fixture is covered by the visual test. */ | ||
| import React from "react" | ||
|
|
||
| import { TranslationContext } from "@/i18n/TranslationContext" | ||
| import i18next from "@/i18n/setup" | ||
| import { ExtensionStateContextProvider } from "@/context/ExtensionStateContext" | ||
| import { AutoApproveSettings } from "../AutoApproveSettings" | ||
|
|
||
| export const AutoApproveSettingsFixture = () => ( | ||
| <TranslationContext.Provider | ||
| value={{ | ||
| t: (key) => (key === "settings:autoApprove.followupQuestions.timeoutDisabled" ? "Disabled" : key), | ||
| i18n: i18next, | ||
| }}> | ||
| <ExtensionStateContextProvider | ||
| initialState={{ autoApprovalEnabled: false, alwaysAllowFollowupQuestions: true }}> | ||
| <div className="w-[680px] bg-vscode-editor-background p-4 text-vscode-foreground"> | ||
| <AutoApproveSettings | ||
| alwaysAllowFollowupQuestions | ||
| followupAutoApproveTimeoutMs={0} | ||
| setCachedStateField={() => {}} | ||
| /> | ||
| </div> | ||
| </ExtensionStateContextProvider> | ||
| </TranslationContext.Provider> | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import React from "react" | ||
|
|
||
| import { expect, test } from "../../../../playwright/coverage-fixture" | ||
| import { AutoApproveSettingsFixture } from "./AutoApproveSettings.visual.fixture" | ||
|
|
||
| test("renders follow-up timeout row with disabled state label in the VS Code dark theme", async ({ mount, page }) => { | ||
| // The full settings bundle can leave a bare Zod reference after CT tree-shaking. | ||
| await page.evaluate(() => Object.assign(globalThis, { z: undefined })) | ||
|
|
||
| const component = await mount(<AutoApproveSettingsFixture />) | ||
|
|
||
| await component.evaluate(async () => { | ||
| await document.fonts.ready | ||
| await new Promise<void>((resolve) => requestAnimationFrame(() => resolve())) | ||
| }) | ||
|
|
||
| await expect(component).toHaveScreenshot("auto-approve-followup-timeout-disabled-dark.png") | ||
| }) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing clamps a negative
followupAutoApproveTimeoutMsbefore it reaches this guard, so a> 0vs!== 0mutation would be indistinguishable on the values the suite tests (0, 3000, 5000). Worth adding a negative-value case?