mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-12 23:24:44 -05:00
refactor: simplify wizard UI by removing trial monitoring and robot control tabs, and streamlining monitoring panel props.
This commit is contained in:
@@ -491,12 +491,6 @@ export const WizardInterface = React.memo(function WizardInterface({
|
|||||||
}
|
}
|
||||||
right={
|
right={
|
||||||
<WizardMonitoringPanel
|
<WizardMonitoringPanel
|
||||||
trial={trial}
|
|
||||||
trialEvents={trialEvents}
|
|
||||||
isConnected={rosConnected}
|
|
||||||
wsError={undefined}
|
|
||||||
activeTab={monitoringPanelTab}
|
|
||||||
onTabChange={setMonitoringPanelTab}
|
|
||||||
rosConnected={rosConnected}
|
rosConnected={rosConnected}
|
||||||
rosConnecting={rosConnecting}
|
rosConnecting={rosConnecting}
|
||||||
rosError={rosError ?? undefined}
|
rosError={rosError ?? undefined}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
Zap,
|
Zap,
|
||||||
User,
|
User,
|
||||||
Bot,
|
Bot,
|
||||||
|
Eye,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import { Badge } from "~/components/ui/badge";
|
import { Badge } from "~/components/ui/badge";
|
||||||
@@ -28,10 +29,10 @@ interface StepData {
|
|||||||
name: string;
|
name: string;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
type:
|
type:
|
||||||
| "wizard_action"
|
| "wizard_action"
|
||||||
| "robot_action"
|
| "robot_action"
|
||||||
| "parallel_steps"
|
| "parallel_steps"
|
||||||
| "conditional_branch";
|
| "conditional_branch";
|
||||||
parameters: Record<string, unknown>;
|
parameters: Record<string, unknown>;
|
||||||
order: number;
|
order: number;
|
||||||
}
|
}
|
||||||
@@ -173,29 +174,25 @@ export function WizardControlPanel({
|
|||||||
value === "actions" ||
|
value === "actions" ||
|
||||||
value === "robot"
|
value === "robot"
|
||||||
) {
|
) {
|
||||||
onTabChange(value as "control" | "step" | "actions" | "robot");
|
onTabChange(value as "control" | "step" | "actions");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
className="flex min-h-0 flex-1 flex-col"
|
className="flex min-h-0 flex-1 flex-col"
|
||||||
>
|
>
|
||||||
<div className="border-b px-2 py-1">
|
<div className="border-b px-2 py-1">
|
||||||
<TabsList className="grid w-full grid-cols-4">
|
<TabsList className="grid w-full grid-cols-3">
|
||||||
<TabsTrigger value="control" className="text-xs">
|
<TabsTrigger value="control" className="text-xs">
|
||||||
<Settings className="mr-1 h-3 w-3" />
|
<Play className="mr-1 h-3 w-3" />
|
||||||
Control
|
Control
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="step" className="text-xs">
|
<TabsTrigger value="step" className="text-xs">
|
||||||
<Play className="mr-1 h-3 w-3" />
|
<Eye className="mr-1 h-3 w-3" />
|
||||||
Step
|
Step
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="actions" className="text-xs">
|
<TabsTrigger value="actions" className="text-xs">
|
||||||
<Zap className="mr-1 h-3 w-3" />
|
<Zap className="mr-1 h-3 w-3" />
|
||||||
Actions
|
Actions
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="robot" className="text-xs">
|
|
||||||
<Bot className="mr-1 h-3 w-3" />
|
|
||||||
Robot
|
|
||||||
</TabsTrigger>
|
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -270,13 +267,13 @@ export function WizardControlPanel({
|
|||||||
|
|
||||||
{(trial.status === "completed" ||
|
{(trial.status === "completed" ||
|
||||||
trial.status === "aborted") && (
|
trial.status === "aborted") && (
|
||||||
<Alert>
|
<Alert>
|
||||||
<CheckCircle className="h-4 w-4" />
|
<CheckCircle className="h-4 w-4" />
|
||||||
<AlertDescription className="text-sm">
|
<AlertDescription className="text-sm">
|
||||||
Trial has ended. All controls are disabled.
|
Trial has ended. All controls are disabled.
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Connection Status */}
|
{/* Connection Status */}
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -107,12 +107,15 @@ export function useWizardRos(
|
|||||||
if (!service) return;
|
if (!service) return;
|
||||||
|
|
||||||
const handleConnected = () => {
|
const handleConnected = () => {
|
||||||
if (!mountedRef.current) return;
|
console.log("[useWizardRos] handleConnected called, mountedRef:", mountedRef.current);
|
||||||
console.log("[useWizardRos] Connected to ROS bridge");
|
// Set state immediately, before checking mounted status
|
||||||
setIsConnected(true);
|
setIsConnected(true);
|
||||||
setIsConnecting(false);
|
setIsConnecting(false);
|
||||||
setConnectionError(null);
|
setConnectionError(null);
|
||||||
onConnectedRef.current?.();
|
|
||||||
|
if (mountedRef.current) {
|
||||||
|
onConnectedRef.current?.();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDisconnected = () => {
|
const handleDisconnected = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user