Skip to content

Conversation

@manuartero
Copy link
Owner

@manuartero manuartero commented Jul 22, 2025

This pull request introduces a significant refactor and enhancement of the round-summary component by replacing the PlayerSummary component with a new PlayerCard component. The changes improve the structure, styling, and functionality of player-related UI elements. Additionally, a reusable Avatar component has been introduced to handle player and enemy avatars more effectively.

Component Refactor and Replacement:

  • Replaced the PlayerSummary component with the new PlayerCard component, which provides a more structured and visually enhanced representation of player information. (src/components/round-summary/player-card.tsx, [1]; src/components/round-summary/round-summary.tsx, [2] [3]
  • Removed the old PlayerSummary component and its associated styles. (src/components/round-summary/player-summary.tsx, [1]; src/components/round-summary/player-summary.module.css, [2]

Avatar Component Introduction:

  • Added a new reusable Avatar component to render player and enemy avatars dynamically, along with associated assets and styles. (src/components/round-summary/avatar/avatar.tsx, [1]; src/components/round-summary/avatar/assets/index.ts, [2]; src/components/round-summary/avatar/avatar.module.css, [3]
  • Added unit tests and snapshots for the Avatar component to ensure proper rendering and functionality. (src/components/round-summary/avatar/avatar.test.tsx, [1]; src/components/round-summary/avatar/__snapshots__/avatar.test.tsx.snap, [2]

Styling Enhancements:

Testing and Snapshots:

  • Added unit tests and snapshots for the PlayerCard component to verify its rendering and behavior. (src/components/round-summary/player-card.test.tsx, [1]; src/components/round-summary/__snapshots__/player-card.test.tsx.snap, [2]

These changes collectively improve the maintainability, reusability, and user experience of the round-summary component.

@manuartero manuartero requested a review from Copilot July 22, 2025 11:20
@manuartero manuartero self-assigned this Jul 22, 2025
@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storming ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 11:20am

Copy link

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 refactors the player summary component by replacing PlayerSummary with a new PlayerCard component, introducing a more modern card-based design with overlapping layout and hover animations.

  • Replaces PlayerSummary component with PlayerCard component featuring card-based UI
  • Adds new Avatar component with player-specific assets for visual representation
  • Implements overlapping card layout with hover animations and scaling effects

Reviewed Changes

Copilot reviewed 13 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/round-summary/round-summary.tsx Updates import and usage from PlayerSummary to PlayerCard
src/components/round-summary/round-summary.module.css Adds card overlap styling and hover animations for stacked card layout
src/components/round-summary/player-summary.tsx Removes old PlayerSummary component
src/components/round-summary/player-summary.module.css Removes old PlayerSummary styles
src/components/round-summary/player-card.tsx Adds new PlayerCard component with improved accessibility and card design
src/components/round-summary/player-card.test.tsx Adds unit tests for PlayerCard component
src/components/round-summary/player-card.module.css Adds styling for new card design with player-specific theming
src/components/round-summary/avatar/avatar.tsx Adds Avatar component for player visual representation
src/components/round-summary/avatar/avatar.test.tsx Adds unit tests for Avatar component
src/components/round-summary/avatar/avatar.module.css Adds Avatar component styling
src/components/round-summary/avatar/assets/index.ts Exports avatar asset imports

}

.playerCard.active {
z-index: 5 !important; /* FIXME */
Copy link

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The !important declaration should be avoided. Consider restructuring the CSS to achieve the desired z-index without using !important.

Suggested change
z-index: 5 !important; /* FIXME */
z-index: 5; /* Adjusted to avoid !important */

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +33
& article {
/* XXX card overlap: is it possible to use some flex magic instead? */
margin-top: -4vh;

transition: transform 0.3s ease-in-out;
}

& article:first-child {
margin-top: 0;
}

& article:nth-child(1) {
z-index: 4;
}

& article:nth-child(2) {
z-index: 3;
}

& article:nth-child(3) {
z-index: 2;
Copy link

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The negative margin approach for card overlap creates a maintenance concern as noted in the comment. Consider using CSS Grid or flexbox with absolute positioning for more maintainable card stacking.

Suggested change
& article {
/* XXX card overlap: is it possible to use some flex magic instead? */
margin-top: -4vh;
transition: transform 0.3s ease-in-out;
}
& article:first-child {
margin-top: 0;
}
& article:nth-child(1) {
z-index: 4;
}
& article:nth-child(2) {
z-index: 3;
}
& article:nth-child(3) {
z-index: 2;
display: grid;
grid-template-rows: repeat(3, auto);
position: relative;
& article {
grid-row: 1;
position: absolute;
width: 100%;
transition: transform 0.3s ease-in-out;
}
& article:nth-child(1) {
z-index: 4;
top: 0;
}
& article:nth-child(2) {
z-index: 3;
top: 6vh;
}
& article:nth-child(3) {
z-index: 2;
top: 12vh;

Copilot uses AI. Check for mistakes.
pointer-events: none;
}

/*
Copy link

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The commented-out CSS code for player-specific colors should be removed if it's not needed, or uncommented and implemented if it's intended functionality.

Suggested change
/*

Copilot uses AI. Check for mistakes.
@manuartero manuartero merged commit ace466f into main Jul 22, 2025
3 checks passed
@manuartero manuartero deleted the feat/player-summary branch July 22, 2025 11:22
manuartero pushed a commit that referenced this pull request Jul 22, 2025
# [0.7.0](v0.6.0...v0.7.0) (2025-07-22)

### Features

* player summary ([#10](#10)) ([ace466f](ace466f)), closes [/#diff-656b9b5c7ee888cb67d666b8ea000b16ceff3933c61848d895c5626d6f86db1dR1-R34](https://github.com///issues/diff-656b9b5c7ee888cb67d666b8ea000b16ceff3933c61848d895c5626d6f86db1dR1-R34) [/#diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L2-R2](https://github.com///issues/diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L2-R2) [/#diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L30-R30](https://github.com///issues/diff-154b7417a785791b29bec3858af773dbf39f61e89dc3d4e1df76abaa782f4c37L30-R30) [/#diff-102b4b1e1b681392824b8628d9527dedd1bd7111115ee63c8458d9dda0848952L1-L33](https://github.com///issues/diff-102b4b1e1b681392824b8628d9527dedd1bd7111115ee63c8458d9dda0848952L1-L33) [/#diff-6acfe855afc93cd952569aa69e347ef8f24f4e0912d0638f9a5e565e83cb2da7L1-L16](https://github.com///issues/diff-6acfe855afc93cd952569aa69e347ef8f24f4e0912d0638f9a5e565e83cb2da7L1-L16) [/#diff-2a7e1cc6dda58e9e09c9c92339e7eda5ee6c63e0e834924f9f7d0a6e2f98e260R1-R22](https://github.com///issues/diff-2a7e1cc6dda58e9e09c9c92339e7eda5ee6c63e0e834924f9f7d0a6e2f98e260R1-R22) [/#diff-45719cceadcbffdc5084fdcd0b770b14133b1cabe58c3ab93c362a938b969f29R1-R11](https://github.com///issues/diff-45719cceadcbffdc5084fdcd0b770b14133b1cabe58c3ab93c362a938b969f29R1-R11) [/#diff-310f0b5fd71b9ffb281a9fa4877a05b8ba57bbb49a22582681765c322b318b4cR1-R31](https://github.com///issues/diff-310f0b5fd71b9ffb281a9fa4877a05b8ba57bbb49a22582681765c322b318b4cR1-R31) [/#diff-f5611d82ab82f01d245452acc76998aaac1bb1640faa38adc584f3d9aeee8873R1-R16](https://github.com///issues/diff-f5611d82ab82f01d245452acc76998aaac1bb1640faa38adc584f3d9aeee8873R1-R16) [/#diff-30ecc934eebdf4b1a2e1c55f6688089b582a0b223fa344160db207938e1cd6e1R1-R10](https://github.com///issues/diff-30ecc934eebdf4b1a2e1c55f6688089b582a0b223fa344160db207938e1cd6e1R1-R10) [/#diff-fd4df391dc4c98c116d5ad533c359047c01a98230904b79b81961edd68b06ee2R1-R67](https://github.com///issues/diff-fd4df391dc4c98c116d5ad533c359047c01a98230904b79b81961edd68b06ee2R1-R67) [/#diff-00e9e73b85bd3402dfe3b4ff7c4ee9a140f33b0e7f01ad8e55ab0864e07575dbR8-R64](https://github.com///issues/diff-00e9e73b85bd3402dfe3b4ff7c4ee9a140f33b0e7f01ad8e55ab0864e07575dbR8-R64) [/#diff-5632ab761432b7f7fc3792349232070c32c3426571b2783e4239b60874662fbcR1-R16](https://github.com///issues/diff-5632ab761432b7f7fc3792349232070c32c3426571b2783e4239b60874662fbcR1-R16) [/#diff-02c98d3e4dff46744bc17c8c6c34f80f52a02ff2cc4e7f437b7c131bd4571777R1-R30](https://github.com///issues/diff-02c98d3e4dff46744bc17c8c6c34f80f52a02ff2cc4e7f437b7c131bd4571777R1-R30)
* **RoundSummary:** first version of RoundSummary ([691009f](691009f))
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.

2 participants