Skip to content

feat: success rate page for all channels #1483

Merged
looplj merged 10 commits into
looplj:unstablefrom
banlanzs:unstable
Apr 25, 2026
Merged

feat: success rate page for all channels #1483
looplj merged 10 commits into
looplj:unstablefrom
banlanzs:unstable

Conversation

@banlanzs

Copy link
Copy Markdown
Contributor

dashboard/channel-success-rates
image

…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
- Change navigate({ to: '/dashboard' }) to navigate({ to: '/' })
- Dashboard is at root route, not /dashboard
- Fixes broken navigation when clicking '返回仪表盘' button

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/src/features/dashboard/channel-success-rates/index.tsx
@@ -0,0 +1,288 @@
import { useState, useMemo } from 'react';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The useEffect hook is required for the side effect of resetting the current page when filters change. Please add it to the React imports.

Suggested change
import { useState, useMemo } from 'react';
import { useState, useMemo, useEffect } from 'react';

Comment thread frontend/src/features/dashboard/channel-success-rates/index.tsx
Comment on lines +150 to +152
<SelectItem value="day">今天</SelectItem>
<SelectItem value="week">本周</SelectItem>
<SelectItem value="month">本月</SelectItem>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These labels are hardcoded in Chinese. To support internationalization, they should be moved to the localization JSON files and accessed using the t() function.

Suggested change
<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>

Comment on lines +170 to +172
<a href='/dashboard/channel-success-rates' className='text-sm text-primary hover:underline'>
{t('dashboard.viewAll')}
</a>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@banlanzs banlanzs marked this pull request as draft April 25, 2026 08:25
@banlanzs banlanzs marked this pull request as ready for review April 25, 2026 08:25

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@looplj looplj changed the title add full view of channel success rate feat: add full view of channel success rate Apr 25, 2026
@looplj looplj changed the title feat: add full view of channel success rate feat: success rate page for all channels Apr 25, 2026
@looplj looplj merged commit b72bdff into looplj:unstable Apr 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants