fix(frontend): stop Alpha Zoo headline rendering the count twice#287
Merged
Conversation
The AlphaZoo headline rendered a standalone `{total}` and then the
translated `prebuiltAlpha` string, which already interpolates
`{{count}}` — so the page showed the number twice (e.g. "456 456
pre-built quant alphas across 4 zoos"). It also carried a hardcoded,
now-stale `452` fallback.
Render only the translated string with the live (filter-aware) total,
and show a count-less loading variant while alphas load. New
`alphaZoo.prebuiltAlphaLoading` key added to both en and zh-CN.
2 tasks
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.
Summary
Fixes #286 — the Alpha Zoo page renders the alpha count twice in its headline (e.g. "456 456 pre-built quant alphas across 4 zoos").
Root cause
frontend/src/pages/AlphaZoo.tsx:218rendered a standalone{total}and then the translatedalphaZoo.prebuiltAlphastring — which already interpolates{{count}}. So the number printed twice. The same line also carried a hardcoded, now-stale452fallback.Fix
totalas the count.452fallback; while alphas load, show a count-less loading variant gated on the existingloadingflag (avoids a "0 pre-built…" flash).alphaZoo.prebuiltAlphaLoadingkey added to bothen.jsonandzh-CN.json(locale key sets stay in parity).Test Plan
tsc --noEmit— cleanvitest run— 22 files, 209 tests passedCloses #286