Skip to content

Conversation

@Mygod
Copy link
Collaborator

@Mygod Mygod commented Sep 23, 2025

No description provided.

@Mygod Mygod added the Enhancement New feature or request label Sep 23, 2025
@Mygod Mygod requested a review from Copilot September 24, 2025 04:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a shiny probability feature for Pokémon that displays estimated shiny rates based on historical encounter data from the server.

  • Extracts and refactors the readableProbability utility function for reuse across components
  • Adds GraphQL queries and resolvers to fetch shiny statistics from the database
  • Implements a shiny rate display in the Pokémon popup with tooltip showing detailed statistics

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/readableProbability.js Extracted probability formatting utility from PokestopPopup
src/features/pokestop/PokestopPopup.jsx Removed inline probability function and imported from utils
src/features/pokemon/PokemonPopup.jsx Added ShinyOdds component with data fetching logic
src/services/queries/pokemon.js Added GraphQL query for Pokemon shiny statistics
src/store/useMemory.js Added feature flag for shiny stats support
src/hooks/useMapData.js Added feature flag handling in map data loading
src/services/queries/available.js Added shiny stats support field to available query
server/src/models/Pokemon.js Added shiny statistics fetching and database methods
server/src/graphql/typeDefs/scanner.graphql Added PokemonShinyStats type definition
server/src/graphql/typeDefs/map.graphql Added supportsShinyStats field to MapData
server/src/graphql/typeDefs/index.graphql Added pokemonShinyStats query
server/src/graphql/resolvers.js Added resolver for shiny stats and feature detection
packages/locales/lib/human/en.json Updated localization strings for shiny rate display

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Mygod Mygod requested a review from Copilot September 24, 2025 04:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +84 to +85
const [shinyStats, setShinyStats] = React.useState(null)
const pendingShinyKey = React.useRef(null)
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The state management for shiny stats is complex with multiple useEffect hooks. Consider consolidating this logic into a custom hook like useShinyStats(pokemon.pokemon_id, pokemon.form) to improve readability and reusability.

Copilot uses AI. Check for mistakes.
@Mygod Mygod merged commit d44a3df into WatWowMap:develop Sep 24, 2025
2 checks passed
@Mygod Mygod deleted the pokemon-stats branch September 24, 2025 05:10
github-actions bot pushed a commit that referenced this pull request Sep 24, 2025
# [1.39.0-develop.7](v1.39.0-develop.6...v1.39.0-develop.7) (2025-09-24)

### Features

* estimated shiny probability for pokemon ([#1133](#1133)) ([d44a3df](d44a3df))
@github-actions
Copy link

🎉 This PR is included in version 1.39.0-develop.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Sep 24, 2025
# [1.39.0](v1.38.0...v1.39.0) (2025-09-24)

### Bug Fixes

* ditto filtering ([2fe3af3](2fe3af3))
* localization ([f02e8cd](f02e8cd))
* refinements to interaction between gyms/stops and routes ([8c0ba37](8c0ba37))
* relative timer not updating ([72b0a8c](72b0a8c))
* skip updated filtering if shortcode is present ([b0cfe13](b0cfe13))
* translation ([5a02a6b](5a02a6b))

### Features

* Compact Route View ([#1131](#1131)) ([795976e](795976e))
* display actual battle bonus via stationed pokemon ([ba51f47](ba51f47))
* estimated shiny probability for pokemon ([#1133](#1133)) ([d44a3df](d44a3df))
* route share code ([4ac76d0](4ac76d0))
@github-actions
Copy link

🎉 This PR is included in version 1.39.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant