pf2e character creator: brief, readable overviews matching 5e

The pf2e creator showed long, truncated run-ons where 5e shows clean, brief
overviews: classes were cut mid-word at 400 chars, backgrounds rendered the raw
Foundry "<Name> Source Core Rulebook pg. N …" citation prefix, and ancestry
summaries ended in a stray ellipsis.

- new src/features/characters/builder/overview.ts: briefOverview() strips the
  Foundry citation prefix, drops a trailing ellipsis, and keeps the first clean
  sentence (or a word-boundary trim — never mid-word). A no-op on already-short
  text, so 5e is unchanged. Applied to pf2e class/ancestry/background overviews.
- dedupeByName(): the pf2e data carries reprints under duplicate names (94
  ancestries, 612 backgrounds) which duplicated options and triggered React
  duplicate-key warnings — now de-duplicated at load.
- 6 unit tests for both helpers.

Verified live: pf2e class cards now read as clean single sentences; no citation
junk; no duplicate-key warnings. Gate: 289 unit + 35 e2e + 2 realtime, build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 10:51:28 +02:00
parent ba5ae37111
commit f75b50adb8
4 changed files with 80 additions and 6 deletions
File diff suppressed because one or more lines are too long