Derive catch CP, add tests, restyle to the deck theme - #1
Merged
Conversation
Restyles the tool to the Observation Deck dark theme and restructures the code around a tested pure core. Bug fixes: - autoFillCP wrote to CP inputs that six of the eight event types never render. It threw and aborted its caller, which silently disabled the shiny auto-fill everywhere except Raid Hour and Raid Day. - The bulk parser split names on any hyphen, so "Ho-Oh Raid Hour" parsed as "Oh Raid Hour" -- wrong name, no artwork, no CP. - Community Day never matched its special-trade bonus, and "3x Catch Stardust" was missed because the pattern disallowed the word "Catch". - Base-stat lookups took the first API match, which is the regional variant for Articuno (Galarian) and Zacian (Crowned Sword). - A slow PokeAPI left the whole UI inert: every listener was registered after a blocking, timeout-less await. Catch CP is now derived from current base stats instead of stored, so it cannot go stale. pokemonCPData.js and the 21 wrong values it held are gone; all 161 names it covered still resolve, including form-qualified ones like "Deoxys Attack". cpOverrides.js remains as an escape hatch for values a human must judge, and is currently empty. PoGoAPI data is vendored into data/ and refreshed weekly by CI, so an outage there can no longer blank the CP and shiny lines out of a post. Also adds 57 unit tests on Node's built-in runner, an ARIA combobox with keyboard navigation for the autocomplete, inline validation messages in place of alert(), HTML escaping on generated output, and localStorage persistence for the bulk input and location settings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Deploy Preview for sundance-dgen ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restyles Sundance deGen to the Observation Deck dark theme and restructures the code around a tested pure core.
Bugs fixed
autoFillCPwrote to CP inputs that 6 of 8 event types never renderHo-Oh Raid Hourparsed asOh Raid Hour— wrong name, no artwork, no CP3x Catch Stardustpattern disallowed the word "Catch"awaitbefore any listener registeredCP is now derived, not stored
pokemonCPData.jsis deleted along with the 21 wrong values it held. Catch CP is computed from current base stats, so it cannot go stale.All 161 names the table covered still resolve, including form-qualified ones (
Deoxys Attack,Giratina (Origin),Marowak (Alolan)) which the API models as name + form and which previously had to be hardcoded.cpOverrides.jsremains as the escape hatch for values a human must judge — currently empty, becauseCATCHABLE_FORMSgeneralises the one case that seemed to need it (raids give Hero-form Zacian, not Crowned Sword).Reliability
PoGoAPI data is vendored into
data/and refreshed weekly by CI, so an outage there can no longer blank the CP and shiny lines out of a post. The live API is consulted only for Pokémon released since the last snapshot, and a status chip shows which source is answering.Also
npm test). Golden-output tests assert the exact description text captured before the refactor, so collapsing the two description builders into one is provably wording-neutral.alert(), reporting all problems at once rather than stopping at the first.localStoragepersistence for the bulk input and location settings.Verification
Tests pass; every flow was exercised in a browser — bulk and manual generation, keyboard autocomplete, persistence across reload, the snapshot→live fallback, and dark rendering with the OS set to light. All 32 foreground/surface colour pairs clear WCAG AA.
🤖 Generated with Claude Code