fix(alarms): repaint cards when names arrive late, and two controls that outgrew their space - #832
Merged
Merged
Conversation
…first render Pokemon, raid, nest and max battle lists resolve a species name through MasterDataService and paint before it has answered. The name maps were plain Maps, so nothing marked the views dirty when they filled: the cards kept the 'Pokemon #1' fallback until an unrelated redraw -- a route change -- happened along, which is why the second visit looked right. The four name maps are signals now. Every reader runs inside a template or a computed, so the read registers and the cards, the search box and the name-order sort all recover on their own. Quest lists reloaded inside the readiness callback and were already correct; gyms, lures, invasions, fort changes and Pokestop events resolve no species name at all. The spec flushes the responses after the first render, which is the only ordering that fails against the old code, and pairs it with the case where the names never arrive and the number must stay.
…ab strip The PokeCoins tab arrived in a strip already trimmed twice to hold five, and at dialog width its label clipped to 'Pok' whether or not it was selected -- the strip paginated rather than scrolling the selected label into view. Five of the ten other locales word these rewards longer than English does, so the next trim would have taken Stardust with it, and the dialog cannot be widened without breaking at phone width, which is where it is worst. Reward type is a single-choice question, so it is now a select: it fits at any width in any language, and it drops a nested tab strip, which Material does not want inside another one. The Pokemon dialog already handles its own crowded first tab this way -- form fields under one tab rather than a second strip. Raid and max battle nest two tabs each and are left alone. Each reward now declares the number save() switches on, so hiding PokeCoins on a PoracleNG that would refuse it cannot shift the others -- which is what the old comment about keeping it last was guarding by hand. Verified in the running app at 1280px and at 360px: the label reads in full, all six rewards are reachable, and the PokeCoins panel is unchanged.
…inside each field Turning on a repeat adds 'Until (hour)' and 'Until (minute)' to a row that already held an hour, a minute and an interval. Both rendered clipped: the field has to stay narrow enough for an hour and a minute to sit side by side at phone width, and the qualifier does not fit in a floating label that narrow -- less so in the ten other locales, where every one of these words is longer than its English original. The qualifier now sits above the pair it describes, so the row reads 'Starts at' over one hour-and-minute and 'Until' over the other, and each field is labelled by the short word it asks for. The two end selects keep the full wording as their accessible name, so nothing is lost to a screen reader. On a phone the pairs stack one per row instead of wrapping field by field, which is what used to break an answer across two rows. Quest summary schedules open the same editor, so both surfaces are fixed. Verified in the running app at 1280px and at 360px, with a repeat turned on. Also widens the interval field to hold the longest of the eleven translations of 'Repeat every'.
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.
Three defects found by using the running application, not by any test. Each sits in a feature reaching users for the first time in this release, so each is a first impression. One commit per fix.
1. Alarm cards showed
Pokemon #1on a cold load —a8bb39dOpen
/pokemonfresh and every card readPokemon #1,Pokemon #133. Navigate away and back and they read correctly.The cause was one level below where I'd have looked.
MasterDataServiceheld its name tables as plainMaps. Lists paint from the alarm rows, which return first, and resolve each species name through a template method call. When the maps filled, nothing marked the views dirty — so the first paint was the last one until a route change redrew them.ready$was already the readiness signal, and the lists subscribed to it with an empty callback, which triggers no change detection.The four name maps (
pokemonMap,itemMap,moveMap,costumeMap) are now signals, rebuilt whole and published once. Every reader runs inside a template or acomputed, so cards, the search box and the name-order sort all recover on their own.formsMap,typesMapandtypeLabelswere already signals — this makes the set consistent rather than half converted.All ten alarm list components were checked, not just the one reported. (Ten lists, eleven types: raids holds raids and eggs.)
One residual, noted rather than changed:
PokemonNamePipeis a pure pipe, so it caches per input regardless of signals. It is used only in the nest and pokemon edit dialogs, which open after the list has loaded.The test is the point.
masterdata-late-arrival.spec.tsrenders an OnPush host, assertsPokemon #1, then flushes the responses — a test that seeds masterdata before creating the component passes against the broken code and proves nothing. Red before (Expected "Bulbasaur", Received "Pokemon #1"), green after, paired with a case asserting the number stays when names never arrive.2. The sixth quest reward tab did not fit —
9b15624PokéCoins clipped to "Pok" even when selected, and the strip paginated rather than scrolling the label into view.
The strip had already been trimmed twice to hold five. Widening the dialog fails at phone width; shortening labels fails in the locales that word these rewards longer than English (
Poussière d'étoile,Mega-Energie) and the next trim would have taken Stardust with it.Reward type is a single-choice question, so it is now a
mat-selectlabelled "Reward type" with the chosen type's panel below. That matches how the Pokemon dialog already handles its crowded first tab, and drops a nested tab strip, which Material 3 discourages. Raid and max-battle nest two tabs each and fit fine — untouched.Worth noting beyond the layout: each reward now declares the number
save()switches on, so hiding PokéCoins on an older PoracleNG cannot shift the others. That replaces a hand-maintained "keep it last" rule.Seven tests rewritten first and all seven failed against the tab markup. Verified on screen at 1280px and 360px.
3.
Untillabels truncated —5394fcdConfirmed on screen as
Until (hou/Until (mir. The fields must stay narrow enough for an hour and a minute to sit side by side on a phone, and no width survives all eleven locales (Jusqu'à (minute)).The qualifier moved out of the fields onto the pair: the row now reads STARTS AT over one hour-and-minute and UNTIL over the other, each field labelled by the short word it asks for. The two end selects keep the full wording as their
aria-label, so nothing is lost to a screen reader. On mobile the pairs stack one per row rather than wrapping field by field.The quest summary dialog opens this same shared editor, so both surfaces are fixed. Three tests, two red before the fix, the third the legitimate case — repeat off shows two fields and no captions.
Verification
npx jest --ci119 suites / 1415 tests (was 118 / 1408). Productionng buildclean.eslintandprettier --checkclean. Three new locale keys present in all eleven files. No line-ending churn.Browsing was read-only: dialogs opened and cancelled, nothing saved or deleted, production never touched.