Repository navigation
feat(scoreboards): pick favourite teams from a list instead of typing codes - #290
Merged
Merged
Conversation
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.
Why
favorite_teamswas a free-text array with nothing validating it — just a description saying "use 2-3 letter codes":{"type": "array", "items": {"type": "string"}, "default": [], "description": "List of favorite MLB team abbreviations (e.g., NYY, BOS, LAD)."}A wrong or stale code saves cleanly and then matches nothing, and the result is an empty screen with no error anywhere. That's the same failure
scripts/check_team_pickers.pywas written to prevent for the pickers that already exist:What changed
The roster is now an enum with display names, rendered as the same
checkbox-groupwidget the odds ticker already uses for exactly this purpose. MLB, NFL, NBA, WNBA and NHL.College leagues deliberately keep the text field — a checkbox grid of several hundred teams is worse than typing one.
On the report that prompted it
A user found
PHIdidn't work for the Phillies whileNYYworked for the Yankees. I could not reproduce that, and I'd rather say so than imply this fixes it:PHI(id 22,philadelphia-phillies)PHI—MIN (Minnesota Twins) vs PHI (Philadelphia Phillies)PHI.pngexists inassets/sports/mlb_logos/on every machine checkedDynamicTeamResolver.resolve_teamspassesPHIthrough unchanged, identically toNYYA picker removes the whole class of mistake rather than that one instance. If the Phillies still don't appear with
PHIselected from the list, that's a matching bug worth chasing separately, and the picker will have ruled out the config as the cause.Tooling fix included
check_team_pickers.pyderived the league key from a fixed trail offset (trail[-3]). Hockey nests its list one level deeper —.../nhl/properties/teams/properties/favorite_teams— so it reported the league asteamsand failed with "unknown league key". It now walks back to the nearest segment that names a league.All nine pickers validate:
Compatibility
Existing configurations are unaffected — the codes were already ESPN's, so anything valid today stays valid. Verified
PHI,NYYandTBare all accepted by the new enum, and a plausible typo likePHLis not.default: []anduniqueItemspreserved.Safety harness clean on all four plugins; the two failing tests are the pre-existing missing-
srcones that also fail onmain.Summary by CodeRabbit
New Features
Improvements