Skip to content

Conversation

yaroslav8765
Copy link
Contributor

…TAB", "CTRL + →")

@yaroslav8765 yaroslav8765 requested a review from SerVitasik July 25, 2025 10:23
@ivictbor ivictbor requested a review from Copilot July 30, 2025 09:15
Copilot

This comment was marked as outdated.

@yaroslav8765 yaroslav8765 requested a review from ivictbor July 30, 2025 13:21
@yaroslav8765 yaroslav8765 requested a review from Copilot August 11, 2025 08:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the completion input component to dynamically render shortcut buttons based on the current action type. The button alternates between showing "TAB" for full completion approval and "CTRL + →" for next word approval.

  • Updates the completion button to display different shortcuts dynamically ("TAB" vs "CTRL + →")
  • Implements state management to track and toggle between completion modes
  • Adjusts styling and layout to accommodate variable button widths

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.

File Description
custom/package.json Updates vue-suggestion-input dependency to version 1.0.12
custom/completionInput.vue Implements dynamic button rendering with state management and conditional UI display
Files not reviewed (1)
  • custom/package-lock.json: Language not supported

@@ -61,15 +85,33 @@ const props = defineProps<{
const emit = defineEmits([
'update:value',
]);

const approveCompletionValue:string='TAB';
const approveNextWorldValue:string='CTRL + ->'
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

The variable name 'approveNextWorldValue' contains a spelling error. 'World' should be 'Word' to match the intended functionality.

Suggested change
const approveNextWorldValue:string='CTRL + ->'
const approveNextWordValue:string='CTRL + ->'

Copilot uses AI. Check for mistakes.

:class="[
'text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800',
'font-medium rounded-lg text-xs flex items-center justify-center py-1 px-1 ',
buttonText === approveCompletionValue ? 'w-16' : 'w-18'
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The conditional width assignment uses magic numbers ('w-16', 'w-18'). Consider defining these as named constants to improve maintainability and make the sizing logic more explicit.

Copilot uses AI. Check for mistakes.

}
buttonText.value === approveCompletionValue ? buttonText.value = approveNextWorldValue : buttonText.value = approveCompletionValue;
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

This ternary assignment duplicates logic from the handleCompletionApproved function. Consider using the existing function to maintain consistency and reduce duplication.

Suggested change
buttonText.value === approveCompletionValue ? buttonText.value = approveNextWorldValue : buttonText.value = approveCompletionValue;
handleCompletionApproved();

Copilot uses AI. Check for mistakes.

Comment on lines 103 to 104
buttonText.value = approveNextWorldValue;
} else if (buttonText.value === approveNextWorldValue && type === 'word') {
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

Reference to misspelled variable 'approveNextWorldValue' should be 'approveNextWordValue'.

Suggested change
buttonText.value = approveNextWorldValue;
} else if (buttonText.value === approveNextWorldValue && type === 'word') {
buttonText.value = approveNextWordValue;
} else if (buttonText.value === approveNextWordValue && type === 'word') {

Copilot uses AI. Check for mistakes.

Comment on lines 103 to 104
buttonText.value = approveNextWorldValue;
} else if (buttonText.value === approveNextWorldValue && type === 'word') {
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

Reference to misspelled variable 'approveNextWorldValue' should be 'approveNextWordValue'.

Suggested change
buttonText.value = approveNextWorldValue;
} else if (buttonText.value === approveNextWorldValue && type === 'word') {
buttonText.value = approveNextWordValue;
} else if (buttonText.value === approveNextWordValue && type === 'word') {

Copilot uses AI. Check for mistakes.

@SerVitasik SerVitasik merged commit 71e7b3b into main Aug 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants