-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Enhance Training Mode Selector and Vital Point Training Panel #172
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
pethers
commented
Jul 24, 2025
- Updated TrainingModeSelector to include descriptions, colors, and icons for each mode.
- Improved layout and styling of buttons in TrainingModeSelector for better UX.
- Added a description panel below the mode buttons in TrainingModeSelector.
- Refactored VitalPointTrainingPanel to enhance UI with improved styling and layout.
- Introduced new selection background and severity indicators in VitalPointTrainingPanel.
- Updated input handling system to support player movement and combat controls with enhanced performance.
- Added support for stance changes and combat actions in the input system.
- Updated TrainingModeSelector to include descriptions, colors, and icons for each mode. - Improved layout and styling of buttons in TrainingModeSelector for better UX. - Added a description panel below the mode buttons in TrainingModeSelector. - Refactored VitalPointTrainingPanel to enhance UI with improved styling and layout. - Introduced new selection background and severity indicators in VitalPointTrainingPanel. - Updated input handling system to support player movement and combat controls with enhanced performance. - Added support for stance changes and combat actions in the input system.
…formance and movement controls
…en and TrainingScreen
…e unnecessary comments
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 pull request enhances the Training Mode by adding comprehensive improvements to the user interface and input handling system. The changes focus on providing better visual feedback, clearer mode differentiation, and enhanced interactivity for vital point training.
- Enhanced Training Mode Selector with detailed descriptions, icons, and color-coded modes
- Improved Vital Point Training Panel with better styling, pulse animations, and enhanced vital point information display
- Refactored input system to support both player movement and combat controls with improved performance and responsiveness
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
src/utils/inputSystem.ts | Complete rewrite of input system with enhanced player movement, combat input handling, and performance optimizations |
src/components/training/components/VitalPointTrainingPanel.tsx | Enhanced UI with improved styling, pulse animations, severity indicators, and better Korean typography |
src/components/training/components/TrainingModeSelector.tsx | Added mode descriptions, icons, colors, and improved button layout with enhanced visual feedback |
src/components/training/components/TrainingDummy.tsx | Simplified and optimized dummy implementation using Korean vital points data |
src/components/training/components/TrainingControlsPanel.tsx | Enhanced panel with status indicators, improved button design, and better Korean text integration |
src/components/training/TrainingScreen.tsx | Major refactor with improved layout, enhanced player movement integration, and better mobile support |
src/components/combat/CombatScreen.tsx | Updated to use new input system with improved AI behavior and arena bounds |
.vscode/settings.json | Performance optimizations for TypeScript development |
.devcontainer/init-xvfb.sh | Commented out Xvfb initialization for development environment optimization |
Comments suppressed due to low confidence (2)
src/components/training/TrainingScreen.tsx:117
- The
arenaBounds
dependency in the movement configuration may cause unnecessary re-initialization of the movement system when bounds change. Consider memoizing or stabilizing this reference.
"geon",
if (!enabled) return; | ||
|
||
const key = event.key.toLowerCase(); | ||
pressedKeys.current.add(key); |
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.
Consider using a Set-based approach with proper cleanup to avoid memory leaks. The current implementation may accumulate keys if cleanup fails.
Copilot generated this review using guidance from copilot-instructions.md.
window.removeEventListener("keydown", this.handleKeyDown.bind(this)); | ||
window.removeEventListener("keyup", this.handleKeyUp.bind(this)); |
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.
This event listener removal will not work correctly because bind(this)
creates a new function reference each time. Store the bound function reference during setup to properly remove the listener.
window.removeEventListener("keydown", this.handleKeyDown.bind(this)); | |
window.removeEventListener("keyup", this.handleKeyUp.bind(this)); | |
window.removeEventListener("keydown", this.boundHandleKeyDown); | |
window.removeEventListener("keyup", this.boundHandleKeyUp); |
Copilot uses AI. Check for mistakes.
g.fill(); | ||
|
||
// Animated border with proper pulse calculation | ||
const pulse = 1 + Math.sin(Date.now() * 0.005) * 0.3; |
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.
Using Date.now()
in a draw function that's called frequently can cause performance issues. Consider using a timestamp passed from an animation frame or a more efficient timing mechanism.
const pulse = 1 + Math.sin(Date.now() * 0.005) * 0.3; | |
const pulse = 1 + Math.sin(timestamp * 0.005) * 0.3; |
Copilot uses AI. Check for mistakes.
|
||
// Pulsing effect when training | ||
if (isTraining) { | ||
const pulse = 1 + Math.sin(Date.now() * 0.005) * 0.3; |
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.
Similar to the vital point panel, using Date.now()
in draw functions can impact performance. Consider using a shared animation timer or RAF-based timing.
Copilot uses AI. Check for mistakes.
// Training glow effect | ||
if (isTraining) { | ||
g.stroke({ width: 1, color: KOREAN_COLORS.ACCENT_GOLD, alpha: 0.3 }); | ||
g.circle(0, 0, 70 + Math.sin(Date.now() * 0.003) * 5); |
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.
Another instance of Date.now()
in a draw function. This pattern appears multiple times and should be addressed consistently across all components.
Copilot uses AI. Check for mistakes.
const key = event.key.toLowerCase(); | ||
pressedKeys.current.add(key); | ||
|
||
// ✅ FIXED: Add all movement keys including WASD and arrows |
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.
Development/debugging comments like '✅ FIXED:' should be removed from production code.
// ✅ FIXED: Add all movement keys including WASD and arrows | |
Copilot uses AI. Check for mistakes.
const key = event.key.toLowerCase(); | ||
pressedKeys.current.delete(key); | ||
|
||
// ✅ FIXED: Handle key release for all movement keys |
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.
Another development comment that should be removed from production code.
// ✅ FIXED: Handle key release for all movement keys | |
Copilot uses AI. Check for mistakes.
[enabled] | ||
); | ||
|
||
// ✅ FIXED: Proper movement calculation with correct bounds |
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.
Development comment should be removed from production code.
// ✅ FIXED: Proper movement calculation with correct bounds |
Copilot uses AI. Check for mistakes.
|