+ )}
+ setShowPassportLogin(false)}
+ onLoginSuccess={handleLoginSuccess}
+ />
);
diff --git a/src/components/AIChat.tsx b/src/components/AIChat.tsx
index f2ddbae..682850d 100644
--- a/src/components/AIChat.tsx
+++ b/src/components/AIChat.tsx
@@ -33,18 +33,21 @@ export function AIChat({ currentCode }: AIChatProps) {
setIsLoading(true);
try {
- const promptText = `You are an expert Roblox Lua developer helping a user with their code. The user is working on this code:
-
-\`\`\`lua
-${currentCode}
-\`\`\`
-
-User question: ${userMessage}
-
-Provide helpful, concise answers. Include code examples when relevant. Keep responses friendly and encouraging.`;
+ // Context-aware prompt: include active code, file name, and platform
+ const promptText = `You are an expert Roblox Lua developer and code assistant.\n\nUser's active code:\n\n\`\`\`lua\n${currentCode}\n\`\`\`\n\nUser question: ${userMessage}\n\nIf the user asks for code completion, suggest the next line(s) of code.\nIf the user asks for an explanation, explain the code in simple terms.\nIf the user asks for platform-specific help, provide Roblox Lua answers.\n\nRespond with concise, friendly, and actionable advice. Include code examples inline when relevant.`;
const response = await window.spark.llm(promptText, 'gpt-4o-mini');
- setMessages((prev) => [...prev, { role: 'assistant', content: response }]);
+ // If the response contains code, show it in a highlighted block
+ const codeMatch = response.match(/```lua([\s\S]*?)```/);
+ if (codeMatch) {
+ setMessages((prev) => [
+ ...prev,
+ { role: 'assistant', content: response.replace(/```lua([\s\S]*?)```/, '') },
+ { role: 'assistant', content: `
${codeMatch[1].trim()}
` },
+ ]);
+ } else {
+ setMessages((prev) => [...prev, { role: 'assistant', content: response }]);
+ }
} catch (error) {
console.error('AI Error:', error);
toast.error('Failed to get AI response. Please try again.');
@@ -82,7 +85,11 @@ Provide helpful, concise answers. Include code examples when relevant. Keep resp
: 'bg-muted text-foreground'
}`}
>
-
{message.content}
+ {message.content.startsWith('
+ ) : (
+
{message.content}
+ )}
))}
diff --git a/src/components/AssetLibraryPanel.tsx b/src/components/AssetLibraryPanel.tsx
new file mode 100644
index 0000000..3ab2003
--- /dev/null
+++ b/src/components/AssetLibraryPanel.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { Card } from './ui/card';
+
+export function AssetLibraryPanel() {
+ return (
+
+
Asset Library
+
Manage cross-platform assets for your projects. (stub)
+
+ );
+}
diff --git a/src/components/CertificationPanel.tsx b/src/components/CertificationPanel.tsx
new file mode 100644
index 0000000..4e24785
--- /dev/null
+++ b/src/components/CertificationPanel.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { Card } from './ui/card';
+
+export function CertificationPanel() {
+ return (
+
+
Certification & Progress
+
Track curriculum completion and earn certificates. (stub)
+
+ );
+}
diff --git a/src/components/DesktopAppPanel.tsx b/src/components/DesktopAppPanel.tsx
new file mode 100644
index 0000000..0bbc924
--- /dev/null
+++ b/src/components/DesktopAppPanel.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { Card } from './ui/card';
+
+export function DesktopAppPanel() {
+ return (
+
+
Desktop App
+
Download and use the AeThex Studio desktop app. (stub)