Skip to content

Conversation

pethers
Copy link
Member

@pethers 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.
@pethers pethers requested a review from Copilot July 24, 2025 14:42
@github-actions github-actions bot added ui User interface improvements needs-tests Needs test coverage labels Jul 24, 2025
Copilot

This comment was marked as outdated.

@github-actions github-actions bot added infrastructure CI/CD and build infrastructure config Configuration changes labels Jul 24, 2025
@github-actions github-actions bot added the devcontainer Development container updates label Jul 24, 2025
@pethers pethers requested a review from Copilot July 24, 2025 16:11
Copilot

This comment was marked as outdated.

@pethers pethers requested a review from Copilot July 24, 2025 16:19
Copy link
Contributor

@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 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);
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Comment on lines +361 to +362
window.removeEventListener("keydown", this.handleKeyDown.bind(this));
window.removeEventListener("keyup", this.handleKeyUp.bind(this));
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Suggested change
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;
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Suggested change
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;
Copy link
Preview

Copilot AI Jul 24, 2025

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);
Copy link
Preview

Copilot AI Jul 24, 2025

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
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Suggested change
// ✅ 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
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Suggested change
// ✅ FIXED: Handle key release for all movement keys

Copilot uses AI. Check for mistakes.

[enabled]
);

// ✅ FIXED: Proper movement calculation with correct bounds
Copy link
Preview

Copilot AI Jul 24, 2025

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.

Suggested change
// ✅ FIXED: Proper movement calculation with correct bounds

Copilot uses AI. Check for mistakes.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

@pethers pethers merged commit a3a9d18 into main Jul 24, 2025
12 of 13 checks passed
@pethers pethers deleted the trains2 branch July 24, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Configuration changes devcontainer Development container updates infrastructure CI/CD and build infrastructure needs-tests Needs test coverage ui User interface improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant