Skip to content

issue #685 - point 8 - Allow disabling the follow-up auto-select timer - #1214

Open
murd0cc wants to merge 5 commits into
Zoo-Code-Org:mainfrom
murd0cc:issue/685
Open

issue #685 - point 8 - Allow disabling the follow-up auto-select timer#1214
murd0cc wants to merge 5 commits into
Zoo-Code-Org:mainfrom
murd0cc:issue/685

Conversation

@murd0cc

@murd0cc murd0cc commented Aug 9, 2026

Copy link
Copy Markdown

Related GitHub Issue

Tackles: #685

Description

The HOW:

The auto-select timer can now be disabled by setting the slider to 0 seconds, which displays as “Disabled” in the UI at AutoApproveSettings.tsx:267.

The timer logic in FollowUpSuggest.tsx:47 suppresses the countdown when the value is 0 (disabledTimeoutState added).

Test Procedure

All tests pass.

Pre-Submission Checklist

  • Issue Linked: [BUG] Top issues in roo code / zoo code that i hate! #685 (see "Related GitHub Issue" above).
  • Scope: One of the points mentioned in the issue.
  • Self-Review:
  • Testing: The new regression test FollowUpSuggest.spec.tsx:237 confirms that no countdown appears when the timeout is disabled.
  • Visual Snapshot (UI changes only): Not applicable.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

My first contribution ever. Go easy on me.

Get in Touch

I don't use discord. Github works for me, if it's good enough for you as well !

Summary by CodeRabbit

  • New Features

    • Added an option to disable the follow-up auto-approval timeout.
    • Settings display “Disabled” when the timeout is set to zero.
    • Added translated timeout and disabled-state labels across supported languages.
  • Bug Fixes

    • The countdown no longer runs when auto-approval is paused or the timeout is disabled.
    • Normal interactions cancel the countdown, while shift-click actions preserve it.
    • Default timeout behavior remains available when no valid timeout is configured.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The follow-up auto-approval timeout can now be disabled with a zero value. The settings display shows Disabled, and FollowUpSuggest omits its countdown when auto-approval is paused or the timeout is non-positive.

Changes

Follow-up auto-approval timeout

Layer / File(s) Summary
Timeout setting and display
webview-ui/src/components/settings/AutoApproveSettings.tsx, webview-ui/src/i18n/locales/*/settings.json, webview-ui/eslint-suppressions.json
The timeout slider accepts 0. The label displays Disabled for zero and seconds for positive values. Localized labels were added.
Timeout setting validation
webview-ui/src/components/settings/__tests__/*
Tests cover zero, non-zero, and unset values, conditional control visibility, cached updates, and the disabled visual state.
Countdown eligibility and coverage
webview-ui/src/components/chat/FollowUpSuggest.tsx, webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
The countdown does not start while auto-approval is paused or when the timeout is non-positive. Tests cover zero, negative, and undefined timeout values and suggestion interactions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: taltas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the issue scope and the primary change: allowing users to disable the follow-up auto-select timer.
Description check ✅ Passed The description covers the linked issue, implementation, testing, checklist, and documentation impact, with sufficient detail for review.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
webview-ui/src/components/settings/AutoApproveSettings.tsx (1)

256-270: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add focused settings coverage.

The supplied regression test covers only FollowUpSuggest. Add AutoApproveSettings.spec.tsx coverage for the zero slider value, the Disabled label, and saving 0 through setCachedStateField. Include an unset/default case so the 60000 default cannot hide a missing value.

As per coding guidelines, add focused tests for UI binding and save behavior, including explicit 0 and unset/default cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/settings/AutoApproveSettings.tsx` around lines 256
- 270, Add focused tests in AutoApproveSettings.spec.tsx for the follow-up
timeout slider: verify an explicit value of 0 renders the “Disabled” label and
saves 0 through setCachedStateField, and verify the unset/default state uses the
60000 default rather than masking a missing value. Keep coverage scoped to this
slider’s UI binding and save behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview-ui/src/components/settings/AutoApproveSettings.tsx`:
- Around line 266-270: Replace the hard-coded “Disabled” text in the
followupAutoApproveTimeoutMs display with the existing t(...) translation
helper, adding the corresponding translation key to the appropriate localization
resources. Preserve the current timeout formatting and conditional behavior.

---

Nitpick comments:
In `@webview-ui/src/components/settings/AutoApproveSettings.tsx`:
- Around line 256-270: Add focused tests in AutoApproveSettings.spec.tsx for the
follow-up timeout slider: verify an explicit value of 0 renders the “Disabled”
label and saves 0 through setCachedStateField, and verify the unset/default
state uses the 60000 default rather than masking a missing value. Keep coverage
scoped to this slider’s UI binding and save behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e3ead47c-1ab7-4852-af1c-34376a0863fa

📥 Commits

Reviewing files that changed from the base of the PR and between b8f70bf and 0688f25.

📒 Files selected for processing (3)
  • webview-ui/src/components/chat/FollowUpSuggest.tsx
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • webview-ui/src/components/settings/AutoApproveSettings.tsx

Comment thread webview-ui/src/components/settings/AutoApproveSettings.tsx
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 10, 2026
Comment on lines +267 to +268
{followupAutoApproveTimeoutMs === 0
? "Disabled"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other string in this component goes through t(), so this literal would render in English for the 17 non-English locales the repo ships. Should this use a new key under settings:autoApprove.followupQuestions (e.g. timeoutDisabled)?

<div className="flex items-center gap-2">
<Slider
min={1000}
min={0}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing AutoApproveSettings.spec.tsx never sets alwaysAllowFollowupQuestions: true, so this whole block — including the new min=0 and the 0 → "Disabled" branch — never mounts under test. Worth adding a 0/"Disabled" and a non-zero value case?

data-testid="followup-timeout-slider"
/>
<span className="w-20">{followupAutoApproveTimeoutMs / 1000}s</span>
<span className="w-20">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 (ModelInfoView.visual.tsx, OpenAICompatible.visual.tsx), and the authoring pattern is in webview-ui/AGENTS.md under Visual Tests.

!isAnswered &&
!isFollowUpAutoApprovalPaused
!isFollowUpAutoApprovalPaused &&
(followupAutoApproveTimeoutMs ?? DEFAULT_FOLLOWUP_TIMEOUT_MS) > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing clamps a negative followupAutoApproveTimeoutMs before it reaches this guard, so a > 0 vs !== 0 mutation would be indistinguishable on the values the suite tests (0, 3000, 5000). Worth adding a negative-value case?

@github-actions github-actions Bot added awaiting-author PR is waiting for the author to address requested changes and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.fixture.tsx (1)

20-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Render the localized label in the visual fixture.

TranslationContext returns each key unchanged. Therefore, AutoApproveSettings.visual.tsx Line 17 snapshots settings:autoApprove.followupQuestions.timeoutDisabled, not Disabled. The visual test cannot detect an incorrect or missing translation value. Map the new keys to deterministic English strings or load the English translation resources.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.fixture.tsx`
around lines 20 - 25, Update AutoApproveSettingsFixture’s TranslationContext
value so the new auto-approve timeout translation key resolves to a
deterministic English label such as “Disabled” instead of returning the key
unchanged. Preserve passthrough behavior for unrelated keys or load the existing
English resources, ensuring AutoApproveSettings.visual.tsx renders the localized
label in snapshots.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview-ui/src/components/settings/__tests__/AutoApproveSettings.spec.tsx`:
- Around line 165-177: Extend the tests around the follow-up timeout slider to
simulate slider changes and verify setCachedStateField receives
followupAutoApproveTimeoutMs for both 0 and a non-zero value. Add coverage for
the unset/default or disabled state, asserting the slider’s rendered value and
behavior when the default controls rendering. Preserve the existing text
assertions while covering UI binding, save behavior, and normalization for true,
false, and unset cases.

In
`@webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.fixture.tsx`:
- Line 18: Replace the broad as any assertions in the fixture’s
ExtensionStateContext provider value with a typed provider value or typed test
factory that satisfies the ExtensionStateContext contract, including required
fields. For the i18n double assertion, remove it if possible; otherwise retain
it only with a nearby explanation documenting why it is unavoidable.

---

Nitpick comments:
In
`@webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.fixture.tsx`:
- Around line 20-25: Update AutoApproveSettingsFixture’s TranslationContext
value so the new auto-approve timeout translation key resolves to a
deterministic English label such as “Disabled” instead of returning the key
unchanged. Preserve passthrough behavior for unrelated keys or load the existing
English resources, ensuring AutoApproveSettings.visual.tsx renders the localized
label in snapshots.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28798e0d-069b-4aaa-a029-ecd8fec76a2d

📥 Commits

Reviewing files that changed from the base of the PR and between 0688f25 and 04aa5fa.

⛔ Files ignored due to path filters (1)
  • webview-ui/src/components/settings/__tests__/__screenshots__/auto-approve-followup-timeout-disabled-dark.png is excluded by !**/*.png
📒 Files selected for processing (23)
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • webview-ui/src/components/settings/AutoApproveSettings.tsx
  • webview-ui/src/components/settings/__tests__/AutoApproveSettings.spec.tsx
  • webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.fixture.tsx
  • webview-ui/src/components/settings/__tests__/AutoApproveSettings.visual.tsx
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • webview-ui/src/components/settings/AutoApproveSettings.tsx
  • webview-ui/src/components/chat/tests/FollowUpSuggest.spec.tsx

@murd0cc

murd0cc commented Aug 11, 2026

Copy link
Copy Markdown
Author

Used the PR fixer for help. Here's how it went

Implemented and validated minimal fixes for all still-valid findings.

Changes made

Extended timeout-slider behavior coverage in AutoApproveSettings.spec.tsx.

Added slider interaction assertions that verify setCachedStateField() receives followup timeout updates for both non-zero and zero transitions.
Preserved existing label assertions for disabled and seconds states.
Added unset/default coverage confirming default-rendered value and label behavior when timeout is not provided.
Added disabled/unset follow-up toggle coverage confirming timeout controls do not render when follow-up auto-approve is false or unset.
Kept Save/Discard contract validation via existing no-immediate-persist assertion path.
Replaced broad context casting in AutoApproveSettings.visual.fixture.tsx.

Removed broad as any-style provider value usage by switching to typed ExtensionStateContextProvider with initialState.
Removed i18n double assertion by using typed i18next directly.
Updated translation fixture behavior so timeout disabled key resolves deterministically to Disabled while unrelated keys still pass through.
Finding disposition

Still-valid findings: all reported items were valid and were fixed in-place with minimal edits in AutoApproveSettings.spec.tsx and AutoApproveSettings.visual.fixture.tsx.
Skipped findings: none.
Validation

Tests passed: npx vitest run for AutoApproveSettings.spec.tsx.
Lint passed with suppression pruning command for both changed files and no errors reported.

@murd0cc

murd0cc commented Aug 11, 2026

Copy link
Copy Markdown
Author

Implemented targeted coverage improvements by extending tests in FollowUpSuggest.spec.tsx.

What changed

  • Added missing import for fireEvent.
  • Relaxed test context typing so undefined timeout scenarios are testable via TestExtensionState.followupAutoApproveTimeoutMs?: number.
  • Added new interaction tests under describe("suggestion interactions") to cover:
    • Normal click behavior (cancel timer + forward callback) at it("cancels countdown and forwards click...")
    • Shift-click behavior (no cancel + forwarded shiftKey) at it("keeps countdown when shift-clicking...")
    • Copy affordance click path (simulated shift-click + cancel) at it("copies suggestion into input...")
    • Default-timeout fallback branch (undefined timeout -> 60s) at it("uses default timeout when extension state timeout is undefined")

Validation run

  • Passed targeted tests via npx vitest run ...: 2 files, 43 tests passed.
  • Passed targeted coverage run; component coverage now reports FollowUpSuggest.tsx at 100% statements / 100% lines / 100% functions (branch coverage improved to 92.68%).
  • Passed lint suppression prune check on modified file using pnpm exec eslint --prune-suppressions --max-warnings=0.

No source changes were needed in AutoApproveSettings.tsx; existing tests for that area already pass in the targeted suite.

@murd0cc murd0cc changed the title issue #685 - point 8 issue #685 - point 8 - Allow disabling the follow-up auto-select timer Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author PR is waiting for the author to address requested changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants