Commit Graph
1 Commits
Author SHA1 Message Date
Josh HarrisandGitHub ebd22af95e perf: group owned cosmetic variants (#4671)
> **Before opening a PR:** discuss new features on
[Discord](https://discord.gg/K9zernJB5z) first, and file bugs or small
improvements as
[issues](https://github.com/openfrontio/OpenFrontIO/issues/new/choose).
You must be assigned to an `approved` issue — unsolicited PRs will be
auto-closed.

## Description:

The owned Cosmetics grid rendered every pattern/palette combination as
an independent tile. For accounts with large cosmetics entitlements this
generated more than 1,200 canvas-backed PNG previews and caused a
multi-second main-thread microtask storm.

This change groups owned palettes into one tile per pattern, matching
the existing Store UI. Palettes remain selectable through the existing
swatch row, and the player's currently selected palette remains the
tile's initial preview and selection.

Validation:
- `vitest run tests/client/CosmeticButton.test.ts
tests/ResolveCosmetics.test.ts` (28 tests)
- `npm run build-prod`

## Please complete the following:

- [ ] 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 (no new user-facing text)
- [x] I have added relevant tests to the test directory

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

jish
2026-07-22 12:47:07 -07:00