Repository navigation
feat(skill-reco): show the recommendation card in the UI language - #805
Merged
Merged
Conversation
The card showed the catalogue's English `description` even in a Chinese UI: SkillsView and the composer's `/` menu both fall back to `descriptionZh`, but the recommendation card rendered whatever the agent echoed — which is the English line the client sent as a candidate. The card's text now follows the UI language, while the candidate sent to the recommender deliberately does not: that payload is what the 100-question evaluation measured (`docs/internals/skill_reco/evaluation.md`), and a display decision must not move numbers it was tuned on. `shownDescription` therefore localizes on the way out, using the Chinese line the catalogue already carries and falling back to the English echo when a skill has none. The slash command, the install, the daily budget and the duplicate rules are untouched — the name is what the flow acts on. - desktop: the hook reads `i18n.language` (through a ref, since `evaluate` is created once) and builds the id → descriptionZh map from the same cached catalogue read that produces the candidates. - mobile: `ChatScreen` passes its `i18n.language` to the hook; the phone keeps its own budget and needs no other change. - The TUI is left alone: its chrome is English, it has no language setting, and its candidate list already prefers whichever line the catalogue has. Tests: desktop (21 in the hook's suite, incl. the zh card and the unchanged English payload) and mobile (15, incl. both languages). Desktop suites green (144 files / 1248 tests), mobile green (123 / 1868). The screenshot scenario `skill-reco-card` now asserts the Chinese line under `?lang=zh` — verified against the harness, and the assertion was checked to fail when the English text is asserted instead.
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.
feat(skill-reco): show the recommendation card in the UI language
The card showed the catalogue's English
descriptioneven in a Chinese UI:SkillsView and the composer's
/menu both fall back todescriptionZh, butthe recommendation card rendered whatever the agent echoed — which is the
English line the client sent as a candidate.
The card's text now follows the UI language, while the candidate sent to the
recommender deliberately does not: that payload is what the 100-question
evaluation measured (
docs/internals/skill_reco/evaluation.md), and a displaydecision must not move numbers it was tuned on.
shownDescriptionthereforelocalizes on the way out, using the Chinese line the catalogue already carries
and falling back to the English echo when a skill has none. The slash command,
the install, the daily budget and the duplicate rules are untouched — the name
is what the flow acts on.
i18n.language(through a ref, sinceevaluateiscreated once) and builds the id → descriptionZh map from the same cached
catalogue read that produces the candidates.
ChatScreenpasses itsi18n.languageto the hook; the phone keepsits own budget and needs no other change.
its candidate list already prefers whichever line the catalogue has.
Tests: desktop (21 in the hook's suite, incl. the zh card and the unchanged
English payload) and mobile (15, incl. both languages). Desktop suites green
(144 files / 1248 tests), mobile green (123 / 1868). The screenshot scenario
skill-reco-cardnow asserts the Chinese line under?lang=zh— verifiedagainst the harness, and the assertion was checked to fail when the English
text is asserted instead.