Skip to content

Commit 04b394b

Browse files
committed
Integrate with VSCode webview extension
1 parent 50f9978 commit 04b394b

File tree

20 files changed

+374
-186
lines changed

20 files changed

+374
-186
lines changed

app/layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import "./globals.css";
44
import { WrappedNextUIProvider } from "../components/providers/wrapped-next-ui-provider";
55
import EditorContextProvider from "@/components/providers/editor-context-provider";
66
import { Toaster } from "react-hot-toast";
7-
import { EditorStates } from "@/lib/types";
87
import "material-icons/iconfont/material-icons.css";
98
import CapacitorProvider from "@/components/providers/capacitor-provider";
109
import Nav from "@/components/nav";
@@ -31,7 +30,7 @@ export default function RootLayout({
3130
children: React.ReactNode;
3231
}>) {
3332
return (
34-
<html lang="en">
33+
<html lang="en" suppressHydrationWarning>
3534
<body
3635
className={`${geistSans.variable} ${geistMono.variable} h-screen w-screen antialiased`}
3736
>

app/page.tsx

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import AgentChatTerminalView from "@/components/views/agent-chat-terminal-view";
1414
import { AnimatePresence, motion } from "framer-motion";
1515
import { ViewDocument, ViewRef } from "@/lib/types";
1616
import EditorToolbar from "@/components/editor-toolbar";
17-
import { getPlatform } from "@/lib/platforms/platform-checker";
1817
import { EditorContext } from "@/components/providers/editor-context-provider";
1918

2019
export default function Home() {
@@ -113,12 +112,6 @@ export default function Home() {
113112
},
114113
});
115114

116-
// Check platform
117-
useEffect(() => {
118-
const platform = getPlatform();
119-
console.log("Platform:", platform);
120-
}, []);
121-
122115
// Load models
123116
useEffect(() => {
124117
if (editorContext?.persistSettings) {
@@ -184,30 +177,30 @@ export default function Home() {
184177
}
185178
}, [editorContext?.editorStates, vad]);
186179

187-
useEffect(() => {
188-
const url = "/test.tsx";
189-
if (url) {
190-
fetch(url)
191-
.then((res) => res.text())
192-
.then((text) => {
193-
const viewId = "1";
194-
195-
// Init a new viewDocument
196-
const viewDocument: ViewDocument = {
197-
fileContent: text,
198-
filePath: url,
199-
};
200-
201-
// Get the code editor view
202-
const codeEditor = editorContext?.getViewById(
203-
viewId,
204-
) as CodeEditorViewRef;
205-
206-
// Set the viewDocument
207-
codeEditor?.setViewDocument(viewDocument);
208-
});
209-
}
210-
}, []);
180+
// useEffect(() => {
181+
// const url = "/test.tsx";
182+
// if (url) {
183+
// fetch(url)
184+
// .then((res) => res.text())
185+
// .then((text) => {
186+
// const viewId = "1";
187+
188+
// // Init a new viewDocument
189+
// const viewDocument: ViewDocument = {
190+
// fileContent: text,
191+
// filePath: url,
192+
// };
193+
194+
// // Get the code editor view
195+
// const codeEditor = editorContext?.getViewById(
196+
// viewId,
197+
// ) as CodeEditorViewRef;
198+
199+
// // Set the viewDocument
200+
// codeEditor?.setViewDocument(viewDocument);
201+
// });
202+
// }
203+
// }, []);
211204

212205
return (
213206
<div className="flex h-full w-full flex-col">

components/canvas/canvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { convexHull, Point } from "@/lib/canvas/convex-hull";
44
import { DrawnLine } from "@/lib/types";
55
import Konva from "konva";
66
import { Stage as StageType } from "konva/lib/Stage";
7-
import { useTheme } from "next-themes";
87
import { useEffect, useRef, useState } from "react";
98
import { Stage, Layer, Line, Text } from "react-konva";
109
import { recognizeText } from "@/lib/image-processing/ocr";

components/loading.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Progress } from "@nextui-org/react";
2+
3+
export default function Loading() {
4+
return (
5+
<div className="flex h-full w-full flex-col items-center justify-center dark:bg-[#27272A]">
6+
<Progress
7+
isIndeterminate={true}
8+
className="w-1/2 text-black dark:text-white"
9+
color="default"
10+
size="md"
11+
label="Loading..."
12+
classNames={{
13+
label: "w-full text-center",
14+
}}
15+
/>
16+
</div>
17+
);
18+
}

0 commit comments

Comments
 (0)