From 5d9c07eb3a6bdede158724c9521ae66ee6128976 Mon Sep 17 00:00:00 2001
From: tresabhi <43380238+tresabhi@users.noreply.github.com>
Date: Fri, 27 Nov 2026 14:57:39 -0600
Subject: [PATCH] migrate tier list
---
CLAUDE.md | 68 ++++++
packages/core/src/blitzkit/api/cache.ts | 2 +-
packages/core/src/blitzkit/index.ts | 2 +-
.../{metaSortTank.ts => metaSortTanks.ts} | 2 +-
packages/i18n/strings/en.json | 14 ++
.../components/AlertDialog/index.module.css | 7 -
.../src/components/AlertDialog/index.tsx | 19 +-
.../src/components/CompareControls/index.tsx | 5 +-
.../CompareInsertionMarker/constants.ts | 4 -
.../CompareInsertionMarker/index.module.css | 14 --
.../CompareInsertionMarker/index.tsx | 24 --
.../src/components/CompareTable/index.tsx | 93 ++++---
.../src/components/CompareTankCard/index.tsx | 62 +++--
.../src/components/CompareURLManager.astro | 42 ++++
.../src/components/Dialog/index.module.css | 11 -
.../website/src/components/Dialog/index.tsx | 24 +-
.../components/DialogActions/index.module.css | 7 +
.../src/components/DialogActions/index.tsx | 8 +
.../DialogBody/index.module.css} | 3 +-
.../src/components/DialogBody/index.tsx | 8 +
.../components/DialogField/index.module.css | 5 +
.../src/components/DialogField/index.tsx | 24 ++
.../components/DialogHeader/index.module.css | 5 +
.../src/components/DialogHeader/index.tsx | 8 +
.../components/Embeds/GenerateURL/index.tsx | 13 +-
.../Embeds/PreviewWrapper/index.tsx | 2 +-
.../src/components/Embeds/breakdown.tsx | 2 +-
.../src/components/HomeCosmetics.astro | 2 +-
.../website/src/components/HomeGames.astro | 2 +-
.../website/src/components/HomePlayers.astro | 2 +-
.../website/src/components/HomeTanks.astro | 2 +-
.../src/components/HomeTechnical.astro | 2 +-
.../InsertionMarker/index.module.css | 24 ++
.../src/components/InsertionMarker/index.tsx | 15 ++
.../website/src/components/NavbarFine.astro | 2 +-
.../src/components/Popover/index.module.css | 1 +
.../website/src/components/Popover/index.tsx | 14 +-
.../src/components/ScreenshotButton/index.tsx | 5 +-
.../website/src/components/Table/index.tsx | 6 +-
.../components/TankSearchResults/index.tsx | 4 +-
.../components/TankSandbox/Title/index.tsx | 2 +-
.../TankopediaSkinSwitcher/index.tsx | 2 +-
.../src/components/TanksEmbed/index.tsx | 2 +-
.../TierList/Controls/components/Share.tsx | 22 --
.../components/TierList/Controls/index.tsx | 27 ---
.../TierList/Row/components/Header.tsx | 113 ---------
.../src/components/TierList/Row/index.tsx | 53 ----
.../components/TierList/Table/constants.ts | 17 --
.../src/components/TierList/Table/index.tsx | 15 --
.../website/src/components/TierList/Tile.tsx | 211 ----------------
.../website/src/components/TierList/Tiles.tsx | 58 -----
.../src/components/TierList/URLManager.tsx | 34 ---
.../TierListControls/index.module.css | 5 +
.../src/components/TierListControls/index.tsx | 34 +++
.../components/TierListRow/index.module.css | 3 +
.../src/components/TierListRow/index.tsx | 27 +++
.../TierListRowHeader/index.module.css | 35 +++
.../components/TierListRowHeader/index.tsx | 139 +++++++++++
.../components/TierListTable/index.module.css | 17 ++
.../src/components/TierListTable/index.tsx | 51 ++++
.../components/TierListTile/index.module.css | 11 +
.../src/components/TierListTile/index.tsx | 227 ++++++++++++++++++
.../src/components/TierListTiles/index.tsx | 58 +++++
.../src/components/TierListURLManager.astro | 44 ++++
.../website/src/components/ToolBanner.astro | 2 +-
.../website/src/components/ToolCard.astro | 2 +-
.../src/components/ToolOpenGraph.astro | 2 +-
packages/website/src/config/compare.ts | 4 +
.../src/{constants => config}/dialog.ts | 0
.../src/{constants => config}/embeds.ts | 0
.../src/{constants => config}/navbar.ts | 0
.../src/{constants => config}/skinNumber.ts | 0
packages/website/src/config/tierList.ts | 41 ++++
.../src/{constants => config}/tools.ts | 5 +-
.../core/blitzkit/generateTierListParams.ts | 11 -
.../src/core/blitzkit/showInsertionMarker.ts | 24 ++
packages/website/src/layouts/BaseLayout.astro | 2 +-
packages/website/src/pages/404.astro | 2 +-
.../tools/[tool]/banners/[size].webp.ts | 2 +-
.../[...locale]/auth/[provider]/_index.astro | 2 +-
.../[...locale]/avatars/_index.astro | 2 +-
.../[...locale]/compare/_index.tsx | 86 -------
.../[...locale]/compare/index.astro | 26 +-
.../[...locale]/components.astro | 2 +-
.../[...locale]/credits/_index.astro | 2 +-
.../docs/[directory]/[document]/_index.astro | 2 +-
.../[...locale]/docs/patches/_index.astro | 2 +-
.../[...locale]/embed/[embed]/_index.tsx | 2 +-
.../[...locale]/embed/[embed]/host/_index.tsx | 2 +-
.../[...locale]/embed/[embed]/index.astro | 4 +-
.../[...locale]/embed/_index.tsx | 2 +-
.../[...locale]/embed/index.astro | 2 +-
.../[...locale]/guesser/index.astro | 2 +-
.../[...locale]/index.astro | 2 +-
.../[...locale]/mixer/index.astro | 2 +-
.../[...locale]/performance/index.astro | 2 +-
.../[...locale]/playlist/_index.astro | 2 +-
.../[...locale]/session/_index.astro | 2 +-
.../[...locale]/tanks/[slug]/index.astro | 2 +-
.../[...locale]/tanks/index.astro | 2 +-
.../[...locale]/tier-list/_index.astro | 13 -
.../[...locale]/tier-list/_index.tsx | 30 ---
.../[...locale]/tier-list/index.astro | 45 ++++
.../tools/embed/[embed]/index.astro | 2 +-
.../[id]/skins/[skin].glb.ts | 2 +-
.../website/src/stores/compareEphemeral.ts | 14 +-
.../src/stores/embedState/utilities.ts | 2 +-
packages/website/src/stores/tierList.ts | 37 ++-
108 files changed, 1238 insertions(+), 922 deletions(-)
create mode 100644 CLAUDE.md
rename packages/core/src/blitzkit/{metaSortTank.ts => metaSortTanks.ts} (95%)
delete mode 100644 packages/website/src/components/CompareInsertionMarker/constants.ts
delete mode 100644 packages/website/src/components/CompareInsertionMarker/index.module.css
delete mode 100644 packages/website/src/components/CompareInsertionMarker/index.tsx
create mode 100644 packages/website/src/components/CompareURLManager.astro
create mode 100644 packages/website/src/components/DialogActions/index.module.css
create mode 100644 packages/website/src/components/DialogActions/index.tsx
rename packages/website/src/{pages/[...chunk_default]/[...locale]/compare/_index.module.css => components/DialogBody/index.module.css} (69%)
create mode 100644 packages/website/src/components/DialogBody/index.tsx
create mode 100644 packages/website/src/components/DialogField/index.module.css
create mode 100644 packages/website/src/components/DialogField/index.tsx
create mode 100644 packages/website/src/components/DialogHeader/index.module.css
create mode 100644 packages/website/src/components/DialogHeader/index.tsx
create mode 100644 packages/website/src/components/InsertionMarker/index.module.css
create mode 100644 packages/website/src/components/InsertionMarker/index.tsx
delete mode 100644 packages/website/src/components/TierList/Controls/components/Share.tsx
delete mode 100644 packages/website/src/components/TierList/Controls/index.tsx
delete mode 100644 packages/website/src/components/TierList/Row/components/Header.tsx
delete mode 100644 packages/website/src/components/TierList/Row/index.tsx
delete mode 100644 packages/website/src/components/TierList/Table/constants.ts
delete mode 100644 packages/website/src/components/TierList/Table/index.tsx
delete mode 100644 packages/website/src/components/TierList/Tile.tsx
delete mode 100644 packages/website/src/components/TierList/Tiles.tsx
delete mode 100644 packages/website/src/components/TierList/URLManager.tsx
create mode 100644 packages/website/src/components/TierListControls/index.module.css
create mode 100644 packages/website/src/components/TierListControls/index.tsx
create mode 100644 packages/website/src/components/TierListRow/index.module.css
create mode 100644 packages/website/src/components/TierListRow/index.tsx
create mode 100644 packages/website/src/components/TierListRowHeader/index.module.css
create mode 100644 packages/website/src/components/TierListRowHeader/index.tsx
create mode 100644 packages/website/src/components/TierListTable/index.module.css
create mode 100644 packages/website/src/components/TierListTable/index.tsx
create mode 100644 packages/website/src/components/TierListTile/index.module.css
create mode 100644 packages/website/src/components/TierListTile/index.tsx
create mode 100644 packages/website/src/components/TierListTiles/index.tsx
create mode 100644 packages/website/src/components/TierListURLManager.astro
create mode 100644 packages/website/src/config/compare.ts
rename packages/website/src/{constants => config}/dialog.ts (100%)
rename packages/website/src/{constants => config}/embeds.ts (100%)
rename packages/website/src/{constants => config}/navbar.ts (100%)
rename packages/website/src/{constants => config}/skinNumber.ts (100%)
create mode 100644 packages/website/src/config/tierList.ts
rename packages/website/src/{constants => config}/tools.ts (95%)
delete mode 100644 packages/website/src/core/blitzkit/generateTierListParams.ts
create mode 100644 packages/website/src/core/blitzkit/showInsertionMarker.ts
delete mode 100644 packages/website/src/pages/[...chunk_default]/[...locale]/compare/_index.tsx
delete mode 100644 packages/website/src/pages/[...chunk_default]/[...locale]/tier-list/_index.astro
delete mode 100644 packages/website/src/pages/[...chunk_default]/[...locale]/tier-list/_index.tsx
create mode 100644 packages/website/src/pages/[...chunk_default]/[...locale]/tier-list/index.astro
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 000000000..2d1f10048
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,68 @@
+# BlitzKit
+
+## Git
+
+- Never commit or push.
+- Never stage (`git add`, `git mv`, ...) unless the maintainer asks for it. The one exception is deletions: deleted files may always be staged (`git rm`, `git add` on a removed path).
+- Move files with plain `mv`, not `git mv`.
+
+## Migration
+
+The `data-driven` branch is migrating off the old system (Radix Themes, the `Duel` store, `PageWrapper`, ...) onto the new components and stores (`Tankopedia`, `Soapstone` stores, `components/Button`, ...). Leftover references to the old system are expected bugs: when something is undefined or a module is missing, look for its replacement in neighboring migrated code rather than restoring the old one.
+
+Pages that are not migrated yet are named `_index.astro` so Astro skips them. Migrating one renames it to `index.astro`.
+
+## Layout
+
+- Components live flat at `src/components/Name/index.tsx` with `index.module.css` beside it. No flat `Name.tsx` files and no nested `components/Parent/components/Child` folders: a sub-component becomes its own top-level folder prefixed with its feature, e.g. `MixerScene/components/Model.tsx` becomes `components/MixerModel/index.tsx`.
+- Pages keep their styles in `_index.module.css` next to `_index.tsx`.
+
+## TypeScript
+
+- No return type annotations. Put `satisfies Type` on the returned expression instead.
+- Wrap functions defined inside React components in `useCallback`.
+- Never inline a complex type (a union of object shapes, etc.) in a signature; name it as an interface or type.
+- In object literals, `...spread` entries come first, each on its own line, followed by a blank line, then the custom entries. A single-line object with a spread becomes multi-line.
+- When an object literal's values are long expressions, compute them first into `const`s named after their keys, then build the object with shorthand (`{ name, color, tanks: [] }`). Short values stay inline.
+- Always hoist values that take work to compute (a function call, math, a lookup, like `"A".charCodeAt(0)` or `1 - SCROLL_ZONE`) and don't change between iterations or calls out of loops and repeatedly called functions into a `const` above them. No exceptions. Plain literals (strings, numbers, selectors like `"[data-row]"`) cost nothing and stay inline.
+- A helper function used in only one place gets inlined there. Only extract a function once it has a second caller.
+- Assert data that is known to be present with `!` instead of `?.` or `?? 0`; crashing beats silently showing a plausible wrong value. Keep `?.` only where absence is real logic: `optional` proto fields (check the `.proto`), optional script effect fields, and lookups that can legitimately miss.
+- Single-line comments use `//`, never `/** */`. Keep `/** */` for multi-line doc comments.
+
+## JSX
+
+- An icon and its text go on separate lines, never ` {label}` on one line. Spacing comes from the parent's flex `gap`, not a literal space:
+
+ ```tsx
+
+ {label}
+ ```
+
+- In menu-like items (ContextMenu, DropdownMenu, Select and similar), the icon goes after the text. `ItemIndicator` stays in the left gutter.
+- Don't add `aria-label` (or replacements like `aria-labelledby`) for now.
+
+## CSS
+
+- Constant CSS goes in the CSS module, never in `style={{ }}`. Only runtime values (measured sizes, user settings) go inline; split an element's constant and dynamic styles between the two. Presentational props like `width="1em"` on icons are CSS too.
+- Toggle state and variants with data attributes (`data-split={bool}` with `.x[data-split="true"]`), never conditional modifier classes.
+- CSS module classes are kebab-case, accessed as `styles["tank-image"]`. PascalCase is only for Radix part names in composed components.
+- Containers own the padding and space their children with a flex `gap`. Children like `Header`, `Body` and `Actions` don't carry padding to fake spacing; fix the container instead.
+- Select elements by their own class, never by structure or tag (`> *`, `> div`, `:first-child`, bare `svg`, `[data-x] > *`). If an element needs styling, give it a class and nest that class under its parent. The exception is content a component renders internally that has no `className` to pass, like the icon inside an `IconButton` (`.swatch svg`).
+- Nest CSS to mirror the markup: a child's rules go inside its parent's block (`.marker { .bar { } }`), so the stylesheet reads like the HTML tree.
+- Fully rounded corners use `var(--radius-max)`, never `var(--max-size)`.
+- `z-index` stays at `1` unless a real overlap needs more.
+
+## Components
+
+- Dialog-like surfaces (`Dialog`, `AlertDialog`, `Popover`) share their extra parts, which live as their own top-level components: `DialogHeader`, `DialogBody`, `DialogActions` and `DialogField` (a labeled control, taking a `label` prop). Each surface attaches them as `X.Header`, `X.Body`, `X.Actions` and `X.Field`; none defines its own copy. Fix their spacing in the part's own CSS module.
+- Other extra non-Radix parts of a composed component are local functions in that component's `index.tsx`, `function Name({ className, ...props }: ComponentProps<"div">)` using `classNames(styles["kebab-class"], className)`, spread in with `{ ...composeRadixComponents(_, styles), Name }`. Once a part is shared by several components, it moves out into its own top-level component instead, like the `Dialog*` parts. A part shared across menus (`Discriminator` in DropdownMenu) is styled through a data attribute, since CSS modules re-hash classes per importing file.
+
+## Strings and naming
+
+- Only edit `packages/i18n/strings/en.json`. Other locales are managed by Crowdin; never touch them, even for key renames.
+- Name strings and keys after what the game UI calls things (its English strings), not code or XML names. Tier 11 upgrade progression is "augments" everywhere in BlitzKit; "upgrade" stays only where it names a game file, folder or XML tag, and for the modules panel.
+- Characteristic group keys follow the UI title (`nitro`, `combat_stabilization`), and item keys are prefixed with their group key (`steady_aim_system_duration`). Item labels stay short and drop what the group title already says.
+
+## Endpoints
+
+- The site is built statically, so Astro endpoint handlers return `new Response(body)` with no `headers`. The file extension decides the type.
diff --git a/packages/core/src/blitzkit/api/cache.ts b/packages/core/src/blitzkit/api/cache.ts
index 2ac5bcf98..ddf88ffad 100644
--- a/packages/core/src/blitzkit/api/cache.ts
+++ b/packages/core/src/blitzkit/api/cache.ts
@@ -2,7 +2,7 @@ export function Cache(disableInDev = false) {
const cache = new WeakMap