Fix data-correctness bugs and remove dead/debug code - #17
Conversation
Fixes bugs surfaced by a full-codebase review: unguarded empty author_names arrays, unstable index-based React keys where stable slugs/ids were already available, sequential awaits for independent content loads, an empty search-param falling through pokemon page's name fallback and its swallowed TCGdex error, a missing geolocation timeout, a missing axios timeout on the pokemon fetch, and invalid text-shadow CSS shorthand. Also removes useOpen5eSpecies.ts (unused everywhere, and calling a v2 endpoint that 404s) and leftover debug console.log/commented-out JSX from the in-progress Profile character sheet component. Includes incidental Prettier reformatting of Footer.tsx and Pokémon.tsx, required by the pre-commit hook's whole-tree format check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Profile.tsx now builds a fully random level-1 character on load instead of a static template: race + class from dnd5eapi.co's SRD data (ability bonuses, saving throws, skill proficiency choices, hit die, starting equipment, spellcasting), and background from Open5e (58 backgrounds, filtered to the ~20 with parseable Personality/Ideal/Bond/Flaw tables for the flavor fields). All values are placed into the existing sheet inputs/textareas, no new UI elements. Removes useRandom5eSpecies.ts and Open5eRacesResponse.ts, unused now that race data comes from dnd5eapi.co instead of Open5e's species endpoint. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Greptile SummaryThis PR applies a set of targeted correctness fixes and removes confirmed-dead code across the codebase. The largest change is a substantial rewrite of
Confidence Score: 5/5Safe to merge — every changed path is either a well-scoped correctness fix, a cleanup of confirmed-dead code, or a Prettier reformat required by the pre-commit hook. All bug fixes are narrow and additive (null-coalescing guards, key stabilisation, Promise.all, timeout options, CSS shorthand correction). The Profile rewrite is the most complex change, but the dependency graph through useMemo is sound: each random pick is computed exactly once per data-load, all getRandomArrayIndex call sites are guarded against empty inputs, and passive perception now correctly accounts for Perception proficiency. No correctness issues were found across the 16 changed files. No files require special attention. Profile.tsx has the highest surface area but its logic holds up under scrutiny. Important Files Changed
Reviews (2): Last reviewed commit: "Fix character sheet review issues" | Re-trigger Greptile |
Summary
author_namesarrays, unstable index-based React keys where stable slugs/ids were already available, sequentialawaits for independent content loads, an empty search-param falling through the pokemon page's name fallback and its swallowed TCGdex error, a missing geolocation timeout, a missing axios timeout on the pokemon fetch, and invalidtext-shadowCSS shorthand.useOpen5eSpecies.ts(confirmed unused anywhere, and it calls av2Open5e endpoint that 404s) and leftover debugconsole.log/commented-out JSX from the in-progressProfilecharacter sheet component.Footer.tsxandPokémon.tsx, required by the pre-commit hook's whole-tree format check (pre-existing formatting drift, unrelated to the logic changes).Test plan
pnpm check:format/check:styles/check:lint/check:typesall pass (via pre-commit hook)vitest run— all existing tests passnext build --webpacksucceeds, all 15 routes generate (including/books/[book],/articles/[slug],/blog/[slug])🤖 Generated with Claude Code