feat(web/default): unified UI overhaul — Base UI migration, theme presets, rankings dashboard, and table toolbar refactor (#4633)

* 🎨 feat(web/default): add shadcn-style theme presets, radius prefs, and fix selection badges

Integrate the qn-platform–style OKLCH color system into the default frontend while keeping the existing blue-tinted dark tokens for the default theme. Add [data-theme-preset] palettes for seven named presets plus the default zinc-like scale, define [data-theme-radius] overrides so user radius beats preset --radius, and align the Tailwind @custom-variant dark helper with .dark usage.

Introduce ThemeCustomizationProvider to own preset and radius state, persist choices in cookies (theme-preset, theme-radius), and sync data-theme-preset / data-theme-radius on <html>. Wrap the tree in main.tsx.

Extend ConfigDrawer with theme preset swatches (scoped data-theme-preset) and radius previews wired to context; refactor swatch/card markup so selected CircleCheck badges sit outside clipped rows (remove outer overflow-hidden that hid the centered checkmark).

Add i18n keys for preset names, radius, and accessibility labels across en, zh, fr, ja, ru, vi.

* 🎨 fix(web): align segmented controls with theme radius tokens

- Replace hard-coded inner pill radii (rounded-[5px]) on dashboard chart
  toolbars with radius-md so the active state follows --radius when users
  change Radius in Theme Settings.
- Use nested radii consistent with TabsList/TabsTrigger: outer
  rounded-lg (var(--radius)) and inner rounded-md (calc(var(--radius) - 2px))
  so the track and active thumb stay concentric at small scales (e.g.
  0.3rem) instead of a squared “focus” block inside a rounded shell.
- Apply the same pattern to pricing SegmentedControl and the segmented
  groups in consumption-distribution-chart, model-charts, and user-charts.

Verified: bun run typecheck (web/default)

*  feat(pricing): enrich model details with uptime sparkline and API documentation

Add a compact 30-day uptime sparkline (OpenRouter-style bars + aggregate %) with
per-day tooltips, surface it in a status row under quick stats and in the
per-group performance table, and extend mock data so uptime series are stable
and optionally scoped by group.

Introduce an API tab with Shiki-highlighted code samples (cURL, Python,
TypeScript, JavaScript), endpoint-type switching, authentication guidance, a
supported-parameters table, and mock per-group RPM/TPM/RPD limits. Infer
vendor, tokenizer, license, and data-retention hints for a provider & data
privacy card on the Overview tab (capabilities/modalities stay with model
identity; rate limits stay with the API tab).

Update i18n for all new user-facing strings across en, zh, fr, ja, ru, and vi.

* 🏆 feat(rankings): add comprehensive rankings dashboard

Add a mock-data powered rankings experience with period tabs, model, app, and vendor leaderboards, market share and history charts, movers, new releases, and per-category sections while backend analytics are pending.

Link ranked models to pricing details and ranked vendors to filtered pricing results, and include localized copy for all supported frontend locales.

* fix(theme): correct theme preset selection state

- update Base UI Radio selectors to use data-checked/data-unchecked states.
- fix unchecked theme options still showing selected indicators.
- isolate the default theme preview tokens to prevent preset changes from leaking into it.

* fix(setup): correct usage mode radio state

- use Base UI data-checked/data-unchecked states for RadioGroup styling.
- hide radio indicators when options are unchecked to avoid setup page display issues.
- drive usage mode card and icon selection styles from Base UI state.

* fix(auth): submit sign-in and sign-up forms

* 🎨 refactor: Align default theme with shadcn Base Nova and prune legacy customization

Migrate shadcn UI to Base UI primitives via CLI (`base-nova` / `components.json`)
and reinstall full component registry with `--overwrite`, including Hugeicons-backed
widgets and newly added registry components.

- Remove custom multi-preset/theme-radius system (`ThemeCustomizationProvider`, cookies,
  preset UI from config drawer); rely on official semantic CSS tokens + light/dark only.
- Replace `theme.css` with shadcn’s documented neutral `:root`/`.dark` palette and
  `@theme inline` mappings (plus skeleton token vars for existing shimmer usage).
- Update global styles for Base UI: collapsible animation uses `--collapsible-panel-height`;
  clarify scroll-lock override comment.

Application compatibility:
- Keep minimal shims where app code diverged from official APIs (popover collision props,
  combobox legacy `options` callers, Spinner prop typing).
- Switch interactive styling from Radix-era `data-state` / `--radix-*` selectors to Base UI
  semantics (`data-open`, `data-popup-open`, `data-panel-open`, `--anchor-width`, etc.)

Tooling / docs / build:
- Rename Rsbuild vendor chunk grouping to `@base-ui` + transitive `@radix-ui`.
- Refresh AGENTS.md / CLAUDE.md / classic→default sync skill for Base UI stack.
- Bump `package.json` / lockfile for shadcn-postinstall deps (Hugeicons, chart stack, themes, etc.)

Verified: `bun run typecheck` passes.

Note: `bun run lint` still reports pre-existing hooks rule violations elsewhere;
not addressed in this change.

* 🎨 chore(web/default): unify table toolbar, relocate usage stats, refine filters

- Refactor DataTableToolbar to a single wrapping flex row with a
  right-aligned action cluster (Reset / Search / View / Expand) for a
  cleaner Ant Design Pro–style filter bar; remove the dedicated stats row
  and the toolbar `stats` prop.
- Move Common Logs summary badges (Usage / RPM / TPM) and the sensitive-
  data visibility toggle into the page header via CommonLogsHeaderActions
  and SectionPageLayout.Actions so the toolbar stays focused on filters.
- Slim CommonLogsFilterBar props (no stats / preActions eye control).
- Improve CompactDateTimeRangePicker: show minute-precision labels on the
  trigger (seconds omitted; aligns with datetime-local inputs); widen the
  trigger on sm+ breakpoints so the full range is visible without truncation;
  apply the same width in task logs filters.
- Simplify DataTableViewOptions: text-only “View” trigger, no sliders icon.
- Earlier layout tweak: extra top padding on SectionPageLayout scroll
  content so control focus rings are not clipped by overflow.

* feat(web/default): Base UI migration and component foundation

Migrate from Radix UI to Base UI, rewrite core UI primitives,
update dependencies (recharts, date-fns, next-themes), add
shadcn agent skill documentation, and refresh AI element components.

This is the foundational work from the v2/localmain lineage that
was not covered by the individual feature commits above.

---------

Co-authored-by: t0ng7u <dev@aiass.cc>
Co-authored-by: QuentinHsu <xuquentinyang@gmail.com>
This commit is contained in:
Calcium-Ion
2026-05-06 12:39:36 +08:00
committed by GitHub
parent dac55f0fde
commit 8b2b03d276
317 changed files with 19928 additions and 7065 deletions
+7 -11
View File
@@ -14,24 +14,20 @@ export function HeroButtons({ isAuthenticated }: HeroButtonsProps) {
const { t } = useTranslation()
if (isAuthenticated) {
return (
<Button size='lg' asChild>
<Link to='/dashboard'>
{t('Go to Dashboard')} <ArrowRight className='ml-2 h-5 w-5' />
</Link>
<Button size='lg' render={<Link to='/dashboard' />}>
{t('Go to Dashboard')} <ArrowRight className='ml-2 h-5 w-5' />
</Button>
)
}
return (
<>
<Button size='lg' asChild>
<Link to='/sign-up'>
{t('Get Started')}
<ArrowRight className='ml-2 h-5 w-5' />
</Link>
<Button size='lg' render={<Link to='/sign-up' />}>
{t('Get Started')}
<ArrowRight className='ml-2 h-5 w-5' />
</Button>
<Button size='lg' variant='outline' asChild>
<Link to='/sign-in'>{t('Sign In')}</Link>
<Button size='lg' variant='outline' render={<Link to='/sign-in' />}>
{t('Sign In')}
</Button>
</>
)
@@ -40,7 +40,8 @@ const ACCENT_CLASSES: Record<
blue: {
activeText: 'text-blue-600 dark:text-blue-400',
activeBorder: 'border-blue-500 dark:border-blue-400',
badge: 'bg-blue-500/10 text-blue-600 dark:bg-blue-400/10 dark:text-blue-400',
badge:
'bg-blue-500/10 text-blue-600 dark:bg-blue-400/10 dark:text-blue-400',
},
violet: {
activeText: 'text-violet-600 dark:text-violet-400',
@@ -80,10 +81,7 @@ const API_DEMOS: ApiDemoConfig[] = [
method: 'POST',
endpoint: '/v1/responses',
headers: ['"Authorization: Bearer sk-••••"'],
request: [
'"model": "your-model",',
'"input": "..."',
],
request: ['"model": "your-model",', '"input": "..."'],
response: [
'{',
' "output": [{ "type": "output_text", "text": <text> }],',
@@ -209,10 +207,10 @@ export function HeroTerminalDemo() {
key={item.id}
onClick={() => handleSelect(index)}
className={cn(
'-mb-px relative flex items-center gap-1.5 border-b-2 px-2.5 py-2.5 text-[11px] font-medium tracking-wide transition-colors sm:px-3 sm:text-xs',
'relative -mb-px flex items-center gap-1.5 border-b-2 px-2.5 py-2.5 text-[11px] font-medium tracking-wide transition-colors sm:px-3 sm:text-xs',
isActive
? `${tone.activeBorder} ${tone.activeText}`
: 'border-transparent text-foreground/40 hover:text-foreground/70'
: 'text-foreground/40 hover:text-foreground/70 border-transparent'
)}
>
{item.label}
@@ -221,7 +219,7 @@ export function HeroTerminalDemo() {
})}
<div className='ml-auto flex items-center gap-2 pr-2 sm:pr-3'>
<span className='inline-block size-1.5 rounded-full bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.45)]' />
<span className='font-mono text-[10px] tracking-wider text-foreground/40 uppercase'>
<span className='text-foreground/40 font-mono text-[10px] tracking-wider uppercase'>
200 ok
</span>
</div>
@@ -244,7 +242,7 @@ export function HeroTerminalDemo() {
</span>
<code
className={cn(
'truncate font-mono text-[12.5px] text-foreground/75 transition-opacity duration-200',
'text-foreground/75 truncate font-mono text-[12.5px] transition-opacity duration-200',
transitioning ? 'opacity-0' : 'opacity-100'
)}
>
@@ -268,17 +266,17 @@ export function HeroTerminalDemo() {
'border-border/40 bg-muted/30 dark:border-white/[0.05] dark:bg-white/[0.02]'
)}
>
<div className='flex items-center gap-3 text-[10px] tabular-nums text-foreground/40'>
<div className='text-foreground/40 flex items-center gap-3 text-[10px] tabular-nums'>
<span className='flex items-center gap-1'>
<span className='font-mono'>{demo.latency}</span>
<span className='tracking-wider uppercase'>ms</span>
</span>
<span className='size-1 rounded-full bg-foreground/15' />
<span className='bg-foreground/15 size-1 rounded-full' />
<span className='flex items-center gap-1'>
<span className='font-mono'>{demo.tokens}</span>
<span className='tracking-wider uppercase'>tokens</span>
</span>
<span className='size-1 rounded-full bg-foreground/15' />
<span className='bg-foreground/15 size-1 rounded-full' />
<span className='flex items-center gap-1'>
<span className='tracking-wider uppercase'>cost</span>
<span className='font-mono'>
@@ -286,7 +284,7 @@ export function HeroTerminalDemo() {
</span>
</span>
</div>
<span className='font-mono text-[10px] tracking-wider text-foreground/30 uppercase'>
<span className='text-foreground/30 font-mono text-[10px] tracking-wider uppercase'>
stream · sse
</span>
</div>
@@ -352,9 +350,7 @@ function ResponseBlock(props: { demo: ApiDemoConfig; transitioning: boolean }) {
)}
>
{demo.response.map((line, i) => (
<CodeLine key={i}>
{renderResponseLine(line, demo)}
</CodeLine>
<CodeLine key={i}>{renderResponseLine(line, demo)}</CodeLine>
))}
</div>
</div>
@@ -363,7 +359,7 @@ function ResponseBlock(props: { demo: ApiDemoConfig; transitioning: boolean }) {
function SectionLabel(props: { children: ReactNode }) {
return (
<span className='font-sans text-[10px] font-semibold tracking-[0.18em] text-foreground/30 uppercase'>
<span className='text-foreground/30 font-sans text-[10px] font-semibold tracking-[0.18em] uppercase'>
{props.children}
</span>
)
@@ -401,9 +397,7 @@ function renderResponseLine(line: string, demo: ApiDemoConfig): ReactNode {
</Accent>
)
} else if (placeholder === '<tokens>') {
segments.push(
<NumberText key={`ph-${idx}`}>{demo.tokens}</NumberText>
)
segments.push(<NumberText key={`ph-${idx}`}>{demo.tokens}</NumberText>)
} else if (placeholder === '<in>') {
segments.push(
<NumberText key={`ph-${idx}`}>
@@ -472,7 +466,7 @@ function tokenize(input: string): ReactNode {
function CodeLine(props: { children: ReactNode; indent?: number }) {
return (
<div className='whitespace-pre-wrap break-words'>
<div className='break-words whitespace-pre-wrap'>
{props.indent ? (
<span
aria-hidden
@@ -525,5 +519,7 @@ function Muted(props: { children: ReactNode }) {
function Accent(props: { children: ReactNode; accent: AccentTone }) {
const tone = ACCENT_CLASSES[props.accent]
return <span className={cn('font-medium', tone.activeText)}>{props.children}</span>
return (
<span className={cn('font-medium', tone.activeText)}>{props.children}</span>
)
}
+5 -7
View File
@@ -47,18 +47,16 @@ export function CTA(props: CTAProps) {
)}
</p>
<div className='mt-8 flex items-center justify-center gap-3'>
<Button className='group rounded-lg' asChild>
<Link to='/sign-up'>
{t('Get Started')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Link>
<Button className='group rounded-lg' render={<Link to='/sign-up' />}>
{t('Get Started')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Button>
<Button
variant='outline'
className='border-border/50 hover:border-border hover:bg-muted/50 rounded-lg'
asChild
render={<Link to='/pricing' />}
>
<Link to='/pricing'>{t('View Pricing')}</Link>
{t('View Pricing')}
</Button>
</div>
</AnimateInView>
+14 -12
View File
@@ -59,26 +59,28 @@ export function Hero(props: HeroProps) {
style={{ animationDelay: '160ms' }}
>
{props.isAuthenticated ? (
<Button className='group rounded-lg' asChild>
<Link to='/dashboard'>
{t('Go to Dashboard')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Link>
<Button
className='group rounded-lg'
render={<Link to='/dashboard' />}
>
{t('Go to Dashboard')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Button>
) : (
<>
<Button className='group rounded-lg' asChild>
<Link to='/sign-up'>
{t('Get Started')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Link>
<Button
className='group rounded-lg'
render={<Link to='/sign-up' />}
>
{t('Get Started')}
<ArrowRight className='ml-1 size-3.5 transition-transform duration-200 group-hover:translate-x-0.5' />
</Button>
<Button
variant='outline'
className='border-border/50 hover:border-border hover:bg-muted/50 rounded-lg'
asChild
render={<Link to='/pricing' />}
>
<Link to='/pricing'>{t('View Pricing')}</Link>
{t('View Pricing')}
</Button>
</>
)}