diff --git a/backend/server/src/index.ts b/backend/server/src/index.ts index 293f802..788c329 100644 --- a/backend/server/src/index.ts +++ b/backend/server/src/index.ts @@ -224,10 +224,11 @@ io.on("connection", async (socket) => { containers[data.sandboxId], sendLoadedEvent ) - await fileManagers[data.sandboxId].initialize() terminalManagers[data.sandboxId] = new TerminalManager( containers[data.sandboxId] ) + console.log(`terminal manager set up for ${data.sandboxId}`) + await fileManagers[data.sandboxId].initialize() } const fileManager = fileManagers[data.sandboxId] @@ -415,6 +416,12 @@ io.on("connection", async (socket) => { socket.on("createTerminal", async (id: string, callback) => { try { await lockManager.acquireLock(data.sandboxId, async () => { + let terminalManager = terminalManagers[data.sandboxId] + if (!terminalManager) { + terminalManager = terminalManagers[data.sandboxId] = + new TerminalManager(containers[data.sandboxId]) + } + await terminalManager.createTerminal(id, (responseString: string) => { socket.emit("terminalResponse", { id, data: responseString }) const port = extractPortNumber(responseString) diff --git a/frontend/app/globals.css b/frontend/app/globals.css index 762a30d..15f1ccf 100644 --- a/frontend/app/globals.css +++ b/frontend/app/globals.css @@ -99,6 +99,29 @@ ); /* violet 900 -> bg */ } +.light .gradient-button-bg { + background: radial-gradient( + circle at top, + #262626 0%, + #f5f5f5 50% + ); /* Dark gray -> Light gray */ +} + +.light .gradient-button { + background: radial-gradient( + circle at bottom, + hsl(0, 10%, 25%) -10%, + #9d9d9d 50% + ); /* Light gray -> Almost white */ +} + +.light .gradient-button-bg > div:hover { + background: radial-gradient( + circle at bottom, + hsl(0, 10%, 25%) -10%, + #9d9d9d 80% + ); /* Light gray -> Almost white */ +} .inline-decoration::before { content: "Generate"; color: #525252; diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index 9448c07..494079e 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -1,7 +1,7 @@ -import { ThemeProvider } from "@/components/layout/themeProvider" import { Toaster } from "@/components/ui/sonner" +import { ThemeProvider } from "@/components/ui/theme-provider" import { PreviewProvider } from "@/context/PreviewContext" -import { SocketProvider } from "@/context/SocketContext" +import { SocketProvider } from '@/context/SocketContext' import { ClerkProvider } from "@clerk/nextjs" import { Analytics } from "@vercel/analytics/react" import { GeistMono } from "geist/font/mono" @@ -25,8 +25,7 @@ export default function RootLayout({
Sandbox is an open-source cloud-based code editing environment with custom AI code autocompletion and real-time collaboration. -