Skip to content

Derive catch CP, add tests, restyle to the deck theme - #1

Merged
00xJS merged 1 commit into
masterfrom
refactor/derive-cp-tests-and-theme
Aug 2, 2026
Merged

Derive catch CP, add tests, restyle to the deck theme#1
00xJS merged 1 commit into
masterfrom
refactor/derive-cp-tests-and-theme

Conversation

@00xJS

@00xJS 00xJS commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Restyles Sundance deGen to the Observation Deck dark theme and restructures the code around a tested pure core.

Bugs fixed

Bug Effect
autoFillCP wrote to CP inputs that 6 of 8 event types never render Threw and aborted its caller, silently disabling shiny auto-fill everywhere except Raid Hour / Raid Day
Bulk parser split names on any hyphen Ho-Oh Raid Hour parsed as Oh Raid Hour — wrong name, no artwork, no CP
Community Day never matched its special-trade bonus Bonus silently dropped
3x Catch Stardust pattern disallowed the word "Catch" Bonus silently dropped
Base-stat lookups took the first API match Returned Galarian Articuno / Crowned Sword Zacian stats
Blocking, timeout-less await before any listener registered A slow PokéAPI left the entire UI inert

CP is now derived, not stored

pokemonCPData.js is 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.js remains as the escape hatch for values a human must judge — currently empty, because CATCHABLE_FORMS generalises 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

  • 57 unit tests on Node's built-in runner, no dependencies (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.
  • ARIA 1.2 combobox + full keyboard navigation on the autocomplete.
  • Inline validation notices replacing alert(), reporting all problems at once rather than stopping at the first.
  • HTML escaping on generated output.
  • localStorage persistence 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

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>
@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for sundance-dgen ready!

Name Link
🔨 Latest commit 864b730
🔍 Latest deploy log https://app.netlify.com/projects/sundance-dgen/deploys/6a6eb6601614c10008c580b7
😎 Deploy Preview https://deploy-preview-1--sundance-dgen.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@00xJS
00xJS merged commit ed3851c into master Aug 2, 2026
5 checks passed
@00xJS
00xJS deleted the refactor/derive-cp-tests-and-theme branch August 2, 2026 03:23
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.

1 participant