-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(chat): Cancel auto-approve timer when editing follow-up suggestion #1524
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
Conversation
🦋 Changeset detectedLatest commit: a5f8014 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughA patch was introduced to cancel the auto-approve timer when a user clicks the edit button on a follow-up suggestion. The logic updates the internal state to reflect the selection and invokes a callback to stop the timer, ensuring auto-approval does not proceed while editing. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FollowUpSuggest
participant AutoApproveTimer
User->>FollowUpSuggest: Clicks "Edit" on suggestion
FollowUpSuggest->>AutoApproveTimer: onCancelAutoApproval()
AutoApproveTimer-->>FollowUpSuggest: Timer canceled
FollowUpSuggest->>FollowUpSuggest: Set suggestionSelected = true
FollowUpSuggest->>FollowUpSuggest: Simulate shift-click to onSuggestionClick
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
webview-ui/src/components/chat/FollowUpSuggest.tsxOops! Something went wrong! :( ESLint: 9.28.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
e141c14 to
614d78c
Compare
614d78c to
a5f8014
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
webview-ui/src/components/chat/FollowUpSuggest.tsx (1)
137-139: Logic correctly addresses the timer racing issue, but missing coding guideline compliance.The implementation properly cancels the auto-approve timer when editing by setting
suggestionSelectedto true and calling theonCancelAutoApprovalcallback. This mirrors the existing logic inhandleSuggestionClickand effectively prevents the race condition described in issue #1262.However, the coding guidelines require adding kilocode_change comments for TSX files.
Apply this diff to comply with coding guidelines:
- // Cancel the auto-approve timer when edit button is clicked - setSuggestionSelected(true) - onCancelAutoApproval?.() + // Cancel the auto-approve timer when edit button is clicked {/* kilocode_change start */} + setSuggestionSelected(true) + onCancelAutoApproval?.() {/* kilocode_change end */}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/kind-horses-sniff.md(1 hunks)webview-ui/src/components/chat/FollowUpSuggest.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/!(*kilocode*)/**/*.{ts,tsx,js,jsx,html,css,scss}
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
**/!(*kilocode*)/**/*.{ts,tsx,js,jsx,html,css,scss}: For single line changes, add the comment '// kilocode_change' at the end of the line.
For multiple consecutive lines changed, wrap them with '// kilocode_change start' and '// kilocode_change end' comments.
Files:
webview-ui/src/components/chat/FollowUpSuggest.tsx
**/!(*kilocode*)/**/*.{html,jsx,tsx}
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
In HTML/JSX/TSX files, use '{/* kilocode_change start /}' and '{/ kilocode_change end */}' to wrap multi-line changes.
Files:
webview-ui/src/components/chat/FollowUpSuggest.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: storybook-playwright-snapshot
- GitHub Check: test-extension (windows-latest)
- GitHub Check: test-webview (windows-latest)
- GitHub Check: compile
🔇 Additional comments (1)
.changeset/kind-horses-sniff.md (1)
1-6: Well-structured changeset documentation.The changeset properly documents this patch-level fix with a clear, descriptive title that matches the PR objectives. The format follows changeset conventions correctly.
|
Closing this since it merged on the Roo side! 🎉 |
So users to don't have to race against the clock to type their message
Fixes: #1262
Roo PR: RooCodeInc/Roo-Code#6226
Summary by CodeRabbit