-
Notifications
You must be signed in to change notification settings - Fork 20
Update human.vue #41
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
base: master
Are you sure you want to change the base?
Update human.vue #41
Conversation
Added place holder for custom commands to be executed.
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.
Pull Request Overview
This PR adds a placeholder UI implementation for custom commands functionality in the human.vue component. The changes introduce interactive elements that allow users to add, remove, and clear custom commands through the interface.
- Added methods for managing custom commands (add, remove, clear)
- Implemented UI components with input fields and buttons for command management
- Connected UI buttons to JavaScript methods using Vue event handlers
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| addCommand(){ | ||
| this.commands.push(""); | ||
| }, | ||
| removeCommand(index){ | ||
| this.commands.splice(index,1); | ||
| }, | ||
| clearCommands(){ | ||
| this.commands = []; | ||
| } |
Copilot
AI
Oct 6, 2025
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.
The commands array is being manipulated but is not defined in the component's data. This will cause runtime errors unless commands is declared in the data() method.
| addCommand(){ | ||
| this.commands.push(""); | ||
| }, | ||
| removeCommand(index){ |
Copilot
AI
Oct 6, 2025
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.
Missing input validation for the index parameter. The method should validate that the index is within bounds before calling splice.
| removeCommand(index){ | |
| removeCommand(index){ | |
| if ( | |
| typeof index !== "number" || | |
| !Number.isInteger(index) || | |
| index < 0 || | |
| index >= this.commands.length | |
| ) { | |
| return; | |
| } |
| this.commands.push(""); | ||
| }, | ||
| removeCommand(index){ | ||
| this.commands.splice(index,1); |
Copilot
AI
Oct 6, 2025
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.
[nitpick] Missing space after comma in function arguments. Should be splice(index, 1) for consistent formatting.
| this.commands.splice(index,1); | |
| this.commands.splice(index, 1); |
Added place holder for custom commands to be executed.
Description
Since it doesn't have implemented to insert custom commands to be executed, I made some changes to the UI and JS.
Type of change
How Has This Been Tested?
I tested it locally.
Checklist: