Repository navigation
fix(i18n): resolve code review issues for PR #1318 - #1324
Conversation
- Fix duplicate routing strategy guidance texts in zh-CN.json - Fix strategy recommendations duplicates - Add useMemo import in playground/page.tsx - Add hardcoded string localization in ProxyConfigModal.tsx - Replace dangerouslySetInnerHTML with t.rich in OAuthModal.tsx - Replace dangerouslySetInnerHTML with t.rich in PricingModal.tsx - Add useMemo in RequestLoggerV2.tsx for performance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates strategy guidance and recommendations, refactors several components to use useMemo for performance optimization, and improves translation handling by replacing dangerouslySetInnerHTML with t.rich. It also adds a significant number of translation keys for various dashboard features. Feedback is provided regarding the RequestLoggerV2 component, where the cacheSource and tps columns were omitted from the columns array, and their corresponding translation keys are missing from the English locale file.
| const columns = useMemo( | ||
| () => [ | ||
| { key: "status", label: t("columns.status") }, | ||
| { key: "model", label: t("columns.model") }, | ||
| { key: "requestedModel", label: t("columns.requested") }, | ||
| { key: "provider", label: t("columns.provider") }, | ||
| { key: "protocol", label: t("columns.protocol") }, | ||
| { key: "account", label: t("columns.account") }, | ||
| { key: "apiKey", label: t("columns.apiKey") }, | ||
| { key: "combo", label: t("columns.combo") }, | ||
| { key: "tokens", label: t("columns.tokens") }, | ||
| { key: "duration", label: t("columns.duration") }, | ||
| { key: "time", label: t("columns.time") }, | ||
| ], | ||
| [t] | ||
| ); |
There was a problem hiding this comment.
The columns array is missing the cacheSource and tps columns which were present in the original COLUMNS constant. This causes these columns to be hidden by default (as visibleColumns is initialized from this array) and prevents them from appearing in the column visibility toggle list, resulting in a regression of UI functionality.
| const columns = useMemo( | |
| () => [ | |
| { key: "status", label: t("columns.status") }, | |
| { key: "model", label: t("columns.model") }, | |
| { key: "requestedModel", label: t("columns.requested") }, | |
| { key: "provider", label: t("columns.provider") }, | |
| { key: "protocol", label: t("columns.protocol") }, | |
| { key: "account", label: t("columns.account") }, | |
| { key: "apiKey", label: t("columns.apiKey") }, | |
| { key: "combo", label: t("columns.combo") }, | |
| { key: "tokens", label: t("columns.tokens") }, | |
| { key: "duration", label: t("columns.duration") }, | |
| { key: "time", label: t("columns.time") }, | |
| ], | |
| [t] | |
| ); | |
| const columns = useMemo( | |
| () => [ | |
| { key: "status", label: t("columns.status") }, | |
| { key: "cacheSource", label: t("columns.cacheSource") }, | |
| { key: "model", label: t("columns.model") }, | |
| { key: "requestedModel", label: t("columns.requested") }, | |
| { key: "provider", label: t("columns.provider") }, | |
| { key: "protocol", label: t("columns.protocol") }, | |
| { key: "account", label: t("columns.account") }, | |
| { key: "apiKey", label: t("columns.apiKey") }, | |
| { key: "combo", label: t("columns.combo") }, | |
| { key: "tokens", label: t("columns.tokens") }, | |
| { key: "tps", label: t("columns.tps") }, | |
| { key: "duration", label: t("columns.duration") }, | |
| { key: "time", label: t("columns.time") }, | |
| ], | |
| [t] | |
| ); |
| "columns": { | ||
| "status": "Status", | ||
| "model": "Model", | ||
| "requested": "Requested", | ||
| "provider": "Provider", | ||
| "protocol": "Request Protocol", | ||
| "account": "Account", | ||
| "apiKey": "API Key", | ||
| "combo": "Combo", | ||
| "tokens": "Tokens", | ||
| "duration": "Duration", | ||
| "time": "Time" | ||
| }, |
There was a problem hiding this comment.
Missing translation keys for cacheSource and tps columns in the requestLogger namespace. These are required to support the missing columns in the Request Logger UI.
| "columns": { | |
| "status": "Status", | |
| "model": "Model", | |
| "requested": "Requested", | |
| "provider": "Provider", | |
| "protocol": "Request Protocol", | |
| "account": "Account", | |
| "apiKey": "API Key", | |
| "combo": "Combo", | |
| "tokens": "Tokens", | |
| "duration": "Duration", | |
| "time": "Time" | |
| }, | |
| "columns": { | |
| "status": "Status", | |
| "cacheSource": "Cache Source", | |
| "model": "Model", | |
| "requested": "Requested", | |
| "provider": "Provider", | |
| "protocol": "Request Protocol", | |
| "account": "Account", | |
| "apiKey": "API Key", | |
| "combo": "Combo", | |
| "tokens": "Tokens", | |
| "tps": "TPS", | |
| "duration": "Duration", | |
| "time": "Time" | |
| }, |
Add cacheSource and tps to the translated columns array and their corresponding translation keys in en.json and zh-CN.json.
57395ed
into
cheaper-inference:release/v3.6.7
…clean fix(i18n): resolve code review issues for PR cheaper-inference#1318
…clean fix(i18n): resolve code review issues for PR cheaper-inference#1318
Summary
Fixes all code review issues from PR #1318:
Files changed
src/app/(dashboard)/dashboard/combos/page.tsxsrc/app/(dashboard)/dashboard/playground/page.tsxsrc/i18n/messages/en.jsonsrc/i18n/messages/zh-CN.jsonsrc/shared/components/OAuthModal.tsxsrc/shared/components/PricingModal.tsxsrc/shared/components/ProxyConfigModal.tsxsrc/shared/components/RequestLoggerV2.tsxTest plan
🤖 Generated with Claude Code