-
setMobileOpen(false)} />
+
diff --git a/frontend/src/components/layout/AppSidebar.tsx b/frontend/src/components/layout/AppSidebar.tsx
index 65203811..f0170f98 100644
--- a/frontend/src/components/layout/AppSidebar.tsx
+++ b/frontend/src/components/layout/AppSidebar.tsx
@@ -1,10 +1,10 @@
-import { useState } from 'react'
+import { useEffect, useState } from 'react'
import { NavLink } from 'react-router-dom'
-import { Drawer, Button, Chip, Separator, Tooltip } from '@heroui/react'
import { ChartBar, Cube, Gauge, GearSix, Key, Lightning, Scroll, SidebarSimple, UsersThree, X } from '@phosphor-icons/react'
import { SidebarUpdateItem } from '@/components/layout/SidebarUpdateItem'
import { BrandMark } from '@/components/BrandMark'
-import { SkeletonBlock } from '@/components/ui/PageSkeletons'
+import { SkeletonBlock } from '@/components/ui/SkeletonBlock'
+import { ShellChip, ShellIconButton, ShellSeparator, ShellTooltip } from '@/components/ui/ShellControls'
import { pressScale } from '@/hooks/useGsapReveal'
import { useI18n } from '@/hooks/useI18n'
import { useOverview } from '@/hooks/useOverview'
@@ -40,7 +40,7 @@ function NavList({ collapsed, onNavigate }: { collapsed: boolean; onNavigate?: (
{groups.map((group) => (
{collapsed ? (
-
+
) : (
{group.label}
)}
@@ -124,19 +124,16 @@ function InFlightIndicator({ initial, collapsed }: { initial: number; collapsed:
const label = t('sidebarInFlight', { count: value })
return (
-
-
-
- 0 ? 'ok' : undefined} />
- {value}
-
-
- {label}
-
+
+
+ 0 ? 'ok' : undefined} />
+ {value}
+
+
)
}
@@ -159,10 +156,34 @@ export function AppSidebar({ mobileOpen, onClose }: Props) {
})
}
+ useEffect(() => {
+ if (!mobileOpen) return
+ const previousOverflow = document.body.style.overflow
+ document.body.style.overflow = 'hidden'
+ const onKeyDown = (event: KeyboardEvent) => {
+ if (event.key === 'Escape') onClose()
+ }
+ document.addEventListener('keydown', onKeyDown)
+ return () => {
+ document.body.style.overflow = previousOverflow
+ document.removeEventListener('keydown', onKeyDown)
+ }
+ }, [mobileOpen, onClose])
+
+ useEffect(() => {
+ if (!mobileOpen) return
+ const media = window.matchMedia('(min-width: 1024px)')
+ const onChange = () => {
+ if (media.matches) onClose()
+ }
+ media.addEventListener('change', onChange)
+ return () => media.removeEventListener('change', onChange)
+ }, [mobileOpen, onClose])
+
const toggle = (
-
+
)
const footer = (
@@ -177,7 +198,7 @@ export function AppSidebar({ mobileOpen, onClose }: Props) {
{healthy ? t('running') : t('degraded')}
- {hotCount}/{accountCount}
+ {hotCount}/{accountCount}
Proxy
@@ -191,14 +212,11 @@ export function AppSidebar({ mobileOpen, onClose }: Props) {
)}
{collapsed ? (
-
-
-
-
- {showStatusSkeleton ? t('refreshing') : healthy ? t('running') : t('degraded')}
-
+
+
+ {showStatusSkeleton ? : }
+
+
) : null}
@@ -219,14 +237,27 @@ export function AppSidebar({ mobileOpen, onClose }: Props) {
{footer}
-
{ if (!open) onClose() }}>
-
-
-
-
-
-
-
+ {mobileOpen ? (
+
+ ) : null}
>
)
}
diff --git a/frontend/src/components/layout/SidebarUpdateDialog.tsx b/frontend/src/components/layout/SidebarUpdateDialog.tsx
new file mode 100644
index 00000000..f65b0140
--- /dev/null
+++ b/frontend/src/components/layout/SidebarUpdateDialog.tsx
@@ -0,0 +1,60 @@
+import { Button, Modal } from '@heroui/react'
+import { X } from '@phosphor-icons/react'
+import { PageAlert } from '@/components/ui/PageAlert'
+import { ReleaseNotes } from '@/components/ReleaseNotes'
+import { UpdateControls } from '@/components/system/UpdateControls'
+import { extractReleaseNotes } from '@/lib/releaseNotes'
+import type { SystemUpdateInfo } from '@/api/system'
+import type { SystemUpdateController } from '@/hooks/useSystemUpdate'
+
+type Props = {
+ open: boolean
+ update: SystemUpdateController
+ release?: SystemUpdateInfo['release']
+ version: string
+ lang: 'zh' | 'en'
+ labels: {
+ versionUpdate: string
+ close: string
+ releaseNotes: string
+ emptyNotes: string
+ goToUpdate: string
+ }
+ onClose: () => void
+ onGoToUpdate: () => void
+}
+
+/** The update dialog is lazy: it is only downloaded when the sidebar entry is opened. */
+export function SidebarUpdateDialog({ open, update, release, version, lang, labels, onClose, onGoToUpdate }: Props) {
+ return (
+
{ if (!next) onClose() }}>
+
+
+
+
+
+
{labels.versionUpdate}
+
{release?.tag_name || version}
+
+
+
+
+
+
+ {update.error ? : null}
+
+ {labels.releaseNotes}
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/frontend/src/components/layout/SidebarUpdateItem.tsx b/frontend/src/components/layout/SidebarUpdateItem.tsx
index b823db64..68de073c 100644
--- a/frontend/src/components/layout/SidebarUpdateItem.tsx
+++ b/frontend/src/components/layout/SidebarUpdateItem.tsx
@@ -1,21 +1,18 @@
-import { useLayoutEffect, useRef, useState, type RefObject } from 'react'
+import { Suspense, lazy, useLayoutEffect, useRef, useState, type RefObject } from 'react'
import { useNavigate } from 'react-router-dom'
-import { Button, Modal } from '@heroui/react'
-import { ArrowCircleUp, Notebook, X } from '@phosphor-icons/react'
-import { UpdateControls } from '@/components/system/UpdateControls'
-import { PageAlert } from '@/components/ui/PageAlert'
+import { ArrowCircleUp, Notebook } from '@phosphor-icons/react'
import { useSystemUpdate } from '@/hooks/useSystemUpdate'
-import { ReleaseNotes } from '@/components/ReleaseNotes'
-import { extractReleaseNotes } from '@/lib/releaseNotes'
import { duration, ease, gsap } from '@/lib/motion'
import { useI18n } from '@/hooks/useI18n'
+const SidebarUpdateDialog = lazy(() => import('@/components/layout/SidebarUpdateDialog').then((module) => ({ default: module.SidebarUpdateDialog })))
+
/** Compact version / new-release entry pinned to the bottom-left of the sidebar. */
export function SidebarUpdateItem({ collapsed, onNavigate }: { collapsed: boolean; onNavigate?: () => void }) {
const { t, lang } = useI18n()
const navigate = useNavigate()
const update = useSystemUpdate()
- const { info, error } = update
+ const { info } = update
const [open, setOpen] = useState(false)
const nudgeRef = useRef
(null)
@@ -48,33 +45,30 @@ export function SidebarUpdateItem({ collapsed, onNavigate }: { collapsed: boolea
{hasUpdate ? : null}
-
-
-
-
-
-
-
{t('versionUpdate')}
-
{release?.tag_name || version}
-
-
-
-
- {error ? : null}
-
- {t('sidebarReleaseNotes')}
-
-
-
-
-
-
-
-
-
-
+ {open ? (
+
+ setOpen(false)}
+ onGoToUpdate={() => {
+ setOpen(false)
+ onNavigate?.()
+ navigate('/system?tab=updates')
+ }}
+ />
+
+ ) : null}
>
)
}
diff --git a/frontend/src/components/overview/InflightDepthChart.tsx b/frontend/src/components/overview/InflightDepthChart.tsx
new file mode 100644
index 00000000..7a9b3fc0
--- /dev/null
+++ b/frontend/src/components/overview/InflightDepthChart.tsx
@@ -0,0 +1,120 @@
+import { useEffect, useMemo, useRef, useState } from 'react'
+import {
+ Area,
+ AreaChart,
+ ReferenceArea,
+ ReferenceLine,
+ ResponsiveContainer,
+ XAxis,
+ YAxis,
+} from 'recharts'
+import { motionDuration, prefersReducedMotion } from '@/lib/motion'
+
+export function InflightDepthChart({
+ series,
+ bands,
+ backpressure,
+ label,
+}: {
+ series: number[]
+ bands: Array<{ from: number; until: number }>
+ backpressure: number
+ label: string
+}) {
+ // Continuous glide: keep a stable x domain (0..n-1) while values scroll;
+ // ease Y peak so scale changes don’t jump. Tick cadence ~260ms → linear ~560ms morph.
+ const rawPeak = Math.max(backpressure, ...series, 1)
+ const peakRef = useRef(rawPeak)
+ const [peak, setPeak] = useState(rawPeak)
+ useEffect(() => {
+ if (prefersReducedMotion()) {
+ peakRef.current = rawPeak
+ setPeak(rawPeak)
+ return
+ }
+ const from = peakRef.current
+ const to = rawPeak
+ if (Math.abs(to - from) < 0.01) return
+ let raf = 0
+ const t0 = performance.now()
+ const dur = motionDuration(0.56) * 1000
+ const tick = (now: number) => {
+ const t = Math.min(1, (now - t0) / dur)
+ const e = 1 - Math.pow(1 - t, 3)
+ const v = from + (to - from) * e
+ peakRef.current = v
+ setPeak(v)
+ if (t < 1) raf = requestAnimationFrame(tick)
+ }
+ raf = requestAnimationFrame(tick)
+ return () => cancelAnimationFrame(raf)
+ }, [rawPeak])
+
+ const data = useMemo(
+ () => series.map((v, i) => ({ i, v, bp: backpressure })),
+ [series, backpressure],
+ )
+ const bandRows = useMemo(
+ () =>
+ bands.map((band, idx) => {
+ const n = Math.max(1, series.length - 1)
+ return {
+ key: idx,
+ x1: band.from * n,
+ x2: Math.max(band.from * n + 0.35, band.until * n),
+ }
+ }),
+ [bands, series.length],
+ )
+ const yMax = Math.max(peak, backpressure, 1)
+
+ return (
+
+
+
+
+
+ {bandRows.map((b) => (
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/frontend/src/components/overview/InflightLiveCard.tsx b/frontend/src/components/overview/InflightLiveCard.tsx
index c20ce9d9..1f9083c9 100644
--- a/frontend/src/components/overview/InflightLiveCard.tsx
+++ b/frontend/src/components/overview/InflightLiveCard.tsx
@@ -1,19 +1,10 @@
-import { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react'
+import { lazy, Suspense, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { Link } from 'react-router-dom'
import { Card } from '@heroui/react'
import { ArrowUpRight, CaretRight, ChatCircle, Check, Cube, Wrench, X } from '@phosphor-icons/react'
import type { LiveSnapshot, LiveSticky } from '@/api/live'
import CustomEase from 'gsap/CustomEase'
import { MotionPathPlugin } from 'gsap/MotionPathPlugin'
-import {
- Area,
- AreaChart,
- ReferenceArea,
- ReferenceLine,
- ResponsiveContainer,
- XAxis,
- YAxis,
-} from 'recharts'
import {
applyLiveProjection,
clampSlotConcurrency,
@@ -33,6 +24,8 @@ import { ProviderMark } from '@/components/ProviderMark'
import { CompactSwitch } from '@/components/ui/CompactSwitch'
import { ease, gsap, motionDuration, prefersReducedMotion } from '@/lib/motion'
+const InflightDepthChart = lazy(() => import('@/components/overview/InflightDepthChart').then((mod) => ({ default: mod.InflightDepthChart })))
+
const MOCK_DEMO_STORAGE_KEY = 'cli2api_inflight_mock_demo'
function readMockDemoPref(): boolean {
@@ -67,7 +60,7 @@ const WORKER_VISIBLE_MAX = 4
/**
* Inflight choreography timings (display-only — Acquire/Bind never delayed):
* selectingMinDwell 1600ms recorder: wait-rail visibility after Start
- * LIVE_POLL_EXPANDED_MS 400ms catch several dwell frames while expanded
+ * LIVE_POLL_EXPANDED_MS 800ms catch several dwell frames while expanded
* QUEUE_TO_SLOT_FLY_S 0.88s GSAP MotionPath slide into the cell
* land hold+fade ~0.30s ghost settle after onLand
* Pipeline: 选号 pill → (dwell) → fly into cell → onLand reveals model/elapsed
@@ -155,116 +148,6 @@ function kindPill(kind: MockJobKind): string {
}
}
-function DepthChart({
- series,
- bands,
- backpressure,
- label,
-}: {
- series: number[]
- bands: Array<{ from: number; until: number }>
- backpressure: number
- label: string
-}) {
- // Continuous glide: keep a stable x domain (0..n-1) while values scroll;
- // ease Y peak so scale changes don’t jump. Tick cadence ~260ms → linear ~560ms morph.
- const rawPeak = Math.max(backpressure, ...series, 1)
- const peakRef = useRef(rawPeak)
- const [peak, setPeak] = useState(rawPeak)
- useEffect(() => {
- if (prefersReducedMotion()) {
- peakRef.current = rawPeak
- setPeak(rawPeak)
- return
- }
- const from = peakRef.current
- const to = rawPeak
- if (Math.abs(to - from) < 0.01) return
- let raf = 0
- const t0 = performance.now()
- const dur = motionDuration(0.56) * 1000
- const tick = (now: number) => {
- const t = Math.min(1, (now - t0) / dur)
- // queue ease approx: 1 - (1-t)^3
- const e = 1 - Math.pow(1 - t, 3)
- const v = from + (to - from) * e
- peakRef.current = v
- setPeak(v)
- if (t < 1) raf = requestAnimationFrame(tick)
- }
- raf = requestAnimationFrame(tick)
- return () => cancelAnimationFrame(raf)
- }, [rawPeak])
-
- const data = useMemo(
- () => series.map((v, i) => ({ i, v, bp: backpressure })),
- [series, backpressure],
- )
- const bandRows = useMemo(
- () =>
- bands.map((band, idx) => {
- const n = Math.max(1, series.length - 1)
- return {
- key: idx,
- x1: band.from * n,
- x2: Math.max(band.from * n + 0.35, band.until * n),
- }
- }),
- [bands, series.length],
- )
- const yMax = Math.max(peak, backpressure, 1)
-
- return (
-
-
-
-
-
- {bandRows.map((b) => (
-
- ))}
-
-
-
-
-
-
-
-
-
-
-
- )
-}
-
function SlotBar({
slot,
jobById,
@@ -346,7 +229,7 @@ function SlotBar({
data-cell-id={cell?.id ?? ''}
data-cell-index={i}
data-cell-pending={reserved && !showChrome ? '' : undefined}
- className={`relative flex min-w-0 flex-1 flex-col justify-center overflow-hidden rounded-md px-1 ${
+ className={`relative flex min-w-0 flex-1 flex-col justify-center overflow-hidden rounded-[2px] px-1 ${
showChrome
? 'border border-foreground/14 bg-[var(--il-busy-fill)] text-foreground/85'
: 'bg-[var(--il-track)] opacity-55'
@@ -1751,12 +1634,14 @@ export function InflightLiveCard({
{depthLabel}