Skip to content

Adding a simple color blind mode - #1946

Closed
troshujin wants to merge 101 commits into
openfrontio:mainfrom
troshujin:colorblindmode
Closed

troshujin wants to merge 101 commits into
openfrontio:mainfrom
troshujin:colorblindmode

Conversation

@troshujin

@troshujin troshujin commented Aug 27, 2025 •

Copy link
Copy Markdown

Description:

Issue arose when my colorblind friend had trouble spawning in in team games, not able to find the team.
Added a color blind mode toggle in both settings menu's. With color blind mode, it changes the highlight area color around players when in the spawning phase of the game.

Also added a clearer highlight area around the player and enemies for non color blind mode colors as this was also unclear.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

troshujin

UI Screenshots

New colors for non color blind mode:
Left to right: Enemy, You, Teammate
image

New colors for color blind mode:
Left to right: Enemy, You, Teammate
image

User settings:
image

Basic settings:
image

Kipstz and others added 30 commits August 5, 2025 02:48
## Description:

This PR implements a new feature allowing automatic upgrade of the
nearest building using the middle mouse button. This feature greatly
simplifies the upgrade process that previously required a right-click +
building recreation.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Kipstzz

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
## Description:

Checks that each lang file’s lang_code matches its filename and that the
flag SVG exists.
Reports all errors in a single test run for easier debugging.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aotumuri

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:

Added a red delete button with trash can icon to the right-click radial
menu that allows players to voluntarily delete their own units.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Kipstz

<img width="286" height="209" alt="image"
src="https://github.com/user-attachments/assets/85142be3-2aa5-4c84-ab30-0c68289c8f85"
/>

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:

Strict mode is causing docker deployments to fail. This commit reverts
only the strict mode setting itself, while keeping the code changes, so
that we can re-enable it more easily in the future.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
Fixes #1559

## Description:

The current Mars map has several issues:
- The map is very underdetailed
  - The coastlines are very smooth and visually unappealing
  
- The map was created from an incompatible source image, which results
in the height data being very wrong
  - As a result the map hardly resembles Mars at all.
  - There is too much land
  - The major landmass is almost entirely covered in plains
  - The ocean doesn't match the heightmap

- The gameplay is boring
  - The map is very succeptable to snowballing issues
  - The map seems commonly disliked in the community

I attempted to remedy this. 
- The water level and elevation are calculated from accurate height data
- Water level is much higher making the map much more interesting, both
in the gameplay and visual aspect.
  - The map has several contitents which should slow down snowballing
- The map is much more detailed overall
- I added a lot more NPC's. 8 for such a big map just wasn't enough.
<img width="2500" height="1150" alt="Mars_Out2"
src="https://github.com/user-attachments/assets/7b7009f7-6376-4059-b731-86931df8f926"
/>


- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aceralex

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:

Switches away from ts-jest in favor of @swc/jest. On my local I observe
a ten-fold decrease in how long it takes the test suite to run. No
changes are required to how our existing tests are written.

Benchmarking
old: 24.658s
new: 2.268s


ts-jest (old)
```
Test Suites: 29 passed, 29 total
Tests:       215 passed, 215 total
Snapshots:   0 total
Time:        24.658 s
Ran all test suites.
```

swc-jest (new)
```
Test Suites: 29 passed, 29 total
Tests:       215 passed, 215 total
Snapshots:   0 total
Time:        2.268 s
Ran all test suites.
```

Fixes #1679


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

slyty
## Description:

This pull request adds support for ICU (Intl MessageFormat) syntax in
the translation system.
Existing translation files may need to be updated to fully leverage ICU
features.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

DISCORD_USERNAME
## Description:

Add frontend-approver and backend-approver to CODEOWNERS file

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
Bumps the npm_and_yarn group with 2 updates in the / directory:
[on-headers](https://github.com/jshttp/on-headers) and
[compression](https://github.com/expressjs/compression).

Updates `on-headers` from 1.0.2 to 1.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jshttp/on-headers/releases">on-headers's
releases</a>.</em></p>
<blockquote>
<h2>1.1.0</h2>
<h2>Important</h2>
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>Migrate CI pipeline to GitHub actions by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/12">jshttp/on-headers#12</a></li>
<li>fix README.md badges by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/13">jshttp/on-headers#13</a></li>
<li>add OSSF scorecard action by <a
href="https://github.com/carpasse"><code>@​carpasse</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/14">jshttp/on-headers#14</a></li>
<li>fix: use <code>ubuntu-latest</code> as ci runner by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/jshttp/on-headers/pull/19">jshttp/on-headers#19</a></li>
<li>ci: apply OSSF Scorecard security best practices by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/jshttp/on-headers/pull/20">jshttp/on-headers#20</a></li>
<li>👷 add upstream change detection by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/31">jshttp/on-headers#31</a></li>
<li>✨ add script to update known hashes by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/32">jshttp/on-headers#32</a></li>
<li>💚 update CI - add newer node versions by <a
href="https://github.com/ctcpip"><code>@​ctcpip</code></a> in <a
href="https://redirect.github.com/jshttp/on-headers/pull/33">jshttp/on-headers#33</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/carpasse"><code>@​carpasse</code></a>
made their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/12">jshttp/on-headers#12</a></li>
<li><a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
made their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/19">jshttp/on-headers#19</a></li>
<li><a href="https://github.com/ctcpip"><code>@​ctcpip</code></a> made
their first contribution in <a
href="https://redirect.github.com/jshttp/on-headers/pull/31">jshttp/on-headers#31</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0">https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jshttp/on-headers/blob/master/HISTORY.md">on-headers's
changelog</a>.</em></p>
<blockquote>
<h1>1.1.0 / 2025-07-17</h1>
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/jshttp/on-headers/commit/4b017af88f5375bbdf3ad2ee732d2c122e4f52b0"><code>4b017af</code></a>
1.1.0</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/b636f2d08e6c1e0a784b53a13cd61e05c09bb118"><code>b636f2d</code></a>
♻️ refactor header array code</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/3e2c2d46c3e9592f6a1c3a3a1dbe622401f95d39"><code>3e2c2d4</code></a>
✨ ignore falsy header keys, matching node behavior</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/172eb41b99a5a290b27a2c43fe602ca33aa1c8ce"><code>172eb41</code></a>
✨ support duplicate headers</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/c6e384908c9c6127d18831d16ab0bd96e1231867"><code>c6e3849</code></a>
🔒️ fix array handling</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/6893518341bb4e5363285df086b3158302d3b216"><code>6893518</code></a>
💚 update CI - add newer node versions</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/56a345d82b51a0dcb8d09f061f87b1fd1dc4c01e"><code>56a345d</code></a>
✨ add script to update known hashes</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/175ab217155d525371a5416ff059f895a3a532a6"><code>175ab21</code></a>
👷 add upstream change detection (<a
href="https://redirect.github.com/jshttp/on-headers/issues/31">#31</a>)</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/ce0b2c8fcd313d38d3534fb731050dc16e105bf6"><code>ce0b2c8</code></a>
ci: apply OSSF Scorecard security best practices (<a
href="https://redirect.github.com/jshttp/on-headers/issues/20">#20</a>)</li>
<li><a
href="https://github.com/jshttp/on-headers/commit/1a38c543e75cd06217b449531de10b1758e35299"><code>1a38c54</code></a>
fix: use <code>ubuntu-latest</code> as ci runner (<a
href="https://redirect.github.com/jshttp/on-headers/issues/19">#19</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~ulisesgascon">ulisesgascon</a>, a new
releaser for on-headers since your current version.</p>
</details>
<br />

Updates `compression` from 1.8.0 to 1.8.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/compression/releases">compression's
releases</a>.</em></p>
<blockquote>
<h2>v1.8.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(docs): update multiple links from http to https by <a
href="https://github.com/Phillip9587"><code>@​Phillip9587</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/222">expressjs/compression#222</a></li>
<li>ci: add dependabot for github actions by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/compression/pull/207">expressjs/compression#207</a></li>
<li>build(deps): bump github/codeql-action from 2.23.2 to 3.28.15 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/228">expressjs/compression#228</a></li>
<li>build(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/229">expressjs/compression#229</a></li>
<li>build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.31.0 by
<a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/230">expressjs/compression#230</a></li>
<li>build(deps-dev): bump supertest from 6.2.3 to 6.3.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/231">expressjs/compression#231</a></li>
<li>[StepSecurity] ci: Harden GitHub Actions by <a
href="https://github.com/step-security-bot"><code>@​step-security-bot</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/235">expressjs/compression#235</a></li>
<li>build(deps): bump github/codeql-action from 3.28.15 to 3.29.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/243">expressjs/compression#243</a></li>
<li>build(deps): bump actions/upload-artifact from 4.3.1 to 4.6.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/239">expressjs/compression#239</a></li>
<li>build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/240">expressjs/compression#240</a></li>
<li>build(deps): bump actions/checkout from 4.1.1 to 4.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/241">expressjs/compression#241</a></li>
<li>build(deps-dev): bump eslint-plugin-import from 2.31.0 to 2.32.0 by
<a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/expressjs/compression/pull/244">expressjs/compression#244</a></li>
<li>deps: on-headers@1.1.0 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/246">expressjs/compression#246</a></li>
<li>Release: 1.8.1 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/compression/pull/247">expressjs/compression#247</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/228">expressjs/compression#228</a></li>
<li><a
href="https://github.com/step-security-bot"><code>@​step-security-bot</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/compression/pull/235">expressjs/compression#235</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/compression/compare/1.8.0...v1.8.1">https://github.com/expressjs/compression/compare/1.8.0...v1.8.1</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/compression/blob/master/HISTORY.md">compression's
changelog</a>.</em></p>
<blockquote>
<h1>1.8.1 / 2025-07-17</h1>
<ul>
<li>deps: on-headers@~1.1.0
<ul>
<li>Fix <a
href="https://www.cve.org/CVERecord?id=CVE-2025-7339">CVE-2025-7339</a>
(<a
href="https://github.com/expressjs/on-headers/security/advisories/GHSA-76c9-3jph-rj3q">GHSA-76c9-3jph-rj3q</a>)</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/expressjs/compression/commit/83a0c45fe190f4fcb8b515c18065db9cb9029dd1"><code>83a0c45</code></a>
1.8.1</li>
<li><a
href="https://github.com/expressjs/compression/commit/ce62713129f4b33eac4b833e1722410091646395"><code>ce62713</code></a>
deps: on-headers@1.1.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/246">#246</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/f4acb23985fa345318d34d4a96acf555a883efeb"><code>f4acb23</code></a>
build(deps-dev): bump eslint-plugin-import from 2.31.0 to 2.32.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/244">#244</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/6eaebe63f2ecac191d402c570bde140488435c4c"><code>6eaebe6</code></a>
build(deps): bump actions/checkout from 4.1.1 to 4.2.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/241">#241</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/37e062312fd270f84b5f50f7c6f88312609633f5"><code>37e0623</code></a>
build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/240">#240</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/bc436b26283c2f85a9711085dd0e4a580de50ba7"><code>bc436b2</code></a>
build(deps): bump actions/upload-artifact from 4.3.1 to 4.6.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/239">#239</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/2f9f5726751ecf12f7c46a9d1493bcd1966e09a7"><code>2f9f572</code></a>
build(deps): bump github/codeql-action from 3.28.15 to 3.29.2 (<a
href="https://redirect.github.com/expressjs/compression/issues/243">#243</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/5f13b148d2a1a2daaa8647e03592214bb240bf18"><code>5f13b14</code></a>
[StepSecurity] ci: Harden GitHub Actions (<a
href="https://redirect.github.com/expressjs/compression/issues/235">#235</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/76e094548125afbf8089a482d5982dc96c7ce398"><code>76e0945</code></a>
build(deps-dev): bump supertest from 6.2.3 to 6.3.4 (<a
href="https://redirect.github.com/expressjs/compression/issues/231">#231</a>)</li>
<li><a
href="https://github.com/expressjs/compression/commit/ae6ee809dc0cb40febaf2a5bff298465bd5a207f"><code>ae6ee80</code></a>
build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.31.0 (<a
href="https://redirect.github.com/expressjs/compression/issues/230">#230</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/expressjs/compression/compare/1.8.0...v1.8.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/openfrontio/OpenFrontIO/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description:

Added 2-fingers control for map with trackpad

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

pierre_brtr
## Description:

Enable the `sort-keys` eslint rule.

Fixes #1629

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
## Description:

Problem: attacking a player right before accepting an alliance request
is very effective since the requester can't fight back or reclaim his
territory without canceling the alliance and being penalized with the
traitor debuff.

Change:
- Attacking a player after he requested an alliance automatically
rejects the request
- No changes to existing attacks in both directions, only new attacks
affect the request

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
## Description:

The websocket message handler functions have gotten quite large. This
change extracts them to functions in their own file, and extracts the
`"join"` message acceptance logic into its own function allowing for all
cases to be accounted for when we add error messages in #1447.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
## Description:

Enable `@total-typescript/ts-reset`

Fixes #1760

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
## Description:

Update the code for strict mode.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
## Description:

Enable eslint warning for
`@typescript-eslint/consistent-type-assertions`. While build warnings
are generally a discouraged pattern, we are actively working to drive
the number of warnings down to zero, at which point we will convert the
warnings to errors.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
## Description:

Since the in-game Settings became their own modal in v24, it blocks game
control but the game goes on in the background. On mobile it is full
screen so you don't even notice the game still playing in the
background.

Of course players understand that a Multiplayer game will move on. But
for Single Player, the game mode played by beginners too, you'd expect
the game to be paused and are surprised when it isn't. Same goes for
Replays.

This PR fixes it:

- Pause when opening the in-game Settings modal during replay or single
player game.
- Unpause again when closing the Settings modal (if not already paused
before opening the Settings).
- The icon for pause/unpause isn't switched in GameRightSideBar during
this, as the sidebar is blurred in the background anyway.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:

Re-enable strict mode

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Remove CLA from the PR description template and PR check. This is
handled through a dedicated status check, so the description is not
needed.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Describe the PR.
This PR makes the playerInfoOverlay collapsible by clicking on the
player name.

This overlay was covering a decent chunk of the mobile screen.


![1754819765364](https://github.com/user-attachments/assets/a74b0853-bdaa-4c1b-b28d-a270665f2955)

Now the details can be toggled by just clicking on the name freeing a
lot of the screen on mobile.

![1754819765361](https://github.com/user-attachments/assets/800917b9-1a98-4aa5-b4bd-e9c35e47e9d3)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

DISCORD_USERNAME
tls_15

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:
Resolve #1652 

1. Add the ability to toggle **gold donations** and **troop donations**
for private lobbies
~2. Add relevant translations.~
3. Refactor `canDonate` to be specific to gold and troop donations 
4. Add placeholders for singleplayer mode if this is to be extended to
support that too.
5. Add Tests for Donate logic

### Screenshots:
<img width="1643" height="1788" alt="image"
src="https://github.com/user-attachments/assets/82b93400-a1f0-45f0-8b2b-a7f78dc0c3e9"
/>

_Private Lobby_

### Smoke Tests


![donatetroopsprivatelobby](https://github.com/user-attachments/assets/c6690bbc-958e-48a1-9cf1-e2b361dfb1b2)
_Testing Troop Send In Private Lobby_


![donatetroopsprivatelobby2](https://github.com/user-attachments/assets/698c7603-6b4b-4da7-91ab-7bdc38bb49a5)

_Troop Send Complete In Private Lobby_


![testtradepublicteams](https://github.com/user-attachments/assets/1010332c-3f38-4644-9218-46aa7141f578)
Confirming that public teams still works


## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

DISCORD_USERNAME: cool_clarky

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
## Description:

Enable various eslint rules.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Enable eslint rule `@stylistic/ts/indent`. Fixes #1778

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Enable more stylistic rules.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Enable eslint rule `quote-props`

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Enable enforcement of various eslint style rules.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Have at least 2 clients and majority vote to decide a winner

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
## Description:

Restore code that was accidentally deleted in the previous PR.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Description:

Prefer `type.array()` over `z.array(type)`.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
TheGiraffe3 and others added 7 commits August 26, 2025 21:59
## Description:

Adds more chat messages in several categories, as requested on
[Discord](https://discord.com/channels/1284581928254701718/1379092916827324426/1409862901816102964)

<img width="1440" height="800" alt="Screen Shot 2025-08-26 at 5 42 28
PM"
src="https://github.com/user-attachments/assets/f7c58cce-586c-47fa-b41b-728d5a829127"
/>
<img width="1440" height="800" alt="Screen Shot 2025-08-26 at 5 42 53
PM"
src="https://github.com/user-attachments/assets/8621e162-154d-48ee-a747-c7545f4e561d"
/>
<img width="1440" height="800" alt="Screen Shot 2025-08-26 at 5 42 41
PM"
src="https://github.com/user-attachments/assets/6d35da7e-6690-47ee-9850-094893f5b6ce"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

loymdayddaud
@coderabbitai

coderabbitai Bot commented Aug 27, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@troshujin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b44af62 and fbfbbd9.

📒 Files selected for processing (2)
  • src/client/graphics/layers/SettingsModal.ts (3 hunks)
  • src/client/graphics/layers/TerritoryLayer.ts (2 hunks)

Walkthrough

Adds a Color Blind Mode user setting, UI toggles (modal and settings layer), localization strings, theme API and palette additions, and color-blind-aware color selection in territory rendering. Also updates .gitignore to ignore JetBrains IDE files.

Changes

Cohort / File(s) Summary
Ignore list updates
/.gitignore
Adds .idea/ and *.iml to ignored files.
Localization
/resources/lang/en.json
Adds four keys under user_setting: color_blind_mode_label, color_blind_mode_desc, color_blind_mode_enabled, color_blind_mode_disabled.
Client settings UI
/src/client/UserSettingModal.ts
Adds Color Blind Mode toggle UI and handler toggleColorBlindMode(e); binds to userSettings.colorBlindMode().
Graphics settings UI
/src/client/graphics/layers/SettingsModal.ts
Adds Color Blind Mode button/icon and handler onToggleColorBlindModeButtonClick(); toggles setting, emits redraw, requests UI update.
Territory rendering
/src/client/graphics/layers/TerritoryLayer.ts
Reworks spawn-highlight and alternate-view color selection to use color-blind variants based on colorBlindMode() and player relations; adds debug logging.
Theme API
/src/core/configuration/Config.ts
Extends Theme interface with five getters: colorBlindSelfColor(), colorBlindAllyColor(), colorBlindNeutralColor(), colorBlindEnemyColor(), colorBlindSpawnHighlightColor().
Theme implementations
/src/core/configuration/PastelTheme.ts, .../PastelThemeDark.ts
Adds color-blind palette fields and accessors; swaps _selfColor and _allyColor base assignments in PastelTheme.
User settings core
/src/core/game/UserSettings.ts
Adds colorBlindMode() getter and toggleColorBlindMode() mutator.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant USM as UserSettingModal
  participant US as UserSettings
  participant EB as EventBus
  participant GL as GraphicsLayer (TerritoryLayer)
  participant T as Theme

  U->>USM: Toggle "Color Blind Mode"
  USM->>US: toggleColorBlindMode()
  US-->>USM: Updated stored value
  USM->>EB: Emit RedrawGraphicsEvent
  EB->>GL: Redraw request
  GL->>US: Query colorBlindMode()
  US-->>GL: boolean
  GL->>T: Request color or color-blind variants
  T-->>GL: Palette colors
  GL-->>U: Render with chosen colors
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant SM as SettingsModal
  participant US as UserSettings
  participant EB as EventBus
  participant TL as TerritoryLayer
  participant T as Theme

  U->>SM: Click Color Blind Mode button
  SM->>US: toggleColorBlindMode()
  SM->>EB: RedrawGraphicsEvent
  EB->>TL: Redraw
  TL->>US: colorBlindMode()
  TL->>T: colorBlind*Color() or normal getters
  T-->>TL: Selected palette colors
  TL-->>U: Updated territory highlights
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

Feature - Frontend, UI/UX, Feature - New

Suggested reviewers

  • scottanderson
  • evanpelle

Poem

A switch flips on with shades anew 🕶️
Maps adopt a clearer, kinder view.
Allies, foes, and neutral lands,
Now painted with more thoughtful hands.
Small toggles lead to brighter sight.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (5)
src/client/UserSettingModal.ts (1)

290-299: Nit: fix control id naming.

Drop the duplicated “color” for consistency with other ids.

-        id="color-blind-color-mode-toggle"
+        id="color-blind-mode-toggle"
src/core/configuration/Config.ts (1)

194-200: Consider collapsing accessor surface with typed unions.

Optional: instead of 5 extra getters, expose one function with typed unions to reduce duplication and keep semantics consistent:

  • relation: "self" | "ally" | "neutral" | "enemy" | "spawnHighlight"
  • mode: "default" | "colorBlind"

Example signature: relationColor(relation, mode): Colord.

src/core/configuration/PastelThemeDark.ts (1)

38-45: Color-blind palette added — sensible picks.

Values are within RGB bounds and distinct from non-CB palette.

Consider centralizing both Pastel theme palettes behind a small typed map:

  • type Relation = "self" | "ally" | "neutral" | "enemy" | "spawnHighlight"
  • type Mode = "default" | "colorBlind"
    Then index colors as palette[mode][relation] to avoid repeating getters in both themes.
src/client/graphics/layers/TerritoryLayer.ts (2)

507-532: Avoid repeated getters; cache mode once.

Micro, but cleaner and more readable.

   alternateViewColor(other: PlayerView): Colord {
     const myPlayer = this.game.myPlayer();
+    const isCB = this.userSettings.colorBlindMode();
     if (!myPlayer) {
-      return this.userSettings.colorBlindMode()
-        ? this.theme.colorBlindNeutralColor()
-        : this.theme.neutralColor();
+      return isCB ? this.theme.colorBlindNeutralColor() : this.theme.neutralColor();
     }
     if (other.smallID() === myPlayer.smallID()) {
-      return this.userSettings.colorBlindMode()
-        ? this.theme.colorBlindSelfColor()
-        : this.theme.selfColor();
+      return isCB ? this.theme.colorBlindSelfColor() : this.theme.selfColor();
     }
     if (other.isFriendly(myPlayer)) {
-      return this.userSettings.colorBlindMode()
-        ? this.theme.colorBlindAllyColor()
-        : this.theme.allyColor();
+      return isCB ? this.theme.colorBlindAllyColor() : this.theme.allyColor();
     }
     if (!other.hasEmbargo(myPlayer)) {
-      return this.userSettings.colorBlindMode()
-        ? this.theme.colorBlindNeutralColor()
-        : this.theme.neutralColor();
+      return isCB ? this.theme.colorBlindNeutralColor() : this.theme.neutralColor();
     }
-    return this.userSettings.colorBlindMode()
-      ? this.theme.colorBlindEnemyColor()
-      : this.theme.enemyColor();
+    return isCB ? this.theme.colorBlindEnemyColor() : this.theme.enemyColor();
   }

180-201: Optional: put relation-to-color logic behind a tiny helper.

You already have alternateViewColor(). A similar getSpawnHighlightColor(human, myPlayer, isColorBlind) would remove branching duplication and make tests trivial.

I can draft the helper + unit tests for friendly/neutral/embargo cases.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c798ef and f9297e0.

⛔ Files ignored due to path filters (1)
  • resources/images/ColorBlindModeIconWhite.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • .gitignore (1 hunks)
  • resources/lang/en.json (1 hunks)
  • src/client/UserSettingModal.ts (2 hunks)
  • src/client/graphics/layers/SettingsModal.ts (3 hunks)
  • src/client/graphics/layers/TerritoryLayer.ts (2 hunks)
  • src/core/configuration/Config.ts (1 hunks)
  • src/core/configuration/PastelTheme.ts (2 hunks)
  • src/core/configuration/PastelThemeDark.ts (2 hunks)
  • src/core/game/UserSettings.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/Colors.ts:114-330
Timestamp: 2025-06-06T15:36:31.739Z
Learning: In the OpenFrontIO project, color improvements are implemented incrementally. The current focus for player colors is ensuring sufficient unique color availability rather than optimizing for visual distinction or accessibility features.
📚 Learning: 2025-06-10T09:56:44.473Z
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/PastelThemeDark.ts:53-53
Timestamp: 2025-06-10T09:56:44.473Z
Learning: In ColorAllocator class in src/core/configuration/Colors.ts, the correct method names are assignColor(id: string): Colord for general color assignment and assignTeamColor(team: Team): Colord for team-specific colors. There are no assignPlayerColor() or assignBotColor() methods.

Applied to files:

  • src/core/configuration/Config.ts
  • src/core/configuration/PastelThemeDark.ts
  • src/core/configuration/PastelTheme.ts
  • src/client/graphics/layers/TerritoryLayer.ts
📚 Learning: 2025-06-06T15:42:21.903Z
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/PastelThemeDark.ts:20-21
Timestamp: 2025-06-06T15:42:21.903Z
Learning: In ColorAllocator class, all methods (assignBotColor, assignPlayerColor, assignTeamColor) use the constructor colors from this.availableColors. Only the predefined team cases in assignTeamColor use hardcoded global colors, while the default case uses constructor colors.

Applied to files:

  • src/core/configuration/PastelThemeDark.ts
  • src/core/configuration/PastelTheme.ts
📚 Learning: 2025-06-06T15:36:31.739Z
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/Colors.ts:114-330
Timestamp: 2025-06-06T15:36:31.739Z
Learning: In the OpenFrontIO project, color improvements are implemented incrementally. The current focus for player colors is ensuring sufficient unique color availability rather than optimizing for visual distinction or accessibility features.

Applied to files:

  • src/core/configuration/PastelTheme.ts
📚 Learning: 2025-06-22T21:51:14.990Z
Learnt from: devalnor
PR: openfrontio/OpenFrontIO#1248
File: src/client/graphics/layers/TerritoryInfoLayer.ts:20-20
Timestamp: 2025-06-22T21:51:14.990Z
Learning: In TerritoryInfoLayer.ts, the highlightedTerritory field uses both null and undefined intentionally: undefined represents initial state or inactive layer (Ctrl released), while null represents active layer with no territory being highlighted at cursor position. This distinction is important for proper state change detection.

Applied to files:

  • src/client/graphics/layers/TerritoryLayer.ts
🧬 Code graph analysis (3)
src/client/graphics/layers/SettingsModal.ts (3)
src/client/InputHandler.ts (1)
  • RedrawGraphicsEvent (73-73)
src/client/Utils.ts (1)
  • translateText (83-147)
src/client/LangSelector.ts (1)
  • translateText (259-279)
src/client/UserSettingModal.ts (1)
src/client/Utils.ts (1)
  • translateText (83-147)
src/client/graphics/layers/TerritoryLayer.ts (1)
src/core/game/GameView.ts (1)
  • myPlayer (509-512)
🔇 Additional comments (11)
.gitignore (1)

13-14: LGTM: ignore IDE artifacts.

Safe to add. Keeps repo clean.

src/core/game/UserSettings.ts (2)

51-53: LGTM: getter for colorBlindMode.

Defaults to false; matches rest of settings API.


118-120: LGTM: toggle method mirrors existing pattern.

No side effects (DOM) here, which is fine; callers handle redraw.

src/client/UserSettingModal.ts (1)

112-123: Action Required: Verify event usage before adding
I ran searches for both color-blind-mode-changed and the analogous dark-mode-changed and found no dispatches or listeners in the codebase. Without evidence of existing event patterns, it’s unclear where listeners should go or if this aligns with other modules.

Please manually verify:

  • Are there existing components listening for dark-mode-changed (e.g., via addEventListener("dark-mode-changed", …))?
  • If so, add the corresponding addEventListener("color-blind-mode-changed", …) in that same layer.
  • If not, double-check whether we need a new listener implementation or if a different integration approach is preferred.
src/client/graphics/layers/SettingsModal.ts (2)

135-139: LGTM: toggler wires to settings and redraw.

Matches dark mode flow and emits RedrawGraphicsEvent.


272-299: Color Blind Mode text logic verified

  • Dark mode settings at lines 260–262 and 266–268 correctly use darkMode() and the dark/light translation keys.
  • Color Blind Mode block at lines 288–290 was the only place coupling colorBlindMode to darkMode(); no other mix-ups remain.
  • The proposed diff safely swaps darkMode() for colorBlindMode() and updates the disabled key to user_setting.color_blind_mode_disabled.

You can go ahead and apply the patch.

src/core/configuration/Config.ts (1)

194-200: All Theme implementations include new color-blind methods

I’ve run the check across both PastelTheme.ts and PastelThemeDark.ts under src/core/configuration/ and confirmed that each class defines:

  • colorBlindSelfColor()
  • colorBlindAllyColor()
  • colorBlindNeutralColor()
  • colorBlindEnemyColor()
  • colorBlindSpawnHighlightColor()

No missing methods were found. Everything looks ready to merge.

src/core/configuration/PastelThemeDark.ts (1)

182-194: Getters wired correctly.

All five color-blind accessors return the intended constants; matches Theme.

Also applies to: 199-201

src/core/configuration/PastelTheme.ts (3)

33-35: Self/ally color swap — confirm intent and cross-theme consistency.

PastelTheme now uses self=yellow and ally=green, while PastelThemeDark keeps self=green and ally=yellow. Is this divergence intentional? If not, align both themes to the same semantics.


38-45: Color-blind palette added — good coverage.

Distinct hues for self/ally/enemy/neutral/spawn highlight. Mirrors dark theme structure.


186-197: Getters match Theme and constants.

No further action.

Also applies to: 203-205

Comment thread resources/lang/en.json
Comment on lines +274 to +275
"color_blind_mode_label": "Color Blind Mode",
"color_blind_mode_desc": "Give colors better contrast.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add missing “enabled/disabled” strings for Color Blind Mode (used in SettingsModal).

Without these, the UI will show raw keys or fallback text.

Apply this diff:

     "dark_mode_desc": "Toggle the site’s appearance between light and dark themes",
-    "color_blind_mode_label": "Color Blind Mode",
-    "color_blind_mode_desc": "Give colors better contrast.",
+    "color_blind_mode_label": "Color Blind Mode",
+    "color_blind_mode_desc": "Give colors better contrast.",
+    "color_blind_mode_enabled": "Color Blind Mode enabled",
+    "color_blind_mode_disabled": "Color Blind Mode disabled",
     "dark_mode_enabled": "Dark mode enabled",
     "light_mode_enabled": "Light mode enabled",

Run to confirm no missing translation keys:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -nP 'translateText\("user_setting\.color_blind_mode_(enabled|disabled)"\)' -S
rg -n 'color_blind_mode_(enabled|disabled)' resources/lang/en.json -S

Length of output: 299


Add missing translation keys for Color Blind Mode
The SettingsModal references user_setting.color_blind_mode_enabled and user_setting.color_blind_mode_disabled, but these keys aren’t defined in resources/lang/en.json. Without them, the UI will show raw keys instead of user-friendly text.

• File needing updates:

  • resources/lang/en.json (after line with "color_blind_mode_desc")

Apply this diff:

     "dark_mode_desc": "Toggle the site’s appearance between light and dark themes",
     "color_blind_mode_label": "Color Blind Mode",
     "color_blind_mode_desc": "Give colors better contrast.",
+    "color_blind_mode_enabled": "Color Blind Mode enabled",
+    "color_blind_mode_disabled": "Color Blind Mode disabled",
     "dark_mode_enabled": "Dark mode enabled",
     "light_mode_enabled": "Light mode enabled",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"color_blind_mode_label": "Color Blind Mode",
"color_blind_mode_desc": "Give colors better contrast.",
"color_blind_mode_label": "Color Blind Mode",
"color_blind_mode_desc": "Give colors better contrast.",
"color_blind_mode_enabled": "Color Blind Mode enabled",
"color_blind_mode_disabled": "Color Blind Mode disabled",
🤖 Prompt for AI Agents
In resources/lang/en.json around lines 274-275, add the missing translation keys
referenced by SettingsModal: define "user_setting.color_blind_mode_enabled" and
"user_setting.color_blind_mode_disabled" immediately after
"color_blind_mode_desc" with user-friendly strings (e.g., "Color blind mode
enabled" and "Color blind mode disabled") so the UI shows readable text instead
of raw keys.

Comment on lines +180 to +201
const isColorBlind = this.userSettings.colorBlindMode();
const myPlayer = this.game.myPlayer();
if (
myPlayer !== null &&
myPlayer !== human &&
myPlayer.isFriendly(human)
) {
color = this.theme.selfColor();
let color;

if (!myPlayer) {
color = isColorBlind
? this.theme.colorBlindSpawnHighlightColor()
: this.theme.spawnHighlightColor();
} else if (myPlayer === human) {
color = isColorBlind
? this.theme.colorBlindSelfColor()
: this.theme.selfColor();
} else if (myPlayer.isFriendly(human)) {
color = isColorBlind
? this.theme.colorBlindAllyColor()
: this.theme.allyColor();
} else {
color = isColorBlind
? this.theme.colorBlindEnemyColor()
: this.theme.enemyColor();
}
console.log(human.name(), human === myPlayer, color.toRgbString().replace(/[^\d,]/g, ""));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Check for stray console logs across the client.

Keep builds clean and avoid leaking player names in logs.


🏁 Script executed:

#!/bin/bash
# Fail if console.log remains under src/
rg -n --type ts,tsx 'console\.log\(' src || true

Length of output: 80


To accurately catch any remaining console.log calls in your TypeScript files, let’s rerun the search using glob patterns instead of the incorrect --type flag:


🏁 Script executed:

#!/bin/bash
# Search for stray console.log in .ts and .tsx under src/
rg -n 'console\.log\(' --glob '*.ts' --glob '*.tsx' src || true

Length of output: 10123


Remove all stray console.log calls before merge

We ran a grep across the repo and found dozens of remaining console.log calls in both client and server code (including TerritoryLayer.ts line 201). These leak internal state (like player names) and clutter production builds.

Please remove or replace them with our typed, composable logger API (e.g. inject a Logger instance and call logger.debug(…) with a LogLevel union), for example:

• src/client/graphics/layers/TerritoryLayer.ts:201
• All other console.log calls under src/client/**
• All console.log calls under src/server/**

— Ensure no raw console.log remains.
— Use dependency-injected loggers and our LogLevel union instead of directly calling the console.


⚠️ Potential issue

Spawn highlight misclassifies neutrals as enemies; type color and remove debug log.

When myPlayer exists and target is neither friendly nor embargoed, it should be neutral, not enemy. Also type the color variable and drop the console.log.

Apply:

-      const isColorBlind = this.userSettings.colorBlindMode();
-      const myPlayer = this.game.myPlayer();
-      let color;
+      const isColorBlind = this.userSettings.colorBlindMode();
+      const myPlayer = this.game.myPlayer();
+      let color: Colord;

-      if (!myPlayer) {
+      if (!myPlayer) {
         color = isColorBlind
           ? this.theme.colorBlindSpawnHighlightColor()
           : this.theme.spawnHighlightColor();
-      } else if (myPlayer === human) {
+      } else if (human.smallID() === myPlayer.smallID()) {
         color = isColorBlind
           ? this.theme.colorBlindSelfColor()
           : this.theme.selfColor();
       } else if (myPlayer.isFriendly(human)) {
         color = isColorBlind
           ? this.theme.colorBlindAllyColor()
           : this.theme.allyColor();
-      } else {
+      } else if (!human.hasEmbargo(myPlayer)) {
+        color = isColorBlind
+          ? this.theme.colorBlindNeutralColor()
+          : this.theme.neutralColor();
+      } else {
         color = isColorBlind
           ? this.theme.colorBlindEnemyColor()
           : this.theme.enemyColor();
       }
-      console.log(human.name(), human === myPlayer, color.toRgbString().replace(/[^\d,]/g, ""));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const isColorBlind = this.userSettings.colorBlindMode();
const myPlayer = this.game.myPlayer();
if (
myPlayer !== null &&
myPlayer !== human &&
myPlayer.isFriendly(human)
) {
color = this.theme.selfColor();
let color;
if (!myPlayer) {
color = isColorBlind
? this.theme.colorBlindSpawnHighlightColor()
: this.theme.spawnHighlightColor();
} else if (myPlayer === human) {
color = isColorBlind
? this.theme.colorBlindSelfColor()
: this.theme.selfColor();
} else if (myPlayer.isFriendly(human)) {
color = isColorBlind
? this.theme.colorBlindAllyColor()
: this.theme.allyColor();
} else {
color = isColorBlind
? this.theme.colorBlindEnemyColor()
: this.theme.enemyColor();
}
console.log(human.name(), human === myPlayer, color.toRgbString().replace(/[^\d,]/g, ""));
const isColorBlind = this.userSettings.colorBlindMode();
const myPlayer = this.game.myPlayer();
let color: Colord;
if (!myPlayer) {
color = isColorBlind
? this.theme.colorBlindSpawnHighlightColor()
: this.theme.spawnHighlightColor();
} else if (human.smallID() === myPlayer.smallID()) {
color = isColorBlind
? this.theme.colorBlindSelfColor()
: this.theme.selfColor();
} else if (myPlayer.isFriendly(human)) {
color = isColorBlind
? this.theme.colorBlindAllyColor()
: this.theme.allyColor();
} else if (!human.hasEmbargo(myPlayer)) {
color = isColorBlind
? this.theme.colorBlindNeutralColor()
: this.theme.neutralColor();
} else {
color = isColorBlind
? this.theme.colorBlindEnemyColor()
: this.theme.enemyColor();
}

@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Aug 27, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f9297e0 and b44af62.

📒 Files selected for processing (3)
  • resources/lang/en.json (1 hunks)
  • src/client/graphics/layers/SettingsModal.ts (3 hunks)
  • src/core/configuration/PastelThemeDark.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/client/graphics/layers/SettingsModal.ts
  • resources/lang/en.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/Colors.ts:114-330
Timestamp: 2025-06-06T15:36:31.739Z
Learning: In the OpenFrontIO project, color improvements are implemented incrementally. The current focus for player colors is ensuring sufficient unique color availability rather than optimizing for visual distinction or accessibility features.
📚 Learning: 2025-06-10T09:56:44.473Z
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/PastelThemeDark.ts:53-53
Timestamp: 2025-06-10T09:56:44.473Z
Learning: In ColorAllocator class in src/core/configuration/Colors.ts, the correct method names are assignColor(id: string): Colord for general color assignment and assignTeamColor(team: Team): Colord for team-specific colors. There are no assignPlayerColor() or assignBotColor() methods.

Applied to files:

  • src/core/configuration/PastelThemeDark.ts
📚 Learning: 2025-06-06T15:42:21.903Z
Learnt from: Ble4Ch
PR: openfrontio/OpenFrontIO#1063
File: src/core/configuration/PastelThemeDark.ts:20-21
Timestamp: 2025-06-06T15:42:21.903Z
Learning: In ColorAllocator class, all methods (assignBotColor, assignPlayerColor, assignTeamColor) use the constructor colors from this.availableColors. Only the predefined team cases in assignTeamColor use hardcoded global colors, while the default case uses constructor colors.

Applied to files:

  • src/core/configuration/PastelThemeDark.ts
🔇 Additional comments (4)
src/core/configuration/PastelThemeDark.ts (4)

182-194: CB accessors for self/ally/neutral/enemy look correct.

Return types and symmetry match Theme expectations.


199-201: CB spawn highlight accessor: LGTM.

Matches the new private constant and keeps API consistent.


51-55: assignTeamPlayerColor API Verified

The ColorAllocator class defines the assignTeamPlayerColor(team: Team, playerId: string): Colord method, and it’s correctly used in PastelThemeDark.ts without any compile issues. No changes needed here.


33-34: Color swap UX strings verified

I’ve checked translation files and test code for any leftover references to yellow = ally or green = you and found none:

  • Scanned all resources/lang/*.json: only generic color-name entries ("green", "yellow"), no “you…green” or “ally…yellow” labels.
  • Searched test directory for green/yellow: no occurrences tying colors to “you” or “ally.”

No stale UI copy or tests need updating—this swap is safe to merge.

Comment on lines +38 to 45
private readonly _colorBlindSelfColor = colord({ r: 255, g: 200, b: 0 });
private readonly _colorBlindAllyColor = colord({ r: 0, g: 180, b: 255 });
private readonly _colorBlindNeutralColor = colord({ r: 160, g: 160, b: 160 });
private readonly _colorBlindEnemyColor = colord({ r: 230, g: 0, b: 255 });

private readonly _spawnHighlightColor = colord({ r: 255, g: 213, b: 79 });
private readonly _colorBlindSpawnHighlightColor = colord({ r: 255, g: 255, b: 120 });
/* eslint-enable sort-keys */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Color‑blind palette: good choices; validate contrast on common tiles.

Cyan/magenta/orange reduce R/G confusion. Please sanity‑check contrast for the spawn highlight vs water, plains, mountain, and shore so the outline pops.

If you want less duplication between themes, consider exposing a single palette with typed keys:

// in Theme (optional, non-breaking addition)
type Role = 'self' | 'ally' | 'neutral' | 'enemy' | 'spawnHighlight';
colorBlindPalette(): Readonly<Record<Role, Colord>>;

🏁 Script executed:

#!/bin/bash
python - <<'PY'
def srgb_to_lin(c): c/=255; return c/12.92 if c<=0.03928 else ((c+0.055)/1.055)**2.4
def luminance(rgb):
  r,g,b = [srgb_to_lin(x) for x in rgb]; return 0.2126*r+0.7152*g+0.0722*b
def contrast(a,b):
  L1,L2 = sorted([luminance(a), luminance(b)], reverse=True); return (L1+0.05)/(L2+0.05)

spawn = (255,213,79)
spawn_cb = (255,255,120)

backgrounds = {
  "water": (14,11,30),
  "shorelineWater": (50,50,50),
  "plains": (140,170,88),
  "mountain": (180,180,180),
  "shore": (134,133,88),
}

print("WCAG contrast (approx):")
for name,bg in backgrounds.items():
  print(f"{name:15} spawn={contrast(spawn,bg):.2f}  spawn_CB={contrast(spawn_cb,bg):.2f}")
PY

Length of output: 247


Ensure spawn highlight meets 3:1 contrast on all tile types

Our WCAG contrast check shows that the current spawn-highlight colors fall below the 3:1 minimum on several common backgrounds in PastelThemeDark.ts (lines 38–45):

  • plains: default 1.86, color-blind 2.48
  • mountain: default 1.47, color-blind 1.96
  • shore: default 2.70 (fails), color-blind 3.60 (only this passes)
  • water: default 13.71, color-blind 18.27 (both pass)
  • shorelineWater: default 9.09, color-blind 12.11 (both pass)

Please update the _spawnHighlightColor and _colorBlindSpawnHighlightColor definitions to achieve at least 3:1 contrast against all backgrounds (especially plains and mountain). For example, you might:

  • Darken the RGB values to increase luminance difference
  • Use colord’s darken() or mix() methods to tune contrast
  • Re-run the WCAG script after each tweak to confirm ratios

Pinpointed location:

  • File: src/core/configuration/PastelThemeDark.ts
  • Lines: 38–45
🤖 Prompt for AI Agents
In src/core/configuration/PastelThemeDark.ts around lines 38 to 45, the current
_spawnHighlightColor and _colorBlindSpawnHighlightColor fail WCAG 3:1 contrast
on several backgrounds (notably plains and mountain); update those two color
definitions so their contrast ratio is >= 3:1 against all theme backgrounds by
darkening or mixing them (e.g., lower RGB values or apply
colord(...).darken(amount) or colord(...).mix(colord('black'), ratio) until the
computed contrast meets 3:1 for plains, mountain, shore, water, and
shorelineWater), re-run the WCAG contrast checker script after each tweak to
confirm ratios, and commit the adjusted color values once all background checks
pass.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is stale because it has been open for 14 days with no activity. If you want to keep this pull request open, add a comment or update the branch.

@github-actions github-actions Bot added the Stale PRs that haven't been touched for over two weeks. label Oct 11, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been closed because twenty-eight days have passed without activity. If someone wants to keep working on it, feel free to take the code.

@github-actions github-actions Bot closed this Oct 25, 2025
@github-project-automation github-project-automation Bot moved this from Development to Complete in OpenFront Release Management Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale PRs that haven't been touched for over two weeks.

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.