chore: stabilize Zhinian pilot delivery

This commit is contained in:
inman
2026-05-12 19:44:44 +08:00
parent 45389855e1
commit 20b5aff4ad
174 changed files with 41428 additions and 784 deletions

View File

@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import type { ComponentType } from 'react';
import { AlertTriangle, ArrowLeft, Film, FolderClock, Loader2, RefreshCcw, WalletCards } from 'lucide-react';
import { AlertTriangle, ArrowLeft, Film, FolderClock, Loader2, RefreshCcw, Sparkles } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { Button } from '@/components/ui/button';
@@ -9,7 +9,7 @@ import { hostApiFetch } from '@/lib/host-api';
const DEFAULT_NIANXX_PLAY_URL = 'http://127.0.0.1:3000';
type NianxxPlayRoute = '/' | '/projects' | '/billing';
type NianxxPlayRoute = '/' | '/projects' | '/planning';
type ServiceState = 'checking' | 'starting' | 'running' | 'error';
type NianxxPlayServiceStatus = {
@@ -31,7 +31,7 @@ const NIANXX_PLAY_NAV: Array<{
}> = [
{ path: '/', labelKey: 'host.nav.create', icon: Film },
{ path: '/projects', labelKey: 'host.nav.projects', icon: FolderClock },
{ path: '/billing', labelKey: 'host.nav.billing', icon: WalletCards },
{ path: '/planning', labelKey: 'host.nav.planning', icon: Sparkles },
];
function buildEmbeddedSrc(baseUrl: string, route: NianxxPlayRoute, reloadKey: number) {
@@ -136,6 +136,7 @@ export function NianxxPlay() {
variant="outline"
size="sm"
onClick={() => navigate('/app-center')}
data-testid="nianxx-play-back"
className="shrink-0"
>
<ArrowLeft className="h-4 w-4" />
@@ -167,6 +168,7 @@ export function NianxxPlay() {
key={item.path}
type="button"
onClick={() => openRoute(item.path)}
data-testid={`nianxx-play-nav-${item.path === '/' ? 'create' : item.path.slice(1)}`}
className={cn(
'inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors',
active