jurmy24 commited on
Commit
147427a
·
1 Parent(s): 0db4bdb

misc: remove animation buttons

Browse files
viewer/src/App.tsx CHANGED
@@ -7,7 +7,6 @@ import UrdfView from "./pages/UrdfView";
7
  import { ThemeProvider } from "./contexts/ThemeContext";
8
  import { DragAndDropProvider } from "./contexts/DragAndDropContext";
9
  import { UrdfProvider } from "./contexts/UrdfContext";
10
- import { MyListProvider } from "./hooks/use-my-list";
11
 
12
  const queryClient = new QueryClient();
13
 
@@ -17,36 +16,13 @@ const App = () => {
17
  <QueryClientProvider client={queryClient}>
18
  <TooltipProvider>
19
  <UrdfProvider>
20
- {/* TODO: check whether this is necessary <MyListProvider> */}
21
- <MyListProvider>
22
- <Toaster />
23
- <Sonner />
24
- <DragAndDropProvider>
25
- <UrdfView />
26
- </DragAndDropProvider>
27
- {/* <BrowserRouter>
28
- <Routes>
29
- <Route path="/" element={<Index />} />
30
- <Route
31
- path="/playground"
32
- element={
33
- <DragAndDropProvider>
34
- <UrdfView />
35
- </DragAndDropProvider>
36
- }
37
- />
38
- <Route path="/content/:id" element={<ContentDetail />} />
39
- <Route path="/my-list" element={<MyList />} />
40
- <Route path="/new" element={<NewAndPopular />} />
41
- <Route path="/explore" element={<Explore />} />
42
- <Route path="*" element={<NotFound />} />
43
- </Routes>
44
- </BrowserRouter> */}
45
- </MyListProvider>
46
  </UrdfProvider>
47
  </TooltipProvider>
48
- {/* https://tanstack.com/query/latest/docs/framework/react/devtools */}
49
- {/* <ReactQueryDevtools initialIsOpen={false} /> */}
50
  </QueryClientProvider>
51
  </ThemeProvider>
52
  );
 
7
  import { ThemeProvider } from "./contexts/ThemeContext";
8
  import { DragAndDropProvider } from "./contexts/DragAndDropContext";
9
  import { UrdfProvider } from "./contexts/UrdfContext";
 
10
 
11
  const queryClient = new QueryClient();
12
 
 
16
  <QueryClientProvider client={queryClient}>
17
  <TooltipProvider>
18
  <UrdfProvider>
19
+ <Toaster />
20
+ <Sonner />
21
+ <DragAndDropProvider>
22
+ <UrdfView />
23
+ </DragAndDropProvider>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </UrdfProvider>
25
  </TooltipProvider>
 
 
26
  </QueryClientProvider>
27
  </ThemeProvider>
28
  );
viewer/src/components/layout/Layout.tsx CHANGED
@@ -5,7 +5,6 @@ import { LayoutDashboard, PanelLeft, RotateCcw } from "lucide-react";
5
  import { useUrdf } from "@/hooks/useUrdf";
6
  import { Button } from "../ui/button";
7
  import { useTheme } from "@/hooks/useTheme";
8
- import AnimationDialog from "../AnimationDialog";
9
  import RobotParameters from "../RobotParameters";
10
 
11
  // Calculate header height - should match your Header component height
@@ -13,7 +12,6 @@ const HEADER_HEIGHT = 0; // in pixels - adjust if your header is different
13
 
14
  const Layout: React.FC = () => {
15
  const [open, setOpen] = useState(true);
16
- const [animationDialogOpen, setAnimationDialogOpen] = useState(false);
17
  const { theme } = useTheme();
18
 
19
  // Use the centralized UrdfContext for all robot data
@@ -39,9 +37,6 @@ const Layout: React.FC = () => {
39
  setOpen(true);
40
  }, []);
41
 
42
- // Get the robot name from currentRobotData
43
- const robotName = currentRobotData?.name || "Robot";
44
-
45
  // Calculate if we have a custom animation
46
  const hasCustomAnimation = currentAnimationConfig !== null;
47
 
@@ -66,7 +61,6 @@ const Layout: React.FC = () => {
66
  headerHeight={HEADER_HEIGHT}
67
  />
68
  </div>
69
-
70
  {/* Sidebar positioned above with z-index, with top padding for header */}
71
  <div
72
  className="absolute inset-y-0 left-0 z-10"
@@ -77,7 +71,7 @@ const Layout: React.FC = () => {
77
  <SidebarBody className="justify-between gap-10">
78
  <div className="flex flex-col flex-1 overflow-y-auto overflow-x-hidden">
79
  <div className="flex items-center justify-between mb-4 mt-2 px-2">
80
- <h2 className="text-xl font-bold tracking-tight font-mono">
81
  {currentRobotData?.name || "Robot Model"}
82
  </h2>
83
  <div className="flex items-center space-x-2">
@@ -120,21 +114,6 @@ const Layout: React.FC = () => {
120
 
121
  <div className="sidebar-divider" />
122
  <RobotParameters />
123
- <div className="sidebar-divider" />
124
-
125
- <div className="sidebar-section">
126
- <div
127
- className="bg-sidebar-accent rounded-lg p-3 flex items-center justify-center hover:bg-sidebar-accent/80 cursor-pointer transition-colors"
128
- onClick={() => setAnimationDialogOpen(true)}
129
- >
130
- <span className="text-sidebar-accent-foreground font-medium font-mono text-sm">
131
- Run an animation
132
- </span>
133
- </div>
134
- <div className="text-xs text-muted-foreground mt-2 text-left font-mono">
135
- See the robot move any way you want.
136
- </div>
137
- </div>
138
  </div>
139
  </div>
140
  </SidebarBody>
@@ -160,13 +139,6 @@ const Layout: React.FC = () => {
160
  </div>
161
  )}
162
  </div>
163
-
164
- {/* Animation Dialog - moved to root level to prevent accessibility issues */}
165
- <AnimationDialog
166
- open={animationDialogOpen}
167
- onOpenChange={setAnimationDialogOpen}
168
- robotName={robotName}
169
- />
170
  </div>
171
  );
172
  };
 
5
  import { useUrdf } from "@/hooks/useUrdf";
6
  import { Button } from "../ui/button";
7
  import { useTheme } from "@/hooks/useTheme";
 
8
  import RobotParameters from "../RobotParameters";
9
 
10
  // Calculate header height - should match your Header component height
 
12
 
13
  const Layout: React.FC = () => {
14
  const [open, setOpen] = useState(true);
 
15
  const { theme } = useTheme();
16
 
17
  // Use the centralized UrdfContext for all robot data
 
37
  setOpen(true);
38
  }, []);
39
 
 
 
 
40
  // Calculate if we have a custom animation
41
  const hasCustomAnimation = currentAnimationConfig !== null;
42
 
 
61
  headerHeight={HEADER_HEIGHT}
62
  />
63
  </div>
 
64
  {/* Sidebar positioned above with z-index, with top padding for header */}
65
  <div
66
  className="absolute inset-y-0 left-0 z-10"
 
71
  <SidebarBody className="justify-between gap-10">
72
  <div className="flex flex-col flex-1 overflow-y-auto overflow-x-hidden">
73
  <div className="flex items-center justify-between mb-4 mt-2 px-2">
74
+ <h2 className="text-xl font-bold tracking-tight font-mono overflow-x-auto whitespace-nowrap scrollbar-none max-w-[200px] pr-2">
75
  {currentRobotData?.name || "Robot Model"}
76
  </h2>
77
  <div className="flex items-center space-x-2">
 
114
 
115
  <div className="sidebar-divider" />
116
  <RobotParameters />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  </div>
118
  </div>
119
  </SidebarBody>
 
139
  </div>
140
  )}
141
  </div>
 
 
 
 
 
 
 
142
  </div>
143
  );
144
  };