Bug: Perks displayed as "infinite 0", "capped 1" instead of human-readable text #145
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
In the Disciplines tab, unlocked perks are displayed as internal type strings like
"infinite 0","capped 1","once 0"instead of their human-readable descriptions.Root Cause
In
src/components/game/tabs/DisciplinesTab.tsxlines 100-113, theunlockedPerksarray is built by constructing strings like`${typ}-${idx}`wheretypis the raw enum value ('infinite'|'once'|'capped'). The render code at lines 141-154 only applies a cosmetic regex.replace(/-([0-9]+)$/, ' $1').The
DisciplinePerktype (src/lib/game/types/disciplines.tsline 23) already has adescription: stringfield with human-readable text (e.g."+50 Max Mana","Every 100 XP: +25 Max Mana"), but it is never used in the rendering.Fix Required
Change the
unlockedPerksbuilder at lines 100-113 to store the perk'sdescriptionfield instead of`${typ}-${idx}`. Update the render at lines 141-154 to display the description string directly.Affected Files
src/components/game/tabs/DisciplinesTab.tsx— lines 100-113 (unlockedPerks builder) and lines 141-154 (perk rendering)src/lib/game/types/disciplines.ts—DisciplinePerk.descriptionfield (already exists, just unused)Starting work on #145 — Perks show "infinite 0", "capped 1" instead of human-readable text. Will fix the unlockedPerks builder and rendering in DisciplinesTab.tsx.
Fixed #145 — Perks now show human-readable descriptions instead of "infinite 0", "capped 1".
Root cause: The
unlockedPerksarray was built from raw type strings (${typ}-${idx}) and the render only applied a cosmetic regex. TheDisciplinePerk.descriptionfield existed but was never used.Fix:
perkDescriptionstoDisciplineCardDefinitionand passed it from the parentunlockedPerksbuilder to storeperkDescriptions[idx]instead of${typ}-${idx}All 902 tests pass. Committed and pushed as
a6dd947.