Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive project recovery for July 2025, focusing on modernizing the codebase with updated dependencies, improved styling architecture, and enhanced accessibility features.
- Updates build tooling from Vite plugin React to React SWC and modernizes dependency versions
- Migrates from SCSS to CSS Modules for better component isolation and maintainability
- Enhances accessibility with proper ARIA labels, roles, and semantic HTML structure
Reviewed Changes
Copilot reviewed 101 out of 135 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Updates Vite configuration with React SWC plugin and HTML plugin |
| src/styles/*.css | Migrates SCSS variables to CSS custom properties and removes deprecated files |
| src/components/**/*.tsx | Converts components to use CSS Modules and adds accessibility improvements |
| src/models/new-building.ts | Adds building upgrade functionality and changes default building type |
| src/game-logic/*.ts | Updates game logic to use new building types and terrain system |
| package.json | Updates dependencies to latest versions and changes start script to dev |
Comments suppressed due to low confidence (1)
src/game-logic/pieces.ts:3
- [nitpick] The property name 'specialTerrain' is ambiguous. Consider renaming to 'restrictedTerrain' or 'terrainPenalties' to better indicate its purpose.
specialTerrain: TerrainType[];
| commited: boolean; | ||
| }; | ||
|
|
||
| export function ActionLineItem({ card, commited }: Props): JSX.Element { | ||
| export function ActionLineItem({ card, commited }: Props) { | ||
| return ( | ||
| <div | ||
| className={c( | ||
| "line-item", | ||
| card.owner === "player" && | ||
| "line-item--player" && | ||
| "player" && | ||
| "expansible", | ||
| commited ? "line-item--commited" : "line-item--pending" | ||
| styles.lineItem, | ||
| card.owner === "player" && styles.expansible, | ||
| commited ? styles.committed : styles.pending |
There was a problem hiding this comment.
The word 'commited' is misspelled. It should be 'committed' with double 't'.
| border: 2px dotted var(--dark-grey); | ||
| } | ||
|
|
||
| .lineItem.commited { |
There was a problem hiding this comment.
The CSS class name 'commited' is misspelled. It should be 'committed' with double 't'.
| .lineItem.commited { | |
| .lineItem.committed { |
| > | ||
| <div | ||
| class="line-item line-item--commited" | ||
| class="lineItem committed" |
There was a problem hiding this comment.
Inconsistent spelling: the snapshot shows 'committed' but the code uses 'commited'. This suggests the CSS class name should be updated to match.
| <div className="board__row board__row--2-to-equator">{renderRow(2)}</div> | ||
| <div className="board__row board__row--3-to-equator">{renderRow(3)}</div> | ||
| </div> | ||
| <section className={styles.board} role="board" aria-label="game board"> |
There was a problem hiding this comment.
The role 'board' is not a valid ARIA role. Consider using 'region' or 'application' instead, or remove the role attribute since semantic HTML
| <section className={styles.board} role="board" aria-label="game board"> | |
| <section className={styles.board} aria-label="game board"> |
| <div className="board__row board__row--2-to-equator">{renderRow(2)}</div> | ||
| <div className="board__row board__row--3-to-equator">{renderRow(3)}</div> | ||
| </div> | ||
| <section className={styles.board} role="board" aria-label="game board"> |
There was a problem hiding this comment.
Using role='row' without a parent container with role='grid' or 'table' is invalid. Consider removing these role attributes or restructuring with proper ARIA grid roles.
| <section className={styles.board} role="board" aria-label="game board"> | |
| <section className={styles.board} role="grid" aria-label="game board"> |
|
|
||
| {building && owner && <Building variant={building} owner={owner} />} | ||
| {children && ( | ||
| <div className={c(styles.piece)} style={pieceStyle}> |
There was a problem hiding this comment.
[nitpick] The random positioning logic using useRef may cause inconsistent behavior. Consider using a more predictable positioning system or memoizing the offset calculation.
| onClick, | ||
| }: Props) { | ||
| /* debug: turn on debug ID */ | ||
| const debugTileID = false; |
There was a problem hiding this comment.
Debug code should be removed from production. Consider using environment variables or a proper debug configuration system.
| const debugTileID = false; | |
| const debugTileID = process.env.REACT_APP_DEBUG_TILE_ID === "true"; |
a53a663 to
276e658
Compare
|
@copilot how would you call (title) this PR |
# [0.5.0](v0.4.1...v0.5.0) (2025-07-21) ### Bug Fixes * <Dialog /> ([92687f3](92687f3)) * recover visual status for <Tile /> (available, owned...) ([9b153f6](9b153f6)) * tests ([276e658](276e658)) ### Features * recover project (July 2025) ([#7](#7)) ([a6a504c](a6a504c)), closes [/#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L7-R7](https://github.com///issues/diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L7-R7) [/#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L32-R70](https://github.com///issues/diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L32-R70) [/#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L32-R70](https://github.com///issues/diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L32-R70) [/#diff-d7f25b99ffec31fa85dc8d4b42e64ee59a7654fceb97327fc67a80158ebcfbb6L90-R90](https://github.com///issues/diff-d7f25b99ffec31fa85dc8d4b42e64ee59a7654fceb97327fc67a80158ebcfbb6L90-R90) [/#diff-b606cac853277b85a5aa49de291ccc05ef14651b08b1fd1a751d7749e6c62a27L1-L66](https://github.com///issues/diff-b606cac853277b85a5aa49de291ccc05ef14651b08b1fd1a751d7749e6c62a27L1-L66) [/#diff-d4e452a166be192080b07c76e0b1d6b8eb4fb7e21440354edfcdd41a324baf4eR1-R25](https://github.com///issues/diff-d4e452a166be192080b07c76e0b1d6b8eb4fb7e21440354edfcdd41a324baf4eR1-R25) [/#diff-580dd584cc8e9dd5796583ab3b6925f85decdf3986ff46d2d442cf901ff292a3L1-L38](https://github.com///issues/diff-580dd584cc8e9dd5796583ab3b6925f85decdf3986ff46d2d442cf901ff292a3L1-L38) [/#diff-0d7772935af567cfc4066138acbb53ff6575cbba9801b15b46a61fcbad3c01f9R1-R43](https://github.com///issues/diff-0d7772935af567cfc4066138acbb53ff6575cbba9801b15b46a61fcbad3c01f9R1-R43) [/#diff-8ab26dfe22c0d90d39587ce8b7e4545445f11317f0b4483e1f79ea6f775ec6c0L1-L21](https://github.com///issues/diff-8ab26dfe22c0d90d39587ce8b7e4545445f11317f0b4483e1f79ea6f775ec6c0L1-L21) [/#diff-0b9f0eaba232e2375eb818ecaca50bf9d9d5d1eae7d870db081df76bab4fbd87R54-R57](https://github.com///issues/diff-0b9f0eaba232e2375eb818ecaca50bf9d9d5d1eae7d870db081df76bab4fbd87R54-R57) [/#diff-41b37b8eb359f10d5872e755d71c9e8254ee3a13e7f68e70c90a0470047551cdR4-R21](https://github.com///issues/diff-41b37b8eb359f10d5872e755d71c9e8254ee3a13e7f68e70c90a0470047551cdR4-R21) [/#diff-41b37b8eb359f10d5872e755d71c9e8254ee3a13e7f68e70c90a0470047551cdL44-R40](https://github.com///issues/diff-41b37b8eb359f10d5872e755d71c9e8254ee3a13e7f68e70c90a0470047551cdL44-R40) [/#diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8R1-R7](https://github.com///issues/diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8R1-R7) [/#diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8L37-R84](https://github.com///issues/diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8L37-R84) [/#diff-b50abf402a7b9a8b92c8baa8b8f41315c8668370855a400f58db54c27ecffba3L3-R9](https://github.com///issues/diff-b50abf402a7b9a8b92c8baa8b8f41315c8668370855a400f58db54c27ecffba3L3-R9) [/#diff-a0001abae4480f341f4c97b77f6cf05a9118c0c157e7faa312f8ee2fc22a8ac4L1-L9](https://github.com///issues/diff-a0001abae4480f341f4c97b77f6cf05a9118c0c157e7faa312f8ee2fc22a8ac4L1-L9) [/#diff-8539965c139f02185423836360e5c2530ad0d6735453fa31c992644b27d17da9L1-L16](https://github.com///issues/diff-8539965c139f02185423836360e5c2530ad0d6735453fa31c992644b27d17da9L1-L16) [/#diff-a7d39e1ce62f057dcb0b9a496cf7158d020f420cc42c981e857e3c632025b183L1-L35](https://github.com///issues/diff-a7d39e1ce62f057dcb0b9a496cf7158d020f420cc42c981e857e3c632025b183L1-L35) [/#diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8R1-R7](https://github.com///issues/diff-f42224d836ecad44d9ca2adbf24bb87055b6575dccbdf0b945dd59a7577e1bf8R1-R7)
This pull request introduces several updates across the codebase, focusing on modernizing dependencies, transitioning from SCSS to CSS modules, improving the board game logic, and enhancing the structure and maintainability of the project. Key changes include dependency upgrades, refactoring of styles, and updates to the board's functionality and visual representation.
Dependency and Configuration Updates:
nodeversion requirement to>=20.19inpackage.jsonand updated dependencies and devDependencies to their latest versions, includingreact,typescript, andjest(package.json, [1] [2].vitescript aliasstartwithdevinpackage.json(package.json, package.jsonL32-R70).moduleNameMapperconfiguration to remove theregex anchor for.svgfiles (jest.config.mjs`, jest.config.mjsL90-R90).Transition from SCSS to CSS Modules:
app.scsstoapp.module.css, including grid layout definitions for the main app, and removed redundant SCSS code (src/app.scss, [1];src/app.module.css, [2].board.scsstoboard.module.cssto utilize CSS modules and improve maintainability (src/components/board/board.scss, [1];src/components/board/board.module.css, [2].option-dialog.scss(src/components/board/option-dialog.scss, src/components/board/option-dialog.scssL1-L21).Board Game Logic and Visual Updates:
upgradeBuildinghelper function to simplify building upgrades and replaced inline logic with this helper inboard-controller.tsx(src/components/board/board-controller.tsx, src/components/board/board-controller.tsxR54-R57).inferVisualBoardFromGameContextfunction to remove theidlestatus and simplify the logic for determining tile statuses (src/components/board/infer-visual-board.ts, [1] [2].Boardcomponent to use CSS modules for styling and added ARIA roles and labels for improved accessibility (src/components/board/board.tsx, [1] [2].Mock and Test Updates:
svg-mock.cjsfile to export a React-compatible mock for.svgfiles (src/__mocks__/svg-mock.cjs, src/mocks/svg-mock.cjsL3-R9).PieceandTilecomponents (src/components/board/__snapshots__/piece.test.tsx.snap, [1];src/components/board/__snapshots__/tile.test.tsx.snap, [2].Component and Structural Refactoring:
BuildDialogcomponent to remove unused SCSS styles and improve its structure by adding a title and simplifying its JSX (src/components/board/build-dialog.tsx, src/components/board/build-dialog.tsxL1-L35).Boardcomponent to use nested directories forpiecesandtilesto better organize its structure (src/components/board/board.tsx, src/components/board/board.tsxR1-R7).These changes collectively improve the project's maintainability, performance, and developer experience while modernizing the codebase.