feat: success rate page for all channels #1483
Conversation
…es with UI checkbox support - Add bailian_anthropic (Anthropic format) at https://dashscope.aliyuncs.com/apps/anthropic - Add moonshot_coding (Kimi Coding endpoint) at https://api.kimi.com/coding - Both use anthropic/messages format with anthropic.PlatformDirect transformer - Implement checkbox UI pattern (like Gemini Vertex/Anthropic AWS) for Kimi Coding selection - Fix handleKimiCodingChange to properly update form.type and form.baseURL on toggle - Add English/Chinese i18n keys for new channel types and Kimi Coding checkbox - Update Ent schema, channel configs, provider mappings, and generated code Follows dual/triple-channel pattern used by Minimax, Moonshot, Doubao providers.
- Reset useKimiCoding on provider change, initialRow change, and dialog open/close - Merge TypeBailianAnthropic and TypeMoonshotCoding switch cases
…ix ContentSection import
- Change navigate({ to: '/dashboard' }) to navigate({ to: '/' })
- Dashboard is at root route, not /dashboard
- Fixes broken navigation when clicking '返回仪表盘' button
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Channel Success Rates' dashboard page featuring filtering, sorting, and pagination, supported by backend GraphQL updates to allow time-window filtering and limit parameters. Review feedback identifies a critical missing import for the ContentSection component and an anti-pattern where useMemo is used for side effects instead of useEffect. Additionally, the feedback highlights the need for internationalization of hardcoded Chinese labels and the use of the Link component for internal navigation to maintain SPA state.
| @@ -0,0 +1,288 @@ | |||
| import { useState, useMemo } from 'react'; | |||
| <SelectItem value="day">今天</SelectItem> | ||
| <SelectItem value="week">本周</SelectItem> | ||
| <SelectItem value="month">本月</SelectItem> |
There was a problem hiding this comment.
These labels are hardcoded in Chinese. To support internationalization, they should be moved to the localization JSON files and accessed using the t() function.
| <SelectItem value="day">今天</SelectItem> | |
| <SelectItem value="week">本周</SelectItem> | |
| <SelectItem value="month">本月</SelectItem> | |
| <SelectItem value="day">{t('dashboard.stats.today')}</SelectItem> | |
| <SelectItem value="week">{t('dashboard.stats.thisWeek')}</SelectItem> | |
| <SelectItem value="month">{t('dashboard.stats.thisMonth')}</SelectItem> |
| <a href='/dashboard/channel-success-rates' className='text-sm text-primary hover:underline'> | ||
| {t('dashboard.viewAll')} | ||
| </a> |
There was a problem hiding this comment.
For internal navigation in a TanStack Router application, use the Link component instead of a standard <a> tag. This prevents a full page reload and maintains the SPA state. Note: You will also need to import Link from @tanstack/react-router.
| <a href='/dashboard/channel-success-rates' className='text-sm text-primary hover:underline'> | |
| {t('dashboard.viewAll')} | |
| </a> | |
| <Link to='/dashboard/channel-success-rates' className='text-sm text-primary hover:underline'> | |
| {t('dashboard.viewAll')} | |
| </Link> |
- Add missing ContentSection import in channel-success-rates page - Replace useMemo with useEffect for page reset side effect - Internationalize hardcoded Chinese labels (今天/本周/本月) - Replace <a> with Link component for SPA navigation in dashboard
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
The dist directory is gitignored but go:embed all:dist/* requires at least one file to compile. Add .gitkeep to fix CI build failures while keeping frontend artifacts untracked.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
dashboard/channel-success-rates
