Skip to content

Improve combat and training HUD responsive fit#1939

Merged
pethers merged 3 commits into
mainfrom
copilot/improve-ui-ux-combat-training-screens
May 15, 2026
Merged

Improve combat and training HUD responsive fit#1939
pethers merged 3 commits into
mainfrom
copilot/improve-ui-ux-combat-training-screens

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

Combat and training HUDs needed better fit, sizing, and placement across screenshot-analysis resolutions. This updates HUD layout synchronization and screenshot capture reliability for reviewing UI/UX regressions.

  • HUD layout

    • Shared combat/training top and bottom HUD height ratios.
    • Aligned side-HUD offsets with the actual rendered top/bottom bars.
    • Centralized large-display HUD scale calculation for combat and training screens.
  • Arena/content fit

    • Rebalanced desktop arena width budget so 3D content stays framed between side HUDs.
    • Updated combat/training layout calculations to reserve real HUD space instead of stale constants.
  • Screenshot analysis

    • Hardened screenshot navigation to wait for DOM readiness.
    • Removed forced Brotli preview header that caused resource decode failures in Playwright.
export function getHUDPositionScale(
  screenSize: ScreenSize,
  isMobile: boolean,
): number {
  if (isMobile) return 1.0;
  return screenSize === "xlarge" ? 1.5 : screenSize === "large" ? 1.25 : 1.0;
}
https://github.com/user-attachments/assets/36545104-2a97-432f-9abe-15d41ee48dda

Copilot AI and others added 3 commits May 15, 2026 10:32
@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

โœ… No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added infrastructure CI/CD and build infrastructure ui User interface improvements config Configuration changes testing Testing improvements types TypeScript type improvements test-coverage-impact Impacts test coverage needs-tests Needs test coverage three-components labels May 15, 2026
@pethers pethers marked this pull request as ready for review May 15, 2026 11:31
@pethers pethers self-requested a review as a code owner May 15, 2026 11:31
Copilot AI review requested due to automatic review settings May 15, 2026 11:31
@github-actions
Copy link
Copy Markdown
Contributor

๐ŸŽฏ Accessibility Test Results

WCAG 2.1 Level AA Compliance Tests

  • โœ… Color contrast validation (4.5:1 for text, 3:1 for UI)
  • โœ… ARIA labels and roles validation
  • โœ… Keyboard navigation structure validation
  • โœ… Focus indicators validation
  • โœ… Dialog and menu semantics validation
  • โœ… Progress bars and timers validation

Components Tested

  • Accessibility utilities (keyboard nav, focus management)
  • Bilingual ARIA labels (Korean-English)
  • Button groups (VirtualDPad pattern)
  • Radiogroups (StanceWheel pattern)
  • Dialogs (PauseMenu pattern)
  • Progress bars (HealthBar, StaminaBar pattern)
  • Timers (CombatTimer pattern)

Test Framework

  • Tool: axe-core via jest-axe
  • Standard: WCAG 2.1 Level AA
  • Test Runner: Vitest

Copy link
Copy Markdown
Contributor

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 improves combat and training HUD fit across responsive screenshot-analysis viewports by centralizing HUD scale/height calculations, aligning arena reservations with rendered HUD bars, and making screenshot navigation more reliable.

Changes:

  • Added shared combat/training HUD height constants and a shared large-display HUD position scale helper.
  • Updated combat/training layout hooks and HUD components to reserve actual top/bottom HUD space.
  • Hardened screenshot capture navigation and removed the forced Brotli preview header.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vite.config.ts Removes forced Brotli preview response header.
src/utils/responsiveLayoutHelpers.ts Adjusts desktop arena width budget and adds shared HUD scale helper.
src/utils/__tests__/responsiveLayoutHelpers.test.ts Adds coverage for arena width budget and HUD scale helper.
src/types/constants/layout.ts Adds shared combat/training HUD height ratio constants.
src/hooks/useHUDLayout.ts Uses shared HUD height constants for side/top/bottom HUD offsets.
src/hooks/useHUDLayout.test.tsx Adds direct alignment tests for combat and training HUD offsets.
src/hooks/__tests__/useHUDLayout.test.ts Updates existing expectations for new combat HUD reservations.
src/components/screens/training/TrainingScreen3D.tsx Reuses shared HUD position scale calculation.
src/components/screens/training/hooks/useTrainingLayout.ts Reserves actual training HUD heights in training area bounds.
src/components/screens/training/hooks/useTrainingLayout.responsive.test.ts Adds responsive training viewport fit tests.
src/components/screens/training/components/hud/TrainingBottomHUD.tsx Uses shared training bottom HUD height constant.
src/components/screens/combat/hooks/useCombatLayout.ts Reserves actual combat HUD heights in arena bounds.
src/components/screens/combat/hooks/useCombatLayout.test.ts Updates combat arena positioning expectation.
src/components/screens/combat/components/hud/CombatTopHUD.tsx Uses shared combat top HUD height constant.
src/components/screens/combat/components/hud/CombatRightHUD.test.tsx Updates side HUD sizing expectations.
src/components/screens/combat/components/hud/CombatLeftHUD.test.tsx Updates side HUD sizing expectations.
src/components/screens/combat/components/hud/CombatBottomHUD.tsx Uses shared combat bottom HUD height constant.
src/components/screens/combat/CombatScreen3D.tsx Reuses shared HUD scale and top HUD height for overlay offsets.
scripts/capture-screenshots.ts Adds DOM-ready navigation helper with timeout for screenshot flows.

@github-actions
Copy link
Copy Markdown
Contributor

๐Ÿ“ธ Automated UI Screenshots

๐Ÿ“‹ Screenshots Captured (8)

# Screenshot
1 01-splash-screen.png - 01 splash screen.png
2 02-intro-screen-menu.png - 02 intro screen menu.png
3 03-intro-screen-archetype-selector.png - 03 intro screen archetype selector.png
4 04-controls-screen.png - 04 controls screen.png
5 05-philosophy-screen.png - 05 philosophy screen.png
6 06-training-screen.png - 06 training screen.png
7 07-combat-screen-practice.png - 07 combat screen practice.png
8 08-combat-screen-versus.png - 08 combat screen versus.png

๐Ÿ“ฆ Download Screenshots

๐Ÿ“ฅ Download all screenshots from workflow artifacts

Screenshots are preserved as workflow artifacts for 30 days.


๐Ÿค– Generated by Playwright automation

@pethers pethers merged commit a0ad893 into main May 15, 2026
17 checks passed
@pethers pethers deleted the copilot/improve-ui-ux-combat-training-screens branch May 15, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration changes infrastructure CI/CD and build infrastructure needs-tests Needs test coverage test-coverage-impact Impacts test coverage testing Testing improvements three-components types TypeScript type improvements ui User interface improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants