Skip to content

Esperanto Alphabetization fix - #82

Merged
Perlkonig merged 4 commits into
AbstractPlay:developfrom
samtcifihi:claude/compassionate-archimedes-c5z0cd
Sep 20, 2026
Merged

Perlkonig merged 4 commits into
AbstractPlay:developfrom
samtcifihi:claude/compassionate-archimedes-c5z0cd

Conversation

@samtcifihi

Copy link
Copy Markdown
Contributor

Also updated to sort numeric: true, which lets stuff alphabetize as 3, 20, 131 instead of 131, 20, 3.

The games table and the other name-bearing tables let TanStack Table pick
the sorting function for their string columns. Its built-in `text` and
`alphanumeric` comparators compare with `>` / `<`, i.e. by UTF-16 code
unit, so the Esperanto hat letters (U+0108 and friends) sorted after `z`
instead of after their base letters: the whole Ĉ/Ĝ/Ŝ block landed past
Zola at the bottom of the list.

`compareStrings` and its `Intl.Collator` were already correct — ICU has a
real `eo` tailoring — but nothing on these columns ever reached it. The
pre-sort in MetaContainer did use it and was then discarded by the
table's own sorted row model.

Add `stringColumnSortingFn(locale)` next to `compareStrings` and wire it
into every game-name and player-name column, matching the existing
inline `sortingFn`s that already call `compareStrings`. Where a column
memo did not already depend on `i18n.language`, add it so the comparator
does not keep a stale locale after a language switch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FTzbDm2gyDKiek71vA3wE
Two loose ends from the previous commit.

The designers columns in the meta-game table and the explore view hold
people's names and had the same code-unit sort as the game-name columns,
so a designer whose name carries a hat letter or any other non-ASCII
character sorted past Z. Their accessors already return a joined string,
so they take the same `stringColumnSortingFn`.

MetaContainer's alphabetized meta-game list memoized on `i18n.language`
alone. The Esperanto bundles arrive over HTTP after the language tag is
already set, so the list was sorted while `getGameDisplayName` still
returned English names and never re-sorted once the real names landed.
Depend on `getUiLocaleBundleKey` as well, matching how the other
translated-label memos in the codebase are keyed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FTzbDm2gyDKiek71vA3wE
Adding `sortingFn` to the name columns moved them off TanStack's built-in
`alphanumeric` comparator, which does natural number sorting, onto an
`Intl.Collator` constructed with the default `numeric: false`. Nothing
regressed in the current data — the only digit-bearing game names are
"C1" and "Kunligu 6" — but "Connect 10" would have sorted before
"Connect 2" the moment such a name was added.

Set `numeric: true` so digit runs compare by value. Verified against the
real corpora in all six UI locales: game names, category tag and full
labels, and display names are byte-identical before and after. Variant
labels and variant groups do change, and change for the better — board
sizes now read 8×8, 9×9, 13×13 instead of 13×13, 8×8, 9×9, and piece
counts 2, 4, 6, 12 instead of 12, 2, 4, 6.

This collator backs every `compareStrings` caller, so the change reaches
the variant and challenge pickers too. Every call site is a display sort
or a table `sortingFn`; the four places that build an identity key from
sorted variants use a bare `.sort()` and are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FTzbDm2gyDKiek71vA3wE
Brings the branch up to AbstractPlay/front develop (51c5911) ahead of a
pull request against it. Two textual conflicts, both trivial:

- src/components/Ratings.js: upstream hoisted columnHelper to module
  scope and trimmed the columns memo deps to [globalMe, t]; kept that
  shape and re-added i18n.language, which the new sortingFn reads.
- src/components/StandingChallenges.js: upstream and this branch each
  added an import on the same line; kept both.

The other six overlapping files auto-merged. Upstream's new sortingFn
in StandingChallenges.js belongs to its new matchWinRate column, not
to any column this branch touches.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FTzbDm2gyDKiek71vA3wE
@Perlkonig
Perlkonig merged commit f454dbf into AbstractPlay:develop Sep 20, 2026
1 check passed
@samtcifihi
samtcifihi deleted the claude/compassionate-archimedes-c5z0cd branch September 23, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants