Skip to content

feat(settings): allow follow-up auto-approve timeout of 0 - #5

Open
seeones wants to merge 1 commit into
mainfrom
feat/followup-timeout-zero
Open

seeones wants to merge 1 commit into
mainfrom
feat/followup-timeout-zero

Conversation

@seeones

@seeones seeones commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Related GitHub Issue

Internal pre-flight PR on the fork. Will be linked to the approved upstream issue when submitted upstream.

Description

Allows the follow-up question auto-approve timeout to be set to 0 to disable auto-selection entirely.

  • Setting the follow-up auto-approve timeout to 0 now skips the countdown instead of being clamped to the 1s minimum, so the first suggested answer is never auto-selected and the user always chooses manually.
  • FollowUpSuggest: short-circuits when timeoutMs <= 0 (countdown set to null; still notifies onCancelAutoApproval on unmount).
  • AutoApproveSettings: slider minimum lowered from 1000 to 0; dedicated zero-state description when the value is 0.
  • Adds timeoutZeroDescription across all 18 locales (reusing existing Roo translations).
  • Adds FollowUpSuggest tests covering zero and negative timeout.

Reviewers should note the changed slider minimum and the new zero-state copy.

Test Procedure

  • Unit tests: cd webview-ui && npx vitest run src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • Manual: set the follow-up auto-approve timeout to 0, trigger a follow-up, and confirm no countdown runs and the first suggestion is not auto-selected.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot (UI changes only): No new snapshot; the change is a slider minimum plus copy on an existing settings surface.
  • Documentation Impact: I have considered if my changes require documentation updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

The 0 value is a deliberate "disabled" sentinel; positive values keep the previous countdown behavior.

Get in Touch

Discord: seeones

…auto-selection

Setting the follow-up question auto-approve timeout to 0 now skips the countdown entirely instead of being clamped to the 1s minimum, so the first suggested answer is never auto-selected and the user always chooses manually.

- FollowUpSuggest: short-circuit when timeoutMs <= 0 (set countdown null, still notify onCancelAutoApproval on unmount).
- AutoApproveSettings: slider min 1000 -> 0; show a dedicated zero-state description when the value is 0.
- Add timeoutZeroDescription across all 18 locales (reusing existing Roo translations).
- Add FollowUpSuggest tests covering zero and negative timeout (no countdown, no auto-selection, cancel still fires on unmount).
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: seeones/Zoo-Code/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8d3a1220-17be-4697-9123-f84340300be9
📥 Commits

Reviewing files that changed from the base of the PR and between 9af61f8 and 9a36dad.

📒 Files selected for processing (21)
  • webview-ui/src/components/chat/FollowUpSuggest.tsx
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • webview-ui/src/components/settings/AutoApproveSettings.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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (5)
For persisted settings, verify the complete schema/storage/runtime/webview round trip, shared default semantics, and focused true plus false/unset tests.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/settings/AutoApproveSettings.tsx
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/chat/FollowUpSuggest.tsx
  • webview-ui/src/components/settings/AutoApproveSettings.tsx
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark theme behavior.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/chat/FollowUpSuggest.tsx
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/components/settings/AutoApproveSettings.tsx
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
Act as an adversarial second-opinion reviewer.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/chat/FollowUpSuggest.tsx
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/components/settings/AutoApproveSettings.tsx
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
🪛 GitHub Check: mutation-diff
webview-ui/src/components/chat/FollowUpSuggest.tsx

[warning] 66-66: Mutation test advisory
webview-ui/src/components/chat/FollowUpSuggest.tsx:66: Survived OptionalChaining mutant (replacement: onCancelAutoApproval()). See the job summary for the complete list and resolution guidance.


[warning] 65-65: Mutation test advisory
webview-ui/src/components/chat/FollowUpSuggest.tsx:65: Survived CallExpression mutant (replacement: ;). See the job summary for the complete list and resolution guidance.

webview-ui/src/components/settings/AutoApproveSettings.tsx

[warning] 323-323: Mutation test advisory
webview-ui/src/components/settings/AutoApproveSettings.tsx:323: NoCoverage StringLiteral mutant (replacement: ""). See the job summary for the complete list and resolution guidance.


[warning] 322-322: Mutation test advisory
webview-ui/src/components/settings/AutoApproveSettings.tsx:322: NoCoverage StringLiteral mutant (replacement: ""). See the job summary for the complete list and resolution guidance.


[warning] 321-321: Mutation test advisory
webview-ui/src/components/settings/AutoApproveSettings.tsx:321: 3 mutation test gaps; example: NoCoverage ConditionalExpression mutant (replacement: true). See the job summary for the complete list and resolution guidance.

🔇 Additional comments (1)
webview-ui/src/components/chat/FollowUpSuggest.tsx (1)

64-66: 🩺 Stability & Availability

The backend does not schedule auto-approval for a zero timeout. If the timeout changes from positive to zero while the suggestion is mounted, the previous effect’s cleanup invokes onCancelAutoApproval before the effect runs again.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Set the follow-up question timeout to 0 to disable automatic answer selection and wait for a manual choice.
  • Bug Fixes
    • Zero or negative timeouts no longer trigger automatic selection.
  • Settings
    • The timeout control now allows a value of 0 and explains what it means. This guidance is available in supported languages.

Walkthrough

The follow-up auto-approval timeout can now be set to zero. Zero or negative timeouts disable automatic suggestion selection, and localized settings explain the zero-timeout behavior.

Changes

Follow-up auto-approval timeout

Layer / File(s) Summary
Allow and describe a zero timeout
webview-ui/src/components/settings/AutoApproveSettings.tsx, webview-ui/src/i18n/locales/*/settings.json
The timeout slider now permits zero. The settings description uses a zero-timeout message when the value is zero. Localized messages state that selection remains manual.
Disable countdown for nonpositive timeouts
webview-ui/src/components/chat/FollowUpSuggest.tsx, webview-ui/src/components/chat/__tests__/FollowUpSuggest.spec.tsx
For zero or negative timeouts, the component clears the countdown and returns a cleanup callback that invokes onCancelAutoApproval. Tests cover zero-timeout behavior and the absence of a countdown for negative values.

Priority: ⬇️ Low

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

Change: Feature

Suggested reviewers: edelauna, navedmerchant

Merge Risk: ⚪ Minimal · up to 9a36d

The zero setting remains intact and prevents automatic selection. No actionable merge-blocking issue remains after normal checks.

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Regression Evidence ⚠️ Warning The PR adds a durable visible settings state, but no Playwright component snapshot covers it. AutoApproveSettings.tsx now allows a zero slider value and shows timeoutZeroDescription at zero. The e… Add a Playwright component visual case whose fixture enables alwaysAllowFollowupQuestions and sets followupAutoApproveTimeoutMs to 0. Assert that the slider has a minimum of 0 and that the zero-state description is visible, then captu…
✅ Passed checks (7 passed)
Check name Status Explanation
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.
Security Boundaries ✅ Passed No changed path matches the security failure conditions. The PR lowers the follow-up timeout slider minimum and makes nonpositive timeouts suppress the countdown; the existing backend auto-approval po…
Persistence Integrity ✅ Passed No changed persistence operation exists. The changed slider forwards its value through the existing setCachedStateField path, and SettingsView includes followupAutoApproveTimeoutMs in the existi…
Lifecycle Resource Cleanup ✅ Passed ...
Title check ✅ Passed The title clearly identifies the main change: allowing a follow-up auto-approve timeout of 0.
Description check ✅ Passed The description explains the change, implementation, tests, and documentation impact. It notes that the approved upstream issue link will be added later, so the required issue link is not yet present.
Full details: Regression Evidence

Explanation

The PR adds a durable visible settings state, but no Playwright component snapshot covers it. AutoApproveSettings.tsx now allows a zero slider value and shows timeoutZeroDescription at zero. The existing visual fixture sets alwaysAllowFollowupQuestions: false (AutoApproveSettings.visual.fixture.tsx:37), while the changed settings block renders only when that value is true (AutoApproveSettings.tsx:297). Therefore, the existing AutoApproveSettings.visual.tsx snapshots cannot show the changed slider or zero-state copy. The diff adds no visual test or snapshot for this state.

Resolution

Add a Playwright component visual case whose fixture enables alwaysAllowFollowupQuestions and sets followupAutoApproveTimeoutMs to 0. Assert that the slider has a minimum of 0 and that the zero-state description is visible, then capture and commit the component snapshot.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Awaiting fresh human maintainer or CODEOWNER approval.

Automated review is complete for the latest commit but does not replace human approval.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for automated review of the latest commit labels Oct 5, 2026
@seeones seeones added the enhancement New feature or request label Oct 5, 2026
@github-actions github-actions Bot added awaiting-maintainer Waiting for fresh human maintainer or CODEOWNER approval and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for automated review of the latest commit labels Oct 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer Waiting for fresh human maintainer or CODEOWNER approval enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant