Spaces:
Sleeping
Sleeping
Sync from GitHub via hub-sync
Browse files51 unmodified lines525354555657425 unmodified lines48348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553651 unmodified lines| "doctor"| "urdf";export default function EpisodeViewer({org,dataset,425 unmodified lines}};const TabButton = ({tab,label,title,}: {tab: ActiveTab;label: string;title?: string;}) => {const active = activeTab === tab;return (<buttononClick={() => handleTabChange(tab)}title={title}className={`relative px-5 py-3 text-xs font-medium tracking-wide uppercase transition-colors ${active ? "text-cyan-300" : "text-slate-400 hover:text-slate-100"}`}>{label}<spanclassName={`pointer-events-none absolute bottom-0 left-3 right-3 h-px transition-all ${active? "bg-cyan-400 shadow-[0_0_8px_rgba(56,189,248,0.55)]": "bg-transparent"}`}/></button>);};return (<div className="flex flex-col h-screen max-h-screen bg-[var(--bg)] text-[var(--text-primary)]">{/* Top tab bar */}<div className="flex items-center border-b border-white/5 bg-[var(--surface-0)] shrink-0"><TabButton tab="episodes" label="Episodes" />{hasURDFSupport(datasetInfo.robot_type) &&datasetInfo.codebase_version >= "v3.0" && (<TabButton tab="urdf" label="3D Replay" />)}<TabButton tab="statistics" label="Statistics" /><TabButton tab="filtering" label="Filtering" /><TabButton tab="frames" label="Frames" /><TabButton tab="insights" label="Action Insights" /><TabButtontab="doctor"label="Doctor"title="Dataset quality diagnostics (powered by lerobot-doctor)"/><div className="ml-auto"><HfAuthButton variant="tab" /></div>51 unmodified lines5253545556575859606162636465666768697071727374757677787980818283848586878889909192425 unmodified lines51851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854951 unmodified lines| "doctor"| "urdf";// Hoisted to module scope. Defining inside EpisodeViewerInner created a new// component type on every parent render — and the parent re-renders ~12.5×/s// during playback because it consumes `currentTime` from useTime. React// would unmount and remount every tab on every tick.function TabButton({active,onClick,label,title,}: {active: boolean;onClick: () => void;label: string;title?: string;}) {return (<buttononClick={onClick}title={title}className={`relative px-5 py-3 text-xs font-medium tracking-wide uppercase transition-colors ${active ? "text-cyan-300" : "text-slate-400 hover:text-slate-100"}`}>{label}<spanclassName={`pointer-events-none absolute bottom-0 left-3 right-3 h-px transition-all ${active? "bg-cyan-400 shadow-[0_0_8px_rgba(56,189,248,0.55)]": "bg-transparent"}`}/></button>);}export default function EpisodeViewer({org,dataset,425 unmodified lines}};const renderTab = (tab: ActiveTab, label: string, title?: string) => (<TabButtonactive={activeTab === tab}onClick={() => handleTabChange(tab)}label={label}title={title}/>);return (<div className="flex flex-col h-screen max-h-screen bg-[var(--bg)] text-[var(--text-primary)]">{/* Top tab bar */}<div className="flex items-center border-b border-white/5 bg-[var(--surface-0)] shrink-0">{renderTab("episodes", "Episodes")}{hasURDFSupport(datasetInfo.robot_type) &&datasetInfo.codebase_version >= "v3.0" &&renderTab("urdf", "3D Replay")}{renderTab("statistics", "Statistics")}{renderTab("filtering", "Filtering")}{renderTab("frames", "Frames")}{renderTab("insights", "Action Insights")}{renderTab("doctor","Doctor","Dataset quality diagnostics (powered by lerobot-doctor)",)}<div className="ml-auto"><HfAuthButton variant="tab" /></div>
src/app/[org]/[dataset]/[episode]/episode-viewer.tsx+55-42