fix(client): count wire-format mana shard variant names in dominant color#5181
Closed
jeffrey701 wants to merge 1 commit into
Closed
fix(client): count wire-format mana shard variant names in dominant color#5181jeffrey701 wants to merge 1 commit into
jeffrey701 wants to merge 1 commit into
Conversation
…olor
getDominantManaColor/getDeckDominantColor tint decks by their dominant color, but countColors looked up mana shards in a table keyed by abbreviations ("W", "U", …) while the adapter emits Rust variant names ("White", "WhiteBlue", …). Every colored spell therefore contributed nothing and the tint was driven by lands alone. Normalize each shard through SHARD_ABBREVIATION before splitting hybrids; a `?? shard` fallback keeps already-abbreviated inputs working.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Author
|
Closing as a duplicate of #5065, which fixes the same issue. Apologies for the noise. |
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.
Problem
getDominantManaColor/getDeckDominantColor(client/src/viewmodel/dominantColor.ts) tint a deck by its dominant mana color.countColorslooked up each shard inSHARD_TO_COLOR, a table keyed by abbreviations ("W","U", …). ButManaCost.shardson the wire are the Rust variant names —"White","WhiteBlue", … (seeSHARD_ABBREVIATIONincostLabel.ts, and fixtures likeshards: ["White","Blue"]). SoSHARD_TO_COLOR["White"]isundefined: every colored spell contributed nothing to the count, and the tint was driven by lands alone.Fix
Normalize each shard through
SHARD_ABBREVIATION("White"→"W","WhiteBlue"→"W/U") before splitting hybrids. A?? shardfallback keeps already-abbreviated inputs working, so nothing that previously counted stops counting.Tests
Adds two cases to the existing
dominantColorsuite using the real wire-format variant names: a mono-color spell (["White","White"]) and a hybrid (["WhiteBlue"]). Both fail before the fix (dominant color comes backnull) and pass after. The whole file stays green (the pre-existing abbreviated-form tests still pass via the fallback).Self-contained: only
dominantColor.ts+ its test; no engine/Rust/protocol changes.Model: claude-opus-4-8