fix(widget): add liquid_staking yield type support#543
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughAdds Changesliquid_staking and unknown yield type support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/widget/src/domain/types/yields.ts`:
- Around line 452-457: The unknown yield fallback in the yield type mapping is
hardcoded with user-facing English copy, so localize it the same way as the
other entries in the yields type definitions. Update the `unknown` object in
`yields.ts` to use translation keys instead of literal `"Yield"` and `"Earn"`
values, and add the corresponding keys and values in both
`packages/widget/src/translation/English/translations.json` and
`packages/widget/src/translation/French/translations.json`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6c1ca82f-9f4a-49d4-9a61-0d7e15f310c2
⛔ Files ignored due to path filters (2)
packages/widget/src/generated/api/legacy.tsis excluded by!**/generated/**packages/widget/src/generated/api/yield.tsis excluded by!**/generated/**
📒 Files selected for processing (6)
packages/widget/src/domain/types/yields.tspackages/widget/src/hooks/use-yield-meta-info.tsxpackages/widget/src/translation/English/translations.jsonpackages/widget/src/translation/French/translations.jsonpackages/widget/tests/domain/dashboard-yield-category-types.test.tspackages/widget/tests/hooks/activity-actions.test.ts
| unknown: { | ||
| type: "unknown", | ||
| title: "Yield", | ||
| review: "Earn", | ||
| cta: "Earn", | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Localize the "unknown" fallback labels.
These strings are user-facing, but hardcoding "Yield" / "Earn" bypasses i18n and will show English copy in non-English locales whenever the API returns a future unknown type. Use translation keys here the same way the other yield types do.
As per coding guidelines, "When changing user-facing copy, update both packages/widget/src/translation/English/translations.json and packages/widget/src/translation/French/translations.json".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/widget/src/domain/types/yields.ts` around lines 452 - 457, The
unknown yield fallback in the yield type mapping is hardcoded with user-facing
English copy, so localize it the same way as the other entries in the yields
type definitions. Update the `unknown` object in `yields.ts` to use translation
keys instead of literal `"Yield"` and `"Earn"` values, and add the corresponding
keys and values in both
`packages/widget/src/translation/English/translations.json` and
`packages/widget/src/translation/French/translations.json`.
Source: Coding guidelines
Map liquid_staking to the stake dashboard category and treat unknown future API yield types as "unknown" so filters and labels stay safe when the server adds types before the widget is updated.
321fe16 to
f3d1dfa
Compare
Map liquid_staking to the stake dashboard category and treat unknown future API yield types as "unknown" so filters and labels stay safe when the server adds types before the widget is updated.
Summary by CodeRabbit
liquid_stakingyield type across the widget, including dashboard grouping, labels, and yield metadata.liquid_stakingand “unknown.”