avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

feature: Enhanced Code Suggestion Response Options

Open TomoyaFujita2016 opened this issue 7 months ago • 0 comments

Summary

Implement enhanced response options for code suggestions in avante.nvim, allowing users to respond with "yes", "all yes", "yes but", or "no" and provide additional feedback for each option.

Description

Currently, avante.nvim likely has basic approval/rejection options for suggested code. This feature request proposes enhancing this interaction with more nuanced response options:

  1. Expanded Response Options:

    • yes: Accept a single suggestion as is
    • all yes: Accept all suggestions as is
    • yes but: Accept with modifications or additional instructions
    • no: Reject the suggestion
  2. Additional Feedback for Each Option:

    • When selecting no: Display a text area/prompt for entering rejection reasons
    • When selecting yes but: Display a text area/prompt for providing modification instructions
      • Example: "This looks good, but please modify the function to handle edge cases"
    • When selecting yes/all yes: Display an optional text area/prompt for providing instructions for the next steps
      • Example: "For the next implementation, I'm planning to add error handling, so please ensure this is compatible"

User Experience Flow

  1. avante.nvim suggests code
  2. User selects a response option (yes/all yes/yes but/no)
  3. Based on selection, a text input area appears
  4. User enters additional feedback as needed
  5. The next action executes based on the feedback

Expected Benefits

  • Creates a more detailed feedback loop
  • Allows for more accurate code generation aligned with user intent
  • Reduces the number of interaction cycles, creating a more efficient development flow
  • The "yes but" option particularly allows for accepting the general approach while requesting specific adjustments

Implementation Suggestions

  • Implement keymappings for selecting each option
  • Use popup or floating windows for text input
  • Store feedback and instructions as context for future suggestions
  • Consider different visual indicators for each response type

Related Existing Features

  • Current code suggestion approval system
  • Feedback loop mechanisms

This feature will make the development workflow more efficient and interactive, enabling higher-level collaboration between users and avante.nvim.

TomoyaFujita2016 avatar May 06 '25 02:05 TomoyaFujita2016