From a05ad13e6775784ec6a16acbf5329b7e05aeacbe Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 14:14:10 -0500 Subject: [PATCH 01/37] Don't send tool_choice param --- src/lib/SessionManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/SessionManager.ts b/src/lib/SessionManager.ts index 19978226..fcf9493b 100644 --- a/src/lib/SessionManager.ts +++ b/src/lib/SessionManager.ts @@ -250,7 +250,6 @@ export class SessionManager { model, messages, tools: session.tools && Object.keys(session.tools).length > 0 ? Object.values(session.tools) : undefined, - tool_choice: session.tools && Object.keys(session.tools).length > 0 ? 'auto' : undefined, stream: true, stream_options: { include_usage: true, From 57a80ad33d6f0478f3aff3cbb2f74af4fdd05450 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 14:38:38 -0500 Subject: [PATCH 02/37] Fix Gemini model tool_calls --- src/lib/SessionManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/SessionManager.ts b/src/lib/SessionManager.ts index fcf9493b..fde41dd3 100644 --- a/src/lib/SessionManager.ts +++ b/src/lib/SessionManager.ts @@ -300,9 +300,9 @@ export class SessionManager { } if (delta?.tool_calls) { - for (const toolCallDelta of delta.tool_calls) { - const index = toolCallDelta.index; - if (index === undefined) continue; + for (let i = 0; i < delta.tool_calls.length; i++) { + const toolCallDelta = delta.tool_calls[i]; + const index = toolCallDelta.index ?? i; // Fix for Gemini models accumulatedToolCalls[index] ??= { id: '', From ca334d758555ca3e21537e8645939ce1d267397e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 17:18:00 -0500 Subject: [PATCH 03/37] Hide model search input unless there are >= 5 models --- src/components/ModelSelector.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ModelSelector.tsx b/src/components/ModelSelector.tsx index 590bca08..767f510c 100644 --- a/src/components/ModelSelector.tsx +++ b/src/components/ModelSelector.tsx @@ -168,7 +168,9 @@ export function ModelSelector({ - {isConfigured && } + {(isConfigured && models.length >= 5) && ( + + )}
From dc50d41928ccb14a3dd6b3e68ab9252c0eb28113 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 17:39:03 -0500 Subject: [PATCH 04/37] Add virtual terminal to Code tab --- src/components/Shakespeare/PreviewPane.tsx | 138 +++++++---- src/components/Terminal.tsx | 259 +++++++++++++++++++++ 2 files changed, 357 insertions(+), 40 deletions(-) create mode 100644 src/components/Terminal.tsx diff --git a/src/components/Shakespeare/PreviewPane.tsx b/src/components/Shakespeare/PreviewPane.tsx index 2736683a..53da503c 100644 --- a/src/components/Shakespeare/PreviewPane.tsx +++ b/src/components/Shakespeare/PreviewPane.tsx @@ -8,7 +8,7 @@ import { useBuildProject } from '@/hooks/useBuildProject'; import { Tabs, TabsContent } from '@/components/ui/tabs'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; import { Button } from '@/components/ui/button'; -import { FolderOpen, ArrowLeft, Bug, Copy, Check, Play, Loader2, MenuIcon, Code, CloudUpload, X } from 'lucide-react'; +import { FolderOpen, ArrowLeft, Bug, Copy, Check, Play, Loader2, MenuIcon, Code, CloudUpload, X, Terminal } from 'lucide-react'; import { useIsMobile } from '@/hooks/useIsMobile'; import { GitStatusIndicator } from '@/components/GitStatusIndicator'; import { BrowserAddressBar } from '@/components/ui/browser-address-bar'; @@ -27,6 +27,7 @@ import { cn } from '@/lib/utils'; import { FileTree } from './FileTree'; import { FileEditor } from './FileEditor'; import { DeployDialog } from '@/components/DeployDialog'; +import { Terminal as TerminalComponent } from '@/components/Terminal'; import { useSearchParams } from 'react-router-dom'; // Get iframe domain from environment variable @@ -76,7 +77,8 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o const [selectedFile, setSelectedFile] = useState(null); const [fileContent, setFileContent] = useState(''); const [isLoading, setIsLoading] = useState(false); - const [mobileCodeView, setMobileCodeView] = useState<'explorer' | 'editor'>('explorer'); + const [mobileCodeView, setMobileCodeView] = useState<'explorer' | 'editor' | 'terminal'>('explorer'); + const [desktopCodeView, setDesktopCodeView] = useState<'files' | 'terminal'>('files'); const isMobile = useIsMobile(); const [hasBuiltProject, setHasBuiltProject] = useState(false); const [currentPath, setCurrentPath] = useState('/'); @@ -455,6 +457,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o setSelectedFile(null); setFileContent(''); setMobileCodeView('explorer'); + setDesktopCodeView('files'); // Reset navigation history and state setCurrentPath('/'); @@ -731,16 +734,47 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o {isMobile ? (
{mobileCodeView === 'explorer' ? ( - - -
- +
+ + +
+ +
+
+ {/* Floating Terminal Button */} + +
+ ) : mobileCodeView === 'terminal' ? ( + <> +
+ +

+ Terminal +

+
- +
+ +
+ ) : ( <>
@@ -803,6 +837,14 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o {t('backToPreview')}
+
)} @@ -810,43 +852,59 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o {!isMobile && !isPreviewable && (
+
)}
-
- - -
- + {desktopCodeView === 'terminal' ? ( +
+ +
+ ) : ( + <> +
+ + +
+ +
+
- -
-
- {selectedFile ? ( - - ) : ( -
-
-

- {t('selectFileFromExplorer')} -

-
+
+ {selectedFile ? ( + + ) : ( +
+
+

+ {t('selectFileFromExplorer')} +

+
+
+ )}
- )} -
+ + )}
)} diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx new file mode 100644 index 00000000..3f573701 --- /dev/null +++ b/src/components/Terminal.tsx @@ -0,0 +1,259 @@ +import { useState, useRef, useEffect, useCallback } from 'react'; +import { ScrollArea } from '@/components/ui/scroll-area'; +import { Button } from '@/components/ui/button'; +import { X, Copy, Trash2 } from 'lucide-react'; +import { cn } from '@/lib/utils'; +import { ShellTool } from '@/lib/tools/ShellTool'; +import { useFS } from '@/hooks/useFS'; +import { useGit } from '@/hooks/useGit'; + +interface TerminalProps { + projectId: string; + onClose?: () => void; + className?: string; +} + +interface TerminalLine { + id: string; + type: 'input' | 'output' | 'error'; + content: string; + timestamp: Date; +} + +export function Terminal({ projectId, onClose, className }: TerminalProps) { + const [lines, setLines] = useState([]); + const [currentInput, setCurrentInput] = useState(''); + const [isExecuting, setIsExecuting] = useState(false); + const [commandHistory, setCommandHistory] = useState([]); + const [historyIndex, setHistoryIndex] = useState(-1); + const [currentWorkingDirectory, setCurrentWorkingDirectory] = useState(`/projects/${projectId}`); + + const inputRef = useRef(null); + const scrollRef = useRef(null); + const shellToolRef = useRef(null); + + const { fs } = useFS(); + const { git } = useGit(); + + // Initialize ShellTool + useEffect(() => { + shellToolRef.current = new ShellTool(fs, `/projects/${projectId}`, git); + + // Add welcome message + setLines([{ + id: Date.now().toString(), + type: 'output', + content: `Welcome to Shakespeare Terminal\nProject: ${projectId}\nType 'help' to see available commands.`, + timestamp: new Date() + }]); + }, [projectId, fs, git]); + + // Auto-scroll to bottom when new lines are added + useEffect(() => { + if (scrollRef.current) { + scrollRef.current.scrollTop = scrollRef.current.scrollHeight; + } + }, [lines]); + + // Focus input when component mounts + useEffect(() => { + if (inputRef.current) { + inputRef.current.focus(); + } + }, []); + + const addLine = useCallback((type: TerminalLine['type'], content: string) => { + const newLine: TerminalLine = { + id: Date.now().toString() + Math.random(), + type, + content, + timestamp: new Date() + }; + setLines(prev => [...prev, newLine]); + }, []); + + const executeCommand = useCallback(async (command: string) => { + if (!shellToolRef.current || !command.trim()) return; + + // Add command to history + if (command.trim() && !commandHistory.includes(command.trim())) { + setCommandHistory(prev => [...prev, command.trim()]); + } + setHistoryIndex(-1); + + // Add input line + addLine('input', `$ ${command}`); + + setIsExecuting(true); + + try { + // Handle special help command + if (command.trim().toLowerCase() === 'help') { + const availableCommands = shellToolRef.current.getAvailableCommands(); + const helpText = `Available commands:\n\n${availableCommands.map(cmd => + `${cmd.name.padEnd(12)} - ${cmd.description}` + ).join('\n')}\n\nUse 'which ' for more details about a specific command.`; + addLine('output', helpText); + } else { + const result = await shellToolRef.current.execute({ command }); + + // Update current working directory + const newCwd = shellToolRef.current.getCurrentWorkingDirectory(); + setCurrentWorkingDirectory(newCwd); + + // Add output + if (result && result.trim()) { + addLine('output', result); + } + } + } catch (error) { + addLine('error', `Error: ${error instanceof Error ? error.message : 'Unknown error'}`); + } finally { + setIsExecuting(false); + } + }, [addLine, commandHistory]); + + const handleSubmit = useCallback((e: React.FormEvent) => { + e.preventDefault(); + if (currentInput.trim() && !isExecuting) { + executeCommand(currentInput); + setCurrentInput(''); + } + }, [currentInput, isExecuting, executeCommand]); + + const handleKeyDown = useCallback((e: React.KeyboardEvent) => { + if (e.key === 'ArrowUp') { + e.preventDefault(); + if (commandHistory.length > 0) { + const newIndex = historyIndex === -1 ? commandHistory.length - 1 : Math.max(0, historyIndex - 1); + setHistoryIndex(newIndex); + setCurrentInput(commandHistory[newIndex]); + } + } else if (e.key === 'ArrowDown') { + e.preventDefault(); + if (historyIndex >= 0) { + const newIndex = historyIndex + 1; + if (newIndex >= commandHistory.length) { + setHistoryIndex(-1); + setCurrentInput(''); + } else { + setHistoryIndex(newIndex); + setCurrentInput(commandHistory[newIndex]); + } + } + } else if (e.key === 'Tab') { + e.preventDefault(); + // Basic tab completion could be added here + } + }, [commandHistory, historyIndex]); + + const copyToClipboard = useCallback(async (content: string) => { + try { + await navigator.clipboard.writeText(content); + } catch (error) { + console.error('Failed to copy to clipboard:', error); + } + }, []); + + const clearTerminal = useCallback(() => { + setLines([]); + }, []); + + const getPrompt = () => { + const relativePath = currentWorkingDirectory.replace(`/projects/${projectId}`, '') || '/'; + return `${projectId}:${relativePath}$`; + }; + + return ( +
+ {/* Terminal Header */} +
+
+
+
+
+
+
+ Terminal - {projectId} +
+
+ + {onClose && ( + + )} +
+
+ + {/* Terminal Content */} +
+ +
+ {lines.map((line) => ( +
+
+                  {line.content}
+                
+ +
+ ))} + {isExecuting && ( +
+ Executing... +
+ )} +
+
+ + {/* Command Input */} +
+
+ + {getPrompt()} + + setCurrentInput(e.target.value)} + onKeyDown={handleKeyDown} + disabled={isExecuting} + className="flex-1 bg-transparent border-none outline-none text-green-400 font-mono text-xs placeholder-gray-500" + placeholder="Enter command..." + autoComplete="off" + spellCheck="false" + /> +
+
+
+
+ ); +} \ No newline at end of file From 3b3637009d16db8198e065c0f6bbd96159c4624f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 18:01:40 -0500 Subject: [PATCH 05/37] Fix focus in TUI --- src/components/Terminal.tsx | 75 ++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 3f573701..7f26d6e9 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -48,12 +48,12 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { }]); }, [projectId, fs, git]); - // Auto-scroll to bottom when new lines are added + // Auto-scroll to bottom when new lines are added or execution state changes useEffect(() => { if (scrollRef.current) { scrollRef.current.scrollTop = scrollRef.current.scrollHeight; } - }, [lines]); + }, [lines, isExecuting]); // Focus input when component mounts useEffect(() => { @@ -62,6 +62,13 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { } }, []); + // Refocus input after command execution + useEffect(() => { + if (!isExecuting && inputRef.current) { + inputRef.current.focus(); + } + }, [isExecuting]); + const addLine = useCallback((type: TerminalLine['type'], content: string) => { const newLine: TerminalLine = { id: Date.now().toString() + Math.random(), @@ -164,6 +171,13 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { return `${projectId}:${relativePath}$`; }; + // Focus input when clicking anywhere in the terminal + const handleTerminalClick = useCallback(() => { + if (inputRef.current) { + inputRef.current.focus(); + } + }, []); + return (
{/* Terminal Header */} @@ -199,7 +213,7 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) {
{/* Terminal Content */} -
+
{lines.map((line) => ( @@ -218,7 +232,10 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) {
)} + + {/* Current Command Input - inline with content */} + {!isExecuting && ( +
+ + {getPrompt()} + +
+ setCurrentInput(e.target.value)} + onKeyDown={handleKeyDown} + disabled={isExecuting} + className="w-full bg-transparent border-none outline-none text-green-400 font-mono text-xs placeholder-gray-500 caret-green-400" + placeholder="" + autoComplete="off" + spellCheck="false" + /> + {/* Blinking cursor when input is empty */} + {!currentInput && ( + + _ + + )} +
+
+ )}
- - {/* Command Input */} -
-
- - {getPrompt()} - - setCurrentInput(e.target.value)} - onKeyDown={handleKeyDown} - disabled={isExecuting} - className="flex-1 bg-transparent border-none outline-none text-green-400 font-mono text-xs placeholder-gray-500" - placeholder="Enter command..." - autoComplete="off" - spellCheck="false" - /> -
-
); From deb593c1b6355e2fb1dfdfc0e5a93311ac5cfc75 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 18:09:13 -0500 Subject: [PATCH 06/37] Improve terminal input display --- src/components/Terminal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 7f26d6e9..366f4d52 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -252,7 +252,7 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { {!isExecuting && (
- {getPrompt()} + $
Date: Fri, 26 Sep 2025 18:42:41 -0500 Subject: [PATCH 07/37] Improve terminal UX --- src/components/Shakespeare/PreviewPane.tsx | 16 ++-- src/components/Terminal.tsx | 87 +++++----------------- 2 files changed, 25 insertions(+), 78 deletions(-) diff --git a/src/components/Shakespeare/PreviewPane.tsx b/src/components/Shakespeare/PreviewPane.tsx index 53da503c..9286dbd0 100644 --- a/src/components/Shakespeare/PreviewPane.tsx +++ b/src/components/Shakespeare/PreviewPane.tsx @@ -750,26 +750,25 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o variant="outline" size="sm" onClick={() => setMobileCodeView('terminal')} - className="absolute bottom-4 right-4 h-10 w-10 p-0 rounded-full shadow-lg bg-background border-2" + className="absolute bottom-4 right-4 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2" > - +
) : mobileCodeView === 'terminal' ? ( <> -
+
-

- Terminal -

-
@@ -845,7 +844,6 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o > -
)} {/* Code view header without back button for non-previewable projects */} diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 366f4d52..6325ad3f 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -1,7 +1,7 @@ import { useState, useRef, useEffect, useCallback } from 'react'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Button } from '@/components/ui/button'; -import { X, Copy, Trash2 } from 'lucide-react'; +import { Copy } from 'lucide-react'; import { cn } from '@/lib/utils'; import { ShellTool } from '@/lib/tools/ShellTool'; import { useFS } from '@/hooks/useFS'; @@ -9,7 +9,6 @@ import { useGit } from '@/hooks/useGit'; interface TerminalProps { projectId: string; - onClose?: () => void; className?: string; } @@ -20,13 +19,12 @@ interface TerminalLine { timestamp: Date; } -export function Terminal({ projectId, onClose, className }: TerminalProps) { +export function Terminal({ projectId, className }: TerminalProps) { const [lines, setLines] = useState([]); const [currentInput, setCurrentInput] = useState(''); const [isExecuting, setIsExecuting] = useState(false); const [commandHistory, setCommandHistory] = useState([]); const [historyIndex, setHistoryIndex] = useState(-1); - const [currentWorkingDirectory, setCurrentWorkingDirectory] = useState(`/projects/${projectId}`); const inputRef = useRef(null); const scrollRef = useRef(null); @@ -43,7 +41,7 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { setLines([{ id: Date.now().toString(), type: 'output', - content: `Welcome to Shakespeare Terminal\nProject: ${projectId}\nType 'help' to see available commands.`, + content: `Welcome to Shakespeare Terminal\nType 'help' to see available commands.`, timestamp: new Date() }]); }, [projectId, fs, git]); @@ -89,25 +87,23 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { setHistoryIndex(-1); // Add input line - addLine('input', `$ ${command}`); + addLine('input', command); setIsExecuting(true); try { // Handle special help command - if (command.trim().toLowerCase() === 'help') { + if (command.trim() === 'help') { const availableCommands = shellToolRef.current.getAvailableCommands(); const helpText = `Available commands:\n\n${availableCommands.map(cmd => `${cmd.name.padEnd(12)} - ${cmd.description}` ).join('\n')}\n\nUse 'which ' for more details about a specific command.`; addLine('output', helpText); + } else if (command.trim() === 'clear') { + setLines([]); } else { const result = await shellToolRef.current.execute({ command }); - // Update current working directory - const newCwd = shellToolRef.current.getCurrentWorkingDirectory(); - setCurrentWorkingDirectory(newCwd); - // Add output if (result && result.trim()) { addLine('output', result); @@ -162,15 +158,6 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { } }, []); - const clearTerminal = useCallback(() => { - setLines([]); - }, []); - - const getPrompt = () => { - const relativePath = currentWorkingDirectory.replace(`/projects/${projectId}`, '') || '/'; - return `${projectId}:${relativePath}$`; - }; - // Focus input when clicking anywhere in the terminal const handleTerminalClick = useCallback(() => { if (inputRef.current) { @@ -179,39 +166,7 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { }, []); return ( -
- {/* Terminal Header */} -
-
-
-
-
-
-
- Terminal - {projectId} -
-
- - {onClose && ( - - )} -
-
- +
{/* Terminal Content */}
@@ -221,12 +176,17 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { key={line.id} className={cn( "group relative", - line.type === 'input' && "text-blue-400", + line.type === 'input' && "text-white", line.type === 'error' && "text-red-400", - line.type === 'output' && "text-green-400" + line.type === 'output' && "text-slate-300" )} > -
+                
+                  {line.type === 'input' ? (
+                    
+                      ${' '}
+                    
+                  ) : null}
                   {line.content}
                 
))} - {isExecuting && ( -
- Executing... -
- )} {/* Current Command Input - inline with content */} {!isExecuting && (
- + $ @@ -262,17 +217,11 @@ export function Terminal({ projectId, onClose, className }: TerminalProps) { onChange={(e) => setCurrentInput(e.target.value)} onKeyDown={handleKeyDown} disabled={isExecuting} - className="w-full bg-transparent border-none outline-none text-green-400 font-mono text-xs placeholder-gray-500 caret-green-400" + className="w-full bg-transparent border-none outline-none text-white font-mono placeholder-gray-500 caret-white leading-relaxedFP" placeholder="" autoComplete="off" spellCheck="false" /> - {/* Blinking cursor when input is empty */} - {!currentInput && ( - - _ - - )}
)} From 48dfd2d99ef3f261f7731dde275c79812ee8b927 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 19:00:07 -0500 Subject: [PATCH 08/37] Fix mobile terminal issues --- src/components/Shakespeare/PreviewPane.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Shakespeare/PreviewPane.tsx b/src/components/Shakespeare/PreviewPane.tsx index 9286dbd0..366c8fa2 100644 --- a/src/components/Shakespeare/PreviewPane.tsx +++ b/src/components/Shakespeare/PreviewPane.tsx @@ -750,14 +750,14 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o variant="outline" size="sm" onClick={() => setMobileCodeView('terminal')} - className="absolute bottom-4 right-4 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2" + className="fixed bottom-12 right-4 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2" >
) : mobileCodeView === 'terminal' ? ( <> -
+
From c1cbbed05c666504829004a70da659e5f00a36a0 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 20:33:48 -0500 Subject: [PATCH 12/37] About page improvements --- src/lib/i18n.ts | 6 ----- src/pages/AboutSettings.tsx | 45 +++++++++++++------------------------ 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index d1784ff1..c10614a4 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -207,7 +207,6 @@ const resources = { aboutShakespeare: 'About Shakespeare', aboutShakespeareDescription: 'Information about Shakespeare', sourceCode: 'Source Code', - viewOnGitLab: 'View on GitLab', description: 'Description', license: 'License', loadingLicense: 'Loading license...', @@ -561,7 +560,6 @@ const resources = { aboutShakespeare: 'Sobre o Shakespeare', aboutShakespeareDescription: 'Informações sobre o Shakespeare.', sourceCode: 'Código-fonte', - viewOnGitLab: 'Ver no GitLab', description: 'Descrição', license: 'Licença', loadingLicense: 'Carregando licença...', @@ -874,7 +872,6 @@ const resources = { aboutShakespeare: '关于Shakespeare', aboutShakespeareDescription: '关于Shakespeare的信息。', sourceCode: '源代码', - viewOnGitLab: '在GitLab上查看', description: '描述', license: '许可证', loadingLicense: '加载许可证中...', @@ -1187,7 +1184,6 @@ const resources = { aboutShakespeare: 'Game da Shakespeare', aboutShakespeareDescription: 'Bayani game da Shakespeare.', sourceCode: 'Lambar Tushe', - viewOnGitLab: 'Duba akan GitLab', description: 'Bayanin', license: 'Lasisi', loadingLicense: 'Ana lodin lasisi...', @@ -1500,7 +1496,6 @@ const resources = { aboutShakespeare: 'Nipa Shakespeare', aboutShakespeareDescription: 'Alaye nipa Shakespeare.', sourceCode: 'Koodu Orisun', - viewOnGitLab: 'Wo lori GitLab', description: 'Apejuwe', license: 'Iwe-aṣẹ', loadingLicense: 'N gbe iwe-aṣẹ...', @@ -1808,7 +1803,6 @@ const resources = { aboutShakespeare: 'Gbasara Shakespeare', aboutShakespeareDescription: 'Ozi gbasara Shakespeare.', sourceCode: 'Koodu Isi', - viewOnGitLab: 'Lee na GitLab', description: 'Nkọwa', license: 'Ikike', loadingLicense: 'Na-ebu ikike...', diff --git a/src/pages/AboutSettings.tsx b/src/pages/AboutSettings.tsx index c42dd692..8c577b8f 100644 --- a/src/pages/AboutSettings.tsx +++ b/src/pages/AboutSettings.tsx @@ -3,7 +3,6 @@ import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Info, ExternalLink, Loader2, AlertTriangle, ArrowLeft } from 'lucide-react'; import { Button } from '@/components/ui/button'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { useIsMobile } from '@/hooks/useIsMobile'; @@ -80,33 +79,21 @@ export function AboutSettings() {
{/* Project Information */} - - - - - {t('sourceCode')} - - - - - - + {/* License */} @@ -131,7 +118,7 @@ export function AboutSettings() { ) : license ? ( -
+
) : null} From a45e29578c30479a5b8f3460e2e30ff457d519f1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 20:49:02 -0500 Subject: [PATCH 13/37] Fix pulling --- src/lib/git.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/git.ts b/src/lib/git.ts index e19666e2..93dcc008 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -1313,6 +1313,7 @@ export class Git { dir: options.dir, ref: `refs/heads/${currentBranch}`, value: upstreamCommit, + force: true, }); // Update the working directory From fba1328e5f1b5fa7055fdf4ef7a386992c18a6d0 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 21:07:11 -0500 Subject: [PATCH 14/37] Build after pulling --- src/components/GitDialog.tsx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index 1aa22072..b2c4d6b5 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -62,6 +62,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog const [isPushingToNostr, setIsPushingToNostr] = useState(false); const [originUrl, setOriginUrl] = useState(''); const [isSavingOrigin, setIsSavingOrigin] = useState(false); + const [searchParams, setSearchParams] = useSearchParams(); const navigate = useNavigate(); const { data: gitStatus, refetch: refetchGitStatus } = useGitStatus(projectId); @@ -425,6 +426,12 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog try { const remote = gitStatus.remotes[0]; // Use first remote (usually 'origin') + // Get the current HEAD commit before pulling + const beforeCommit = await git.resolveRef({ + dir: projectPath, + ref: 'HEAD', + }); + await git.pull({ dir: projectPath, ref: gitStatus.currentBranch, @@ -436,14 +443,31 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog onAuth: (url) => findCredentialsForRepo(url, settings.credentials), }); + // Get the current HEAD commit after pulling + const afterCommit = await git.resolveRef({ + dir: projectPath, + ref: 'HEAD', + }); + + // Check if the repository actually changed + const repoChanged = beforeCommit !== afterCommit; toast({ title: "Pull successful", - description: `Latest changes pulled from ${remote.name}/${gitStatus.currentBranch}`, + description: repoChanged + ? `Latest changes pulled from ${remote.name}/${gitStatus.currentBranch}` + : `Already up to date with ${remote.name}/${gitStatus.currentBranch}`, }); // Refresh git status after pull await refetchGitStatus(); + + // Only trigger build if the repository actually changed + if (repoChanged) { + const newSearchParams = new URLSearchParams(searchParams); + newSearchParams.set('build', ''); + setSearchParams(newSearchParams); + } } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; toast({ From fc6a70793fd63610d51a1a24db04b7b35f424e32 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 21:22:16 -0500 Subject: [PATCH 15/37] Fix scrolling the virtual terminal on mobile --- src/components/Shakespeare/PreviewPane.tsx | 12 ++++++------ src/components/Terminal.tsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Shakespeare/PreviewPane.tsx b/src/components/Shakespeare/PreviewPane.tsx index 366c8fa2..2be7d256 100644 --- a/src/components/Shakespeare/PreviewPane.tsx +++ b/src/components/Shakespeare/PreviewPane.tsx @@ -757,20 +757,20 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
) : mobileCodeView === 'terminal' ? ( <> -
+
+

+ Terminal +

-
+
diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 8b5d7716..2dde2550 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -217,7 +217,7 @@ export function Terminal({ projectId, className }: TerminalProps) { onChange={(e) => setCurrentInput(e.target.value)} onKeyDown={handleKeyDown} disabled={isExecuting} - className="w-full bg-transparent border-none outline-none text-white font-mono placeholder-gray-500 caret-white leading-relaxedFP" + className="w-full bg-transparent border-none outline-none text-white font-mono placeholder-gray-500 caret-white leading-relaxed" placeholder="" autoComplete="off" spellCheck="false" From 1a9a5535238353ab63f0faf0eb3649fc1e03eb92 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 26 Sep 2025 21:41:21 -0500 Subject: [PATCH 16/37] Remove @apply --- src/index.css | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.css b/src/index.css index aaa90c5b..3fd0e105 100644 --- a/src/index.css +++ b/src/index.css @@ -110,11 +110,13 @@ @layer base { * { - @apply border-border; + border-color: hsl(var(--border)); } body { - @apply bg-background text-foreground font-sans; + background-color: hsl(var(--background)); + color: hsl(var(--foreground)); + font-family: 'Inter Variable', 'Inter', 'system-ui', 'sans-serif'; font-feature-settings: "rlig" 1, "calt" 1; } @@ -138,8 +140,10 @@ } /* GitHub-style focus rings */ - .focus-ring { - @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2; + .focus-ring:focus-visible { + outline: none; + box-shadow: 0 0 0 2px hsl(var(--ring)); + outline-offset: 2px; } /* Smooth transitions for theme switching */ From e9c73693cedb72a7738ecc022ab737aa2d1198bc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 14:29:18 -0500 Subject: [PATCH 17/37] Move email newsletter into Settings --- src/AppRouter.tsx | 3 +- src/components/EmailSubscription.tsx | 204 +++++++++++++++++++ src/components/SettingsLayout.tsx | 9 +- src/lib/i18n.ts | 18 -- src/pages/AboutSettings.tsx | 95 ++++----- src/pages/EmailSettings.tsx | 292 --------------------------- src/pages/Settings.tsx | 9 +- 7 files changed, 257 insertions(+), 373 deletions(-) create mode 100644 src/components/EmailSubscription.tsx delete mode 100644 src/pages/EmailSettings.tsx diff --git a/src/AppRouter.tsx b/src/AppRouter.tsx index c0d70908..5558d2db 100644 --- a/src/AppRouter.tsx +++ b/src/AppRouter.tsx @@ -11,7 +11,7 @@ import AISettings from "./pages/AISettings"; import GitSettings from "./pages/GitSettings"; import DataSettings from "./pages/DataSettings"; import AboutSettings from "./pages/AboutSettings"; -import EmailSettings from "./pages/EmailSettings"; + import GitHubOAuth from "./pages/GitHubOAuth"; import { NIP19Page } from "./pages/NIP19Page"; import NotFound from "./pages/NotFound"; @@ -34,7 +34,6 @@ export function AppRouter() { } /> } /> } /> - } /> } /> } /> diff --git a/src/components/EmailSubscription.tsx b/src/components/EmailSubscription.tsx new file mode 100644 index 00000000..3337864a --- /dev/null +++ b/src/components/EmailSubscription.tsx @@ -0,0 +1,204 @@ +import { useState, useEffect } from 'react'; +import { Mail, CheckCircle } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; +import { Label } from '@/components/ui/label'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { useCurrentUser } from '@/hooks/useCurrentUser'; +import { useToast } from '@/hooks/useToast'; +import { nip19 } from 'nostr-tools'; + +export function EmailSubscription() { + const { t } = useTranslation(); + const { user } = useCurrentUser(); + const { toast } = useToast(); + + const [email, setEmail] = useState(''); + const [isSubmitting, setIsSubmitting] = useState(false); + const [isSubmitted, setIsSubmitted] = useState(false); + + const url = new URL('https://pub.us7.list-manage.com/subscribe/post?u=f1f718a93795f42a604d558d8&id=f7271442a0&f_id=00ffa3e4f0'); + const honeypot = `b_${url.searchParams.get('u')}_${url.searchParams.get('id')}`; + const tag = '8982396'; + + // Check localStorage on component mount + useEffect(() => { + const hasSubscribed = localStorage.getItem('shakespeare-email-subscribed'); + if (hasSubscribed === 'true') { + setIsSubmitted(true); + } + }, []); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + if (!email.trim()) { + toast({ + title: "Email required", + description: "Please enter your email address", + variant: "destructive", + }); + return; + } + + // Basic email validation + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailRegex.test(email)) { + toast({ + title: "Invalid email", + description: "Please enter a valid email address", + variant: "destructive", + }); + return; + } + + setIsSubmitting(true); + + try { + // Submit to Mailchimp + const form = document.createElement('form'); + form.method = 'POST'; + form.action = url.href; + form.target = '_blank'; // Open in new tab + form.style.display = 'none'; + + // Add email field + const emailInput = document.createElement('input'); + emailInput.type = 'email'; + emailInput.name = 'EMAIL'; + emailInput.value = email.trim(); + form.appendChild(emailInput); + + // Add tag field with the new Shakespeare tag ID + const tagInput = document.createElement('input'); + tagInput.type = 'hidden'; + tagInput.name = 'tags'; + tagInput.value = tag; + form.appendChild(tagInput); + + // Add npub if available + if (user?.pubkey) { + const npubInput = document.createElement('input'); + npubInput.type = 'text'; + npubInput.name = 'NPUB'; + npubInput.value = nip19.npubEncode(user.pubkey); + npubInput.style.display = 'none'; + form.appendChild(npubInput); + } + + // Add honeypot field + const honeypotInput = document.createElement('input'); + honeypotInput.type = 'text'; + honeypotInput.name = honeypot; + honeypotInput.tabIndex = -1; + honeypotInput.style.position = 'absolute'; + honeypotInput.style.left = '-5000px'; + form.appendChild(honeypotInput); + + // Add form to document and submit + document.body.appendChild(form); + form.submit(); + + // Clean up after a short delay + setTimeout(() => { + document.body.removeChild(form); + }, 1000); + + // Save subscription status to localStorage + localStorage.setItem('shakespeare-email-subscribed', 'true'); + + setIsSubmitted(true); + toast({ + title: "Successfully subscribed!", + description: "You'll receive Shakespeare updates and resources occasionally.", + }); + } catch (error) { + console.error('Email signup error:', error); + toast({ + title: "Subscription failed", + description: "There was an error subscribing you to updates. Please try again.", + variant: "destructive", + }); + } finally { + setIsSubmitting(false); + } + }; + + if (isSubmitted) { + return ( + + +
+ +
+

+ Thanks for subscribing! +

+

+ You can opt out at any time using the unsubscribe link in our emails. +

+
+ +
+
+
+ ); + } + + return ( + + + + + {t('emailUpdates')} + + + {t('emailUpdatesDescription')} + + + +
+
+ + setEmail(e.target.value)} + disabled={isSubmitting} + required + /> +
+ +
+ + +

+ You can opt out at any time using the unsubscribe link in our emails. +

+
+
+
+
+ ); +} \ No newline at end of file diff --git a/src/components/SettingsLayout.tsx b/src/components/SettingsLayout.tsx index 200fff49..6cf9ea0c 100644 --- a/src/components/SettingsLayout.tsx +++ b/src/components/SettingsLayout.tsx @@ -3,7 +3,7 @@ import { useNavigate, useLocation, Outlet } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { ScrollArea } from '@/components/ui/scroll-area'; -import { Menu, Bot, GitBranch, Database, Wifi, Settings2, Info, Mail } from 'lucide-react'; +import { Menu, Bot, GitBranch, Database, Wifi, Settings2, Info } from 'lucide-react'; import { ProjectSidebar } from '@/components/ProjectSidebar'; import { useProjectsManager } from '@/hooks/useProjectsManager'; import { useIsMobile } from '@/hooks/useIsMobile'; @@ -56,13 +56,6 @@ const getSettingsItems = (t: (key: string) => string): SettingsItem[] => [ icon: Database, href: '/settings/data', }, - { - id: 'email', - title: t('emailUpdates'), - description: t('emailUpdatesDescription'), - icon: Mail, - href: '/settings/email', - }, { id: 'about', title: t('aboutShakespeare'), diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index c10614a4..e3c9b300 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -81,9 +81,6 @@ const resources = { dataSettingsDescription: 'Export files and manage local data', emailUpdates: 'Email Updates', emailUpdatesDescription: 'Subscribe to Shakespeare updates and resources', - emailUpdatesDescriptionLong: 'Stay updated with the latest Shakespeare features, tutorials, and resources.', - aboutShakespeareSettings: 'About Shakespeare', - aboutShakespeareSettingsDescription: 'Information about Shakespeare', // Project Sidebar newProject: 'New Project', @@ -393,9 +390,6 @@ const resources = { dataSettingsDescription: 'Exporte arquivos e gerencie dados locais', emailUpdates: 'Atualizações por Email', emailUpdatesDescription: 'Inscreva-se para receber atualizações e recursos do Shakespeare', - emailUpdatesDescriptionLong: 'Mantenha-se atualizado com os recursos mais recentes do Shakespeare, tutoriais e recursos. Enviamos apenas atualizações ocasionais e você pode cancelar a inscrição a qualquer momento.', - aboutShakespeareSettings: 'Sobre o Shakespeare', - aboutShakespeareSettingsDescription: 'Informações sobre o Shakespeare', // Project Sidebar newProject: 'Novo Projeto', @@ -705,9 +699,6 @@ const resources = { dataSettingsDescription: '导出文件和管理本地数据', emailUpdates: '邮件更新', emailUpdatesDescription: '订阅Shakespeare更新和资源', - emailUpdatesDescriptionLong: '及时了解最新的Shakespeare功能、教程和资源。我们只会偶尔发送更新,您可以随时取消订阅。', - aboutShakespeareSettings: '关于Shakespeare', - aboutShakespeareSettingsDescription: '关于Shakespeare的信息', // Project Sidebar newProject: '新项目', @@ -1017,9 +1008,6 @@ const resources = { dataSettingsDescription: 'Fitar da fayiloli da sarrafa bayanan gida', emailUpdates: 'Sabuntawar Imel', emailUpdatesDescription: 'Yi rajista don karbar sabuntawar Shakespeare da albarkatu', - emailUpdatesDescriptionLong: 'Kasance da sabuntawa game da sabbin fasalolin Shakespeare, koyarwa, da albarkatu. Muna aika sabuntawa lokaci-lokaci kawai kuma kuna iya dakatar da rajista koyaushe.', - aboutShakespeareSettings: 'Game da Shakespeare', - aboutShakespeareSettingsDescription: 'Bayani game da Shakespeare', // Project Sidebar newProject: 'Sabon Aikin', @@ -1329,9 +1317,6 @@ const resources = { dataSettingsDescription: 'Gbe awọn faili jade ati ṣakoso data agbegbe', emailUpdates: 'Awọn Imudojuiwọn Imeeli', emailUpdatesDescription: 'Forukọsilẹ fun awọn imudojuiwọn Shakespeare ati awọn ohun elo', - emailUpdatesDescriptionLong: 'Wa pẹlu imudojuiwọn pẹlu awọn ẹya Shakespeare tuntun, awọn ikẹkọ, ati awọn ohun elo. A nfi awọn imudojuiwọn lọọrọọ nikan ranṣẹ ati pe o le da forukọsilẹ duro nigbakugba.', - aboutShakespeareSettings: 'Nipa Shakespeare', - aboutShakespeareSettingsDescription: 'Alaye nipa Shakespeare', // Project Sidebar newProject: 'Iṣẹ akanṣe Tuntun', @@ -1636,9 +1621,6 @@ const resources = { dataSettingsDescription: 'Bupụta faịlụ na jikwaa data mpaghara', emailUpdates: 'Nmelite Email', emailUpdatesDescription: 'Debanye aha maka nmelite Shakespeare na akụrụngwa', - emailUpdatesDescriptionLong: 'Nọrọ na-emelite na atụmatụ Shakespeare ọhụrụ, nkuzi, na akụrụngwa. Anyị na-eziga naanị nmelite mgbe ụfọdụ ma ị nwere ike ịkwụsị ndebanye aha mgbe ọ bụla.', - aboutShakespeareSettings: 'Gbasara Shakespeare', - aboutShakespeareSettingsDescription: 'Ozi gbasara Shakespeare', // Project Sidebar newProject: 'Ọrụ Ọhụrụ', diff --git a/src/pages/AboutSettings.tsx b/src/pages/AboutSettings.tsx index 8c577b8f..8e5e86dd 100644 --- a/src/pages/AboutSettings.tsx +++ b/src/pages/AboutSettings.tsx @@ -1,11 +1,12 @@ import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { Info, ExternalLink, Loader2, AlertTriangle, ArrowLeft } from 'lucide-react'; +import { Info, ExternalLink, Loader2, AlertTriangle, ArrowLeft, Code } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { useIsMobile } from '@/hooks/useIsMobile'; +import { EmailSubscription } from '@/components/EmailSubscription'; export function AboutSettings() { const { t } = useTranslation(); @@ -77,52 +78,56 @@ export function AboutSettings() {
)} -
- {/* Project Information */} - +
+ {/* Email Updates */} + - {/* License */} - - - -
- - {t('license')} -
-
- - {isLoading ? ( -
- - {t('loadingLicense')} +
+ {/* Project Information */} + + + {/* License */} + + + +
+ + {t('license')}
- ) : error ? ( - - - - {t('failedToLoadLicense')}: {error} - - - ) : license ? ( -
- ) : null} - - - + + + {isLoading ? ( +
+ + {t('loadingLicense')} +
+ ) : error ? ( + + + + {t('failedToLoadLicense')}: {error} + + + ) : license ? ( +
+ ) : null} + + + +
); diff --git a/src/pages/EmailSettings.tsx b/src/pages/EmailSettings.tsx deleted file mode 100644 index efff3f35..00000000 --- a/src/pages/EmailSettings.tsx +++ /dev/null @@ -1,292 +0,0 @@ -import { useState, useEffect } from 'react'; -import { ArrowLeft, Mail, CheckCircle } from 'lucide-react'; -import { useTranslation } from 'react-i18next'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { useIsMobile } from '@/hooks/useIsMobile'; -import { useNavigate } from 'react-router-dom'; -import { useCurrentUser } from '@/hooks/useCurrentUser'; -import { useToast } from '@/hooks/useToast'; -import { nip19 } from 'nostr-tools'; - -export function EmailSettings() { - const { t } = useTranslation(); - const isMobile = useIsMobile(); - const navigate = useNavigate(); - const { user } = useCurrentUser(); - const { toast } = useToast(); - - const [email, setEmail] = useState(''); - const [isSubmitting, setIsSubmitting] = useState(false); - const [isSubmitted, setIsSubmitted] = useState(false); - - const url = new URL('https://pub.us7.list-manage.com/subscribe/post?u=f1f718a93795f42a604d558d8&id=f7271442a0&f_id=00ffa3e4f0'); - const honeypot = `b_${url.searchParams.get('u')}_${url.searchParams.get('id')}`; - const tag = '8982396'; - - // Check localStorage on component mount - useEffect(() => { - const hasSubscribed = localStorage.getItem('shakespeare-email-subscribed'); - if (hasSubscribed === 'true') { - setIsSubmitted(true); - } - }, []); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - - if (!email.trim()) { - toast({ - title: "Email required", - description: "Please enter your email address", - variant: "destructive", - }); - return; - } - - // Basic email validation - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - if (!emailRegex.test(email)) { - toast({ - title: "Invalid email", - description: "Please enter a valid email address", - variant: "destructive", - }); - return; - } - - setIsSubmitting(true); - - try { - // Submit to Mailchimp - const form = document.createElement('form'); - form.method = 'POST'; - form.action = url.href; - form.target = '_blank'; // Open in new tab - form.style.display = 'none'; - - // Add email field - const emailInput = document.createElement('input'); - emailInput.type = 'email'; - emailInput.name = 'EMAIL'; - emailInput.value = email.trim(); - form.appendChild(emailInput); - - // Add tag field with the new Shakespeare tag ID - const tagInput = document.createElement('input'); - tagInput.type = 'hidden'; - tagInput.name = 'tags'; - tagInput.value = tag; - form.appendChild(tagInput); - - // Add npub if available - if (user?.pubkey) { - const npubInput = document.createElement('input'); - npubInput.type = 'text'; - npubInput.name = 'NPUB'; - npubInput.value = nip19.npubEncode(user.pubkey); - npubInput.style.display = 'none'; - form.appendChild(npubInput); - } - - // Add honeypot field - const honeypotInput = document.createElement('input'); - honeypotInput.type = 'text'; - honeypotInput.name = honeypot; - honeypotInput.tabIndex = -1; - honeypotInput.style.position = 'absolute'; - honeypotInput.style.left = '-5000px'; - form.appendChild(honeypotInput); - - // Add form to document and submit - document.body.appendChild(form); - form.submit(); - - // Clean up after a short delay - setTimeout(() => { - document.body.removeChild(form); - }, 1000); - - // Save subscription status to localStorage - localStorage.setItem('shakespeare-email-subscribed', 'true'); - - setIsSubmitted(true); - toast({ - title: "Successfully subscribed!", - description: "You'll receive Shakespeare updates and resources occasionally.", - }); - } catch (error) { - console.error('Email signup error:', error); - toast({ - title: "Subscription failed", - description: "There was an error subscribing you to updates. Please try again.", - variant: "destructive", - }); - } finally { - setIsSubmitting(false); - } - }; - - if (isSubmitted) { - return ( -
- {isMobile && ( -
- -
-

- - {t('emailUpdates')} -

-

- {t('emailUpdatesDescriptionLong')} -

-
-
- )} - - {!isMobile && ( -
-

- - {t('emailUpdates')} -

-

- {t('emailUpdatesDescriptionLong')} -

-
- )} - -
- - -
- -
-

- Thanks for subscribing! -

-

- You can opt out at any time using the unsubscribe link in our emails. -

-
-
- - -
-
-
-
-
-
- ); - } - - return ( -
- {isMobile && ( -
- -
-

- - {t('emailUpdates')} -

-

- {t('emailUpdatesDescriptionLong')} -

-
-
- )} - - {!isMobile && ( -
-

- - {t('emailUpdates')} -

-

- {t('emailUpdatesDescriptionLong')} -

-
- )} - -
- - - - Stay Updated with Shakespeare - - - -
-
- - setEmail(e.target.value)} - disabled={isSubmitting} - required - /> -
- -
- - -

- You can opt out at any time using the unsubscribe link in our emails. -

-
-
-
-
-
-
- ); -} - -export default EmailSettings; \ No newline at end of file diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index ecb29350..cf978600 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -1,6 +1,6 @@ import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { Bot, GitBranch, Database, Wifi, Settings2, Info, Mail } from 'lucide-react'; +import { Bot, GitBranch, Database, Wifi, Settings2, Info } from 'lucide-react'; import { useIsMobile } from '@/hooks/useIsMobile'; interface SettingsItem { @@ -48,13 +48,6 @@ const getSettingsItems = (t: (key: string) => string): SettingsItem[] => [ icon: Database, href: '/settings/data', }, - { - id: 'email', - title: t('emailUpdates'), - description: t('emailUpdatesDescription'), - icon: Mail, - href: '/settings/email', - }, { id: 'about', title: t('aboutShakespeare'), From e8156243d023629250d18130aee7d04d2ce6d754 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 14:48:06 -0500 Subject: [PATCH 18/37] Simplify Nostr Settings loading skeleton --- src/pages/NostrSettings.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pages/NostrSettings.tsx b/src/pages/NostrSettings.tsx index cf8112a9..41de533e 100644 --- a/src/pages/NostrSettings.tsx +++ b/src/pages/NostrSettings.tsx @@ -92,15 +92,13 @@ export function NostrSettings() { {isLoading ? (
{/* Loading skeleton for accounts */} - {[...Array(2)].map((_, i) => ( -
- -
- -
- +
+ +
+
- ))} + +
{/* Add account button skeleton */}
From 2db9d5e513f8d342e791f919d6008b6a729ef60d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 15:32:26 -0500 Subject: [PATCH 19/37] Move Import ZIP File to Clone page --- src/components/ProjectSidebar.tsx | 42 +++--------------------- src/pages/Clone.tsx | 53 +++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 40 deletions(-) diff --git a/src/components/ProjectSidebar.tsx b/src/components/ProjectSidebar.tsx index 3d6782a0..58d8d00a 100644 --- a/src/components/ProjectSidebar.tsx +++ b/src/components/ProjectSidebar.tsx @@ -1,7 +1,7 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { Plus, Folder, GitBranch, Loader2, ChevronDown, Star, Columns2, X, Settings, HelpCircle, FileArchive } from 'lucide-react'; +import { Plus, Folder, GitBranch, Loader2, ChevronDown, Star, Columns2, X, Settings, HelpCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Skeleton } from '@/components/ui/skeleton'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; @@ -9,9 +9,7 @@ import { useProjects } from '@/hooks/useProjects'; import { useProjectSessionStatus } from '@/hooks/useProjectSessionStatus'; import { useLocalStorage } from '@/hooks/useLocalStorage'; import { useIsMobile } from '@/hooks/useIsMobile'; -import { ZipImportDialog } from '@/components/ZipImportDialog'; -import { useProjectsManager } from '@/hooks/useProjectsManager'; -import { useToast } from '@/hooks/useToast'; + import type { Project } from '@/lib/ProjectsManager'; import { cn } from '@/lib/utils'; import { useQueryClient } from '@tanstack/react-query'; @@ -95,9 +93,6 @@ export function ProjectSidebar({ const queryClient = useQueryClient(); const { data: projects = [], isLoading, error } = useProjects(); const [favorites] = useLocalStorage('project-favorites', []); - const projectsManager = useProjectsManager(); - const { toast } = useToast(); - const [isZipDialogOpen, setIsZipDialogOpen] = useState(false); const isMobile = useIsMobile(); const navigate = useNavigate(); @@ -123,24 +118,7 @@ export function ProjectSidebar({ } }; - const handleImportZip = async (file: File, overwrite = false, projectId?: string) => { - try { - // Import project from zip file - const project = await projectsManager.importProjectFromZip(file, projectId, overwrite); - // Show success toast - toast({ - title: overwrite ? "Project Overwritten Successfully" : "Project Imported Successfully", - description: `"${project.name}" has been ${overwrite ? 'overwritten' : 'imported'} and is ready to use.`, - }); - - // Navigate to the imported project - navigate(`/project/${project.id}`); - } catch (error) { - console.error('Failed to import project:', error); - throw error; // Re-throw to let the dialog handle the error display - } - }; useEffect(() => { queryClient.invalidateQueries({ queryKey: ['projects'] }); @@ -211,13 +189,6 @@ export function ProjectSidebar({ {t('importRepository')} - setIsZipDialogOpen(true)} - className="flex items-center gap-2 w-full" - > - - Import ZIP File -
@@ -281,12 +252,7 @@ export function ProjectSidebar({
- {/* ZIP Import Dialog */} - +
); } \ No newline at end of file diff --git a/src/pages/Clone.tsx b/src/pages/Clone.tsx index 01ec43ca..ac4b54e6 100644 --- a/src/pages/Clone.tsx +++ b/src/pages/Clone.tsx @@ -4,11 +4,12 @@ import { useTranslation } from 'react-i18next'; import { AppLayout } from '@/components/AppLayout'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; -import { GitBranch, Loader2, AlertCircle } from 'lucide-react'; +import { GitBranch, Loader2, AlertCircle, FileArchive, MoreHorizontal } from 'lucide-react'; import { useProjectsManager } from '@/hooks/useProjectsManager'; import { useToast } from '@/hooks/useToast'; - +import { ZipImportDialog } from '@/components/ZipImportDialog'; import { useSeoMeta } from '@unhead/react'; +import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu'; export default function Clone() { const { t } = useTranslation(); @@ -20,6 +21,7 @@ export default function Clone() { const projectsManager = useProjectsManager(); const { toast } = useToast(); const autoCloneInitiatedRef = useRef(false); + const [isZipDialogOpen, setIsZipDialogOpen] = useState(false); useSeoMeta({ title: `${t('importRepository')} - Shakespeare`, @@ -171,6 +173,25 @@ export default function Clone() { } }, [handleClone, searchParams]); + const handleImportZip = async (file: File, overwrite = false, projectId?: string) => { + try { + // Import project from zip file + const project = await projectsManager.importProjectFromZip(file, projectId, overwrite); + + // Show success toast + toast({ + title: overwrite ? "Project Overwritten Successfully" : "Project Imported Successfully", + description: `"${project.name}" has been ${overwrite ? 'overwritten' : 'imported'} and is ready to use.`, + }); + + // Navigate to the imported project + navigate(`/project/${project.id}`); + } catch (error) { + console.error('Failed to import project:', error); + throw error; // Re-throw to let the dialog handle the error display + } + }; + return (
@@ -226,7 +247,35 @@ export default function Clone() { )}
+ + {/* Import ZIP File Link */} +
+ + + + + + setIsZipDialogOpen(true)} + > + + Import ZIP File + + + +
+ + {/* ZIP Import Dialog */} + ); } \ No newline at end of file From a9a5cafcac967f705cd4df11a374fba8f0453c96 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 16:26:07 -0500 Subject: [PATCH 20/37] Don't hardcode gitnostr.com --- src/components/GitDialog.tsx | 2 +- src/components/NostrProvider.tsx | 1 - src/lib/git.ts | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index b2c4d6b5..e53629ee 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -47,7 +47,7 @@ import { cn } from '@/lib/utils'; import { findCredentialsForRepo } from '@/lib/gitCredentials'; import { nip19 } from 'nostr-tools'; -const GRASP_SERVERS = ["git.shakespeare.diy", "relay.ngit.dev", "gitnostr.com"]; +const GRASP_SERVERS = ["git.shakespeare.diy", "relay.ngit.dev"]; interface GitDialogProps { projectId: string; diff --git a/src/components/NostrProvider.tsx b/src/components/NostrProvider.tsx index 7b89ae81..b902f297 100644 --- a/src/components/NostrProvider.tsx +++ b/src/components/NostrProvider.tsx @@ -18,7 +18,6 @@ const GIT_KINDS = [ const GIT_RELAYS = [ 'wss://git.shakespeare.diy/', 'wss://relay.ngit.dev/', - 'wss://gitnostr.com/', ]; const NostrProvider: React.FC = (props) => { diff --git a/src/lib/git.ts b/src/lib/git.ts index 93dcc008..2504755a 100644 --- a/src/lib/git.ts +++ b/src/lib/git.ts @@ -911,7 +911,6 @@ export class Git { const gitRelays = new Set([ 'wss://git.shakespeare.diy/', 'wss://relay.ngit.dev/', - 'wss://gitnostr.com/', 'wss://relay.nostr.band/', // General purpose relay as fallback ]); @@ -1396,7 +1395,6 @@ export class Git { relayUrls.push( 'wss://git.shakespeare.diy/', 'wss://relay.ngit.dev/', - 'wss://gitnostr.com/', 'wss://relay.nostr.band/' ); } From b064c9ff8619fa69f5c2a439470337a86ac0f455 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 20:17:10 -0500 Subject: [PATCH 21/37] Mock "sonner" and "next-themes" when building --- src/lib/build/index.ts | 2 + src/lib/build/shakespearePlugin.ts | 131 +++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 src/lib/build/shakespearePlugin.ts diff --git a/src/lib/build/index.ts b/src/lib/build/index.ts index fc9dbd1c..956aa6a7 100644 --- a/src/lib/build/index.ts +++ b/src/lib/build/index.ts @@ -1,6 +1,7 @@ import { getEsbuild } from "@/lib/esbuild"; import { copyFiles } from "@/lib/copyFiles"; +import { shakespearePlugin } from "./shakespearePlugin"; import { esmPlugin } from "./esmPlugin"; import { fsPlugin } from "./fsPlugin"; @@ -49,6 +50,7 @@ async function bundle( outdir: "/", jsx: "automatic", plugins: [ + shakespearePlugin(), // Takes precedence over esmPlugin fsPlugin(fs, `${projectPath}/src`), esmPlugin(JSON.parse(packageLockText), target), ], diff --git a/src/lib/build/shakespearePlugin.ts b/src/lib/build/shakespearePlugin.ts new file mode 100644 index 00000000..06841907 --- /dev/null +++ b/src/lib/build/shakespearePlugin.ts @@ -0,0 +1,131 @@ +import type { Plugin } from "esbuild-wasm"; + +/** + * Shakespeare plugin for dependency polyfills and workarounds. + * This plugin handles specific dependencies that need custom implementations + * or dummy APIs to work correctly in the browser environment. + */ +export function shakespearePlugin(): Plugin { + return { + name: "shakespeare", + + setup(build) { + // Handle "sonner" imports with a dummy API + build.onResolve({ filter: /^sonner$/ }, (args) => { + return { + path: args.path, + namespace: "shakespeare-sonner", + }; + }); + + // Provide dummy sonner implementation + build.onLoad({ filter: /.*/, namespace: "shakespeare-sonner" }, () => { + return { + contents: ` + // Dummy implementation of sonner toast library + + // Toast function that does nothing + const toast = (message, options) => { + console.log('[Shakespeare Sonner Mock]:', message, options); + return { id: Math.random().toString(36) }; + }; + + // Add common toast methods + toast.success = (message, options) => { + console.log('[Shakespeare Sonner Mock] Success:', message, options); + return { id: Math.random().toString(36) }; + }; + + toast.error = (message, options) => { + console.log('[Shakespeare Sonner Mock] Error:', message, options); + return { id: Math.random().toString(36) }; + }; + + toast.info = (message, options) => { + console.log('[Shakespeare Sonner Mock] Info:', message, options); + return { id: Math.random().toString(36) }; + }; + + toast.warning = (message, options) => { + console.log('[Shakespeare Sonner Mock] Warning:', message, options); + return { id: Math.random().toString(36) }; + }; + + toast.loading = (message, options) => { + console.log('[Shakespeare Sonner Mock] Loading:', message, options); + return { id: Math.random().toString(36) }; + }; + + toast.promise = (promise, options) => { + console.log('[Shakespeare Sonner Mock] Promise:', promise, options); + return promise; + }; + + toast.dismiss = (id) => { + console.log('[Shakespeare Sonner Mock] Dismiss:', id); + }; + + // Toaster component (dummy React component) + const Toaster = (props) => { + console.log('[Shakespeare Sonner Mock] Toaster component rendered:', props); + return null; + }; + + // Export both named and default exports to match sonner API + export { toast, Toaster }; + export default toast; + `, + loader: "js", + }; + }); + + // Handle "next-themes" imports with a dummy API + build.onResolve({ filter: /^next-themes$/ }, (args) => { + return { + path: args.path, + namespace: "shakespeare-next-themes", + }; + }); + + // Provide dummy next-themes implementation + build.onLoad({ filter: /.*/, namespace: "shakespeare-next-themes" }, () => { + return { + contents: ` + // Dummy implementation of next-themes + + // useTheme hook that returns system theme + const useTheme = () => { + return { theme: "system" }; + }; + + // ThemeProvider component (dummy React component) + const ThemeProvider = ({ children, ...props }) => { + console.log('[Shakespeare next-themes Mock] ThemeProvider rendered:', props); + return children; + }; + + // Export both named and default exports to match next-themes API + export { useTheme, ThemeProvider }; + `, + loader: "js", + }; + }); + + // Add more dependency polyfills here as needed + // Example structure for future dependencies: + // build.onResolve({ filter: /^some-other-package$/ }, (args) => { + // return { + // path: args.path, + // namespace: "shakespeare-other-package", + // }; + // }); + // + // build.onLoad({ filter: /.*/, namespace: "shakespeare-other-package" }, () => { + // return { + // contents: `// Custom implementation for some-other-package`, + // loader: "js", + // }; + // }); + }, + }; +} \ No newline at end of file From 124e9d5937d52d8794f785d35e6a8180b83f2ed2 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 28 Sep 2025 08:37:45 +0700 Subject: [PATCH 22/37] wip, bring error handling up to the project level to exist across mobile tabs --- src/components/Shakespeare/ChatPane.tsx | 37 +++++++++++++------------ src/pages/ProjectView.tsx | 22 +++++++++++++-- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index f9d724c0..4fb8905a 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -34,7 +34,7 @@ import { NostrReadNipsIndexTool } from '@/lib/tools/NostrReadNipsIndexTool'; import { NostrGenerateKindTool } from '@/lib/tools/NostrGenerateKindTool'; import { ShellTool } from '@/lib/tools/ShellTool'; import { TypecheckTool } from '@/lib/tools/TypecheckTool'; -import { ReadConsoleMessagesTool, ProjectPreviewConsoleError, addErrorListener, removeErrorListener } from '@/lib/tools/ReadConsoleMessagesTool'; +import { ReadConsoleMessagesTool, ProjectPreviewConsoleError } from '@/lib/tools/ReadConsoleMessagesTool'; import { toolToOpenAI } from '@/lib/tools/openai-adapter'; import { Tool } from '@/lib/tools/Tool'; import OpenAI from 'openai'; @@ -51,6 +51,8 @@ interface ChatPaneProps { onLoadingChange?: (isLoading: boolean) => void; isLoading?: boolean; isBuildLoading?: boolean; + consoleError?: ProjectPreviewConsoleError | null; + onDismissConsoleError?: () => void; } export interface ChatPaneRef { @@ -64,6 +66,8 @@ export const ChatPane = forwardRef(({ onLoadingChange, isLoading: externalIsLoading, isBuildLoading: externalIsBuildLoading, + consoleError, + onDismissConsoleError, }, ref) => { const { t } = useTranslation(); const [searchParams, setSearchParams] = useSearchParams(); @@ -80,18 +84,8 @@ export const ChatPane = forwardRef(({ const [isStuck, setIsStuck] = useState(false); const [aiError, setAIError] = useState(null); - // Console error handling - useEffect(() => { - const handleConsoleError = (error: ProjectPreviewConsoleError) => { - // Only show console errors if there's no existing AI error - if (!aiError) { - setAIError(error); - } - }; - - addErrorListener(handleConsoleError); - return () => removeErrorListener(handleConsoleError); - }, [aiError]); + // Determine which error to show - console error takes priority over AI errors + const displayError = consoleError || aiError; // Use external state if provided, otherwise default to false const isBuildLoading = externalIsBuildLoading || false; @@ -225,6 +219,15 @@ export const ChatPane = forwardRef(({ sendMessage('Read the console messages and fix any errors present.', providerModel); }, [sendMessage, providerModel]); + // Handle error dismissal + const handleErrorDismiss = useCallback(() => { + if (consoleError && onDismissConsoleError) { + onDismissConsoleError(); + } else { + setAIError(null); + } + }, [consoleError, onDismissConsoleError]); + // Use external loading state if provided, otherwise use internal state const isLoading = externalIsLoading !== undefined ? externalIsLoading : internalIsLoading; @@ -608,11 +611,11 @@ export const ChatPane = forwardRef(({
)} - {/* AI Error Alert */} - {aiError && ( + {/* Error Alert (Console or AI) */} + {displayError && ( setAIError(null)} + error={displayError} + onDismiss={handleErrorDismiss} onNewChat={onNewChat} onOpenModelSelector={openModelSelector} onRequestConsoleErrorHelp={handleConsoleErrorHelp} diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx index 8dd43d1c..f73f3a3b 100644 --- a/src/pages/ProjectView.tsx +++ b/src/pages/ProjectView.tsx @@ -18,7 +18,7 @@ import { GitStatusIndicator } from '@/components/GitStatusIndicator'; import { StarButton } from '@/components/StarButton'; import { useBuildProject } from '@/hooks/useBuildProject'; import { useIsProjectPreviewable } from '@/hooks/useIsProjectPreviewable'; -import { clearConsoleMessages } from '@/lib/tools/ReadConsoleMessagesTool'; +import { clearConsoleMessages, ProjectPreviewConsoleError, addErrorListener, removeErrorListener } from '@/lib/tools/ReadConsoleMessagesTool'; export function ProjectView() { const { projectId } = useParams<{ projectId: string }>(); @@ -29,6 +29,7 @@ export function ProjectView() { const [mobileView, setMobileView] = useState<'chat' | 'preview' | 'code'>('chat'); const [isAILoading, setIsAILoading] = useState(false); const [isProjectDetailsOpen, setIsProjectDetailsOpen] = useState(false); + const [consoleError, setConsoleError] = useState(null); const projectsManager = useProjectsManager(); const chatPaneRef = useRef(null); @@ -46,8 +47,9 @@ export function ProjectView() { try { const projectData = await projectsManager.getProject(projectId); setProject(projectData); - // Clear console messages when switching projects + // Clear console messages and error state when switching projects clearConsoleMessages(); + setConsoleError(null); } catch (error) { console.error('Failed to load project:', error); } finally { @@ -79,6 +81,16 @@ export function ProjectView() { } }, [isPreviewable, mobileView, activeTab]); + // Global console error listener (always active regardless of current tab) + useEffect(() => { + const handleConsoleError = (error: ProjectPreviewConsoleError) => { + setConsoleError(error); + }; + + addErrorListener(handleConsoleError); + return () => removeErrorListener(handleConsoleError); + }, []); + const handleNewChat = () => { // Reset to chat view on mobile when starting new chat if (isMobile) { @@ -100,6 +112,10 @@ export function ProjectView() { // when isAILoading becomes true after user interaction }; + const handleDismissConsoleError = () => { + setConsoleError(null); + }; + const handleProjectDeleted = async () => { setProject(null); navigate('/'); @@ -212,6 +228,8 @@ export function ProjectView() { onLoadingChange={handleAILoadingChange} isLoading={isAILoading} isBuildLoading={build.isPending} + consoleError={consoleError} + onDismissConsoleError={handleDismissConsoleError} /> ) : (
From 2ec32f55377c5f9daa132327dc089c2db7415933 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 20:39:51 -0500 Subject: [PATCH 23/37] Polyfill virtual:pwa-register/react --- src/lib/build/shakespearePlugin.ts | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/lib/build/shakespearePlugin.ts b/src/lib/build/shakespearePlugin.ts index 06841907..c315be66 100644 --- a/src/lib/build/shakespearePlugin.ts +++ b/src/lib/build/shakespearePlugin.ts @@ -111,6 +111,43 @@ export function shakespearePlugin(): Plugin { }; }); + // Handle "virtual:pwa-register/react" imports with a dummy API + build.onResolve({ filter: /^virtual:pwa-register\/react$/ }, (args) => { + return { + path: args.path, + namespace: "shakespeare-pwa-register", + }; + }); + + // Provide dummy PWA register implementation + build.onLoad({ filter: /.*/, namespace: "shakespeare-pwa-register" }, () => { + return { + contents: ` + // Dummy implementation of virtual:pwa-register/react + + // useRegisterSW hook that returns dummy functions + const useRegisterSW = (options = {}) => { + console.log('[Shakespeare PWA Mock] useRegisterSW called:', options); + + return { + needRefresh: [false, () => {}], + offlineReady: [false, () => {}], + updateServiceWorker: (reloadPage) => { + console.log('[Shakespeare PWA Mock] updateServiceWorker called:', reloadPage); + if (reloadPage) { + window.location.reload(); + } + }, + }; + }; + + // Export the hook + export { useRegisterSW }; + `, + loader: "js", + }; + }); + // Add more dependency polyfills here as needed // Example structure for future dependencies: // build.onResolve({ filter: /^some-other-package$/ }, (args) => { From 939deabb5b5118ec5a62e0a6d1d9e7916eb34176 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 21:07:28 -0500 Subject: [PATCH 24/37] Support Vite query params of local imports, specifically ?raw --- src/lib/build/fsPlugin.ts | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/lib/build/fsPlugin.ts b/src/lib/build/fsPlugin.ts index 5e914752..28856e45 100644 --- a/src/lib/build/fsPlugin.ts +++ b/src/lib/build/fsPlugin.ts @@ -1,4 +1,4 @@ -import path from "path-browserify"; +import { join, dirname, extname } from "path-browserify"; import type { Loader, Plugin } from "esbuild-wasm"; import type { JSRuntimeFS } from '@/lib/JSRuntime'; @@ -12,23 +12,26 @@ export function fsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { let resolved: string; if (args.path.startsWith("@/")) { - resolved = path.join(cwd, args.path.slice(2)); + resolved = join(cwd, args.path.slice(2)); } else if (args.kind === "entry-point") { - resolved = path.join(cwd, args.path); + resolved = join(cwd, args.path); } else if (args.importer) { - resolved = path.join(path.dirname(args.importer), args.path); + resolved = join(dirname(args.importer), args.path); } else { return; } + // Vite query parameters https://vite.dev/guide/assets + const [cleaned, query] = resolved.split("?"); + try { - resolved = await tryFileVariants(fs, resolved); + resolved = await tryFileVariants(fs, cleaned); } catch { return; // Let other plugins handle this } return { - path: resolved, + path: resolved + (typeof query === "string" ? "?" + query : ""), namespace: "fs", }; }); @@ -36,14 +39,25 @@ export function fsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { build.onLoad( { filter: /.*/, namespace: "fs" }, async (args) => { - const ext = path.extname(args.path).slice(1); + const [path, query] = args.path.split("?"); + const params = new URLSearchParams(query); + + // https://vite.dev/guide/assets.html#importing-asset-as-string + if (params.has("raw")) { + return { + contents: await fs.readFile(path, "utf8"), + loader: "text", + }; + } + + const ext = extname(path).slice(1); if (!["ts", "tsx", "js", "jsx", "css"].includes(ext)) { return; } return { - contents: await fs.readFile(args.path, "utf8"), + contents: await fs.readFile(path, "utf8"), loader: ext as Loader, }; }, @@ -67,7 +81,7 @@ async function tryFileVariants( // If it's a directory, try index files if (stat.isDirectory()) { for (const ext of extensions) { - const indexFile = path.join(basePath, "index" + ext); + const indexFile = join(basePath, "index" + ext); const indexStat = await statSafe(fs, indexFile); if (indexStat.isFile()) { return indexFile; From 8c60a3a8bced8a5d6d4db50fc0aaa3c5a57d8920 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 21:23:45 -0500 Subject: [PATCH 25/37] Externalize static assets like fonts --- src/lib/build/esmPlugin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/build/esmPlugin.ts b/src/lib/build/esmPlugin.ts index ce95e7c0..abc9f816 100644 --- a/src/lib/build/esmPlugin.ts +++ b/src/lib/build/esmPlugin.ts @@ -131,6 +131,14 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin { } } + // Skip static assets + if (/\.(woff2?|ttf|otf|eot)$/.test(fullURL.pathname)) { + return { + path: fullURL.toString(), + external: true, + }; + } + return { path: fullURL.toString(), namespace: "esm", From eba609ae7337a4aa0e935e4751658e969feb2e07 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 21:40:07 -0500 Subject: [PATCH 26/37] NpmAddPackageTool should not bump the package version --- src/lib/tools/NpmAddPackageTool.test.ts | 23 +++++++++++++++++++++-- src/lib/tools/NpmAddPackageTool.ts | 15 +++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/lib/tools/NpmAddPackageTool.test.ts b/src/lib/tools/NpmAddPackageTool.test.ts index 65ddd3c6..0e4a8917 100644 --- a/src/lib/tools/NpmAddPackageTool.test.ts +++ b/src/lib/tools/NpmAddPackageTool.test.ts @@ -195,6 +195,25 @@ describe('NpmAddPackageTool', () => { } }; + vi.mocked(mockFS.readFile).mockResolvedValue(JSON.stringify(packageJson, null, 2)); + + const result = await tool.execute({ name: 'lodash' }); + + // Should not fetch from registry when no version specified and package already installed + expect(mockFetch).not.toHaveBeenCalled(); + expect(mockFS.writeFile).not.toHaveBeenCalled(); + expect(result).toContain('ℹ️ Package lodash is already installed in dependencies with version ^4.17.21.'); + }); + + it('should handle package already installed with specific version', async () => { + const packageJson = { + name: 'test-project', + version: '1.0.0', + dependencies: { + 'lodash': '^4.17.21' + } + }; + vi.mocked(mockFS.readFile).mockResolvedValue(JSON.stringify(packageJson, null, 2)); mockFetch.mockResolvedValue({ ok: true, @@ -208,10 +227,10 @@ describe('NpmAddPackageTool', () => { }) }); - const result = await tool.execute({ name: 'lodash' }); + const result = await tool.execute({ name: 'lodash', version: '4.17.21' }); expect(mockFS.writeFile).not.toHaveBeenCalled(); - expect(result).toContain('ℹ️ Package lodash@4.17.21 is already installed'); + expect(result).toContain('ℹ️ Package lodash@4.17.21 is already installed in dependencies.'); }); it('should handle missing package.json', async () => { diff --git a/src/lib/tools/NpmAddPackageTool.ts b/src/lib/tools/NpmAddPackageTool.ts index d29865c8..a911d657 100644 --- a/src/lib/tools/NpmAddPackageTool.ts +++ b/src/lib/tools/NpmAddPackageTool.ts @@ -88,6 +88,16 @@ export class NpmAddPackageTool implements Tool { throw new Error(`❌ Invalid package.json format. Could not parse JSON.`); } + // Check if package already exists + const dependencyKey = dev ? 'devDependencies' : 'dependencies'; + const otherKey = dev ? 'dependencies' : 'devDependencies'; + + // If no version is specified and package is already installed, it's a no-op + if (!version && packageJson[dependencyKey]?.[name]) { + const currentVersion = packageJson[dependencyKey][name]; + return `ℹ️ Package ${name} is already installed in ${dependencyKey} with version ${currentVersion}.`; + } + // Determine version to use and fetch package metadata let targetVersion = version; let packageMetadata: NpmRegistryResponse; @@ -107,10 +117,7 @@ export class NpmAddPackageTool implements Tool { } } - // Check if package already exists - const dependencyKey = dev ? 'devDependencies' : 'dependencies'; - const otherKey = dev ? 'dependencies' : 'devDependencies'; - + // Check if package already exists with the specific version if (packageJson[dependencyKey]?.[name]) { const currentVersion = packageJson[dependencyKey][name]; if (currentVersion === `^${targetVersion}`) { From 93a636589d753f9161dc265bac63432616b24f39 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 22:22:49 -0500 Subject: [PATCH 27/37] Fix Tailwind styles --- src/lib/build/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/build/index.ts b/src/lib/build/index.ts index 956aa6a7..6817bcb2 100644 --- a/src/lib/build/index.ts +++ b/src/lib/build/index.ts @@ -73,7 +73,7 @@ async function bundle( } // Update index.html with proper script and link tags - updateIndexHtml(doc); + updateIndexHtml(doc, dist); const updatedHtml = "\n" + doc.documentElement.outerHTML; dist["index.html"] = new TextEncoder().encode(updatedHtml); @@ -156,7 +156,7 @@ export async function buildProject(options: BuildProjectOptions): Promise<{ }; } -function updateIndexHtml(doc: Document): void { +function updateIndexHtml(doc: Document, dist: Record): void { const entrypoint = doc.querySelector('script[src="/src/main.tsx"]'); if (!entrypoint) { @@ -165,8 +165,11 @@ function updateIndexHtml(doc: Document): void { entrypoint.setAttribute("src", "/main.js"); - const style = doc.createElement("link"); - style.setAttribute("rel", "stylesheet"); - style.setAttribute("href", "/main.css"); - doc.head.appendChild(style); + const css = dist["main.css"]; + if (css) { + const style = doc.createElement("style"); + style.setAttribute("type", "text/tailwindcss"); + style.textContent = new TextDecoder().decode(css); + doc.head.appendChild(style); + } } \ No newline at end of file From 3529d43b91cb04a31b0e39825288b3ea3bdeed1e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 22:28:21 -0500 Subject: [PATCH 28/37] Support json imports --- src/lib/build/fsPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/build/fsPlugin.ts b/src/lib/build/fsPlugin.ts index 28856e45..7d35b0eb 100644 --- a/src/lib/build/fsPlugin.ts +++ b/src/lib/build/fsPlugin.ts @@ -52,7 +52,7 @@ export function fsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { const ext = extname(path).slice(1); - if (!["ts", "tsx", "js", "jsx", "css"].includes(ext)) { + if (!["ts", "tsx", "js", "jsx", "css", "json"].includes(ext)) { return; } From 4e0625721e913533b5cec59296ca368a74cea892 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 22:42:16 -0500 Subject: [PATCH 29/37] Fix compatibility with leaflet --- src/lib/build/esmPlugin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/build/esmPlugin.ts b/src/lib/build/esmPlugin.ts index abc9f816..9651ae3b 100644 --- a/src/lib/build/esmPlugin.ts +++ b/src/lib/build/esmPlugin.ts @@ -61,6 +61,14 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin { } }); + // Legacy (Internet Explorer) "behavior" syntax + build.onResolve({ filter: /^#default#/, namespace: "esm" }, (args) => { + return { + path: args.path, + external: true, + }; + }); + // Handle bare imports like "react" build.onResolve({ filter: /^[^./].*/ }, (args) => { const packageName = args.path.startsWith("@") From 8b62ba8e7e32c0a18f0a1a9451cc91f2cd7f7e19 Mon Sep 17 00:00:00 2001 From: lemonknowsall Date: Sat, 27 Sep 2025 01:36:54 -0700 Subject: [PATCH 30/37] Updated logos, default theme, onboard modals, and mobile browser fixes --- src/App.tsx | 2 +- src/components/AppLayout.tsx | 4 -- src/components/CreditsDialog.tsx | 2 +- src/components/OnboardingDialog.test.tsx | 2 +- src/components/OnboardingDialog.tsx | 69 +++++++++++++----------- src/components/ProjectSidebar.test.tsx | 2 +- src/components/ProjectSidebar.tsx | 6 ++- src/components/Shakespeare/ChatPane.tsx | 8 ++- src/pages/Index.tsx | 8 ++- 9 files changed, 61 insertions(+), 42 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b3944f7d..45c68be2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -38,7 +38,7 @@ const queryClient = new QueryClient({ }); const defaultConfig: AppConfig = { - theme: "light", + theme: "system", relayUrl: "wss://relay.primal.net", deployServer: "shakespeare.wtf", }; diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index f58455e0..cc9552ed 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -18,7 +18,6 @@ interface AppLayoutProps { export function AppLayout({ children, selectedProject = null, - title = "Shakespeare", showSidebar = true, headerContent }: AppLayoutProps) { @@ -85,9 +84,6 @@ export function AppLayout({ )} -

- {title} -

{headerContent} diff --git a/src/components/CreditsDialog.tsx b/src/components/CreditsDialog.tsx index 64dd1f30..4b33517c 100644 --- a/src/components/CreditsDialog.tsx +++ b/src/components/CreditsDialog.tsx @@ -399,7 +399,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro return ( - + e.preventDefault()} className="max-w-lg w-full max-h-[75vh] overflow-hidden flex flex-col sm:max-w-lg sm:max-h-[75vh] max-sm:w-full max-sm:h-full max-sm:max-w-none max-sm:max-h-none max-sm:m-0 max-sm:rounded-none"> {lightningInvoice ? ( diff --git a/src/components/OnboardingDialog.test.tsx b/src/components/OnboardingDialog.test.tsx index cbf028e4..79bd7d2c 100644 --- a/src/components/OnboardingDialog.test.tsx +++ b/src/components/OnboardingDialog.test.tsx @@ -42,7 +42,7 @@ describe('OnboardingDialog', () => { ); - expect(screen.getAllByText('Welcome to Shakespeare!')).toHaveLength(2); // Title and heading + expect(screen.getByText('Welcome to Shakespeare!')).toBeInTheDocument(); // Only in dialog title now expect(screen.getByText(/Your AI-powered development assistant/)).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Get Started/i })).toBeInTheDocument(); }); diff --git a/src/components/OnboardingDialog.tsx b/src/components/OnboardingDialog.tsx index 4fa385a1..a38f07a8 100644 --- a/src/components/OnboardingDialog.tsx +++ b/src/components/OnboardingDialog.tsx @@ -8,7 +8,6 @@ import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; -import { ScrollArea } from '@/components/ui/scroll-area'; import { useAISettings } from '@/hooks/useAISettings'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useLoginActions } from '@/hooks/useLoginActions'; @@ -119,8 +118,8 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) return ( <> - - + + {step === 'model-selection' && ( )} + {step === 'conclusion' && ( + + )} - {step === 'welcome' && 'Welcome to Shakespeare!'} {step === 'model-selection' && 'Choose Your AI Model'} - {step === 'conclusion' && "You're All Set!"} -
+
{step === 'welcome' && (
-
🎭
+
+ Shakespeare +

Welcome to Shakespeare! @@ -191,15 +204,8 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) )} {step === 'model-selection' && ( -
-
-

- Choose an AI model to power your development experience. - Different models offer various capabilities and pricing. -

-
- - +
+
{isLoadingModels ? ( <> @@ -232,6 +238,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) shakespeareModels.map((model) => { const isSelected = selectedModel === model.fullId; const isFree = model.pricing?.prompt.equals(0) && model.pricing?.completion.equals(0); + const isPremium = !isFree; return (
- - {model.description || model.name || model.id} + + { model.name || model.description || model.id} {model.description && (

- {model.name || model.id} + {model.description || model.id}

)}
@@ -259,6 +266,11 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) Free )} + {isPremium && ( + + Premium + + )} {isSelected && (
@@ -268,12 +280,12 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
-
+
{model.pricing && ( - <> - Input: {formatPrice(model.pricing.prompt)} - Output: {formatPrice(model.pricing.completion)} - +
+
Input: {formatPrice(model.pricing.prompt)}
+
Output: {formatPrice(model.pricing.completion)}
+
)} {model.contextLength && ( Context: {model.contextLength.toLocaleString()} tokens @@ -285,9 +297,9 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) }) )}
- +
-
+
-
-

- "Create a farming equipment marketplace for local farmers to buy and sell tractors, tools, and supplies..." -

-
diff --git a/src/index.css b/src/index.css index 3fd0e105..b09c5aa2 100644 --- a/src/index.css +++ b/src/index.css @@ -260,6 +260,10 @@ padding-top: env(safe-area-inset-top); } + .bottom-safe-nav { + bottom: calc(env(safe-area-inset-bottom) + 3.75rem); + } + /* Mobile navigation button styles - text/icon highlighting only */ .mobile-nav-button, .mobile-nav-button:hover, From 0b269f78a406fd99b5393f8f439fac7c0a4faab6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 23:11:22 -0500 Subject: [PATCH 33/37] Resolve from peerDependencies, then just fallback to the latest version --- src/lib/build/esmPlugin.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/build/esmPlugin.ts b/src/lib/build/esmPlugin.ts index 9651ae3b..cea8dba4 100644 --- a/src/lib/build/esmPlugin.ts +++ b/src/lib/build/esmPlugin.ts @@ -5,6 +5,7 @@ interface PackageLock { [key: string]: { name?: string; version: string; + peerDependencies?: { [key: string]: string }; } | undefined; }; } @@ -77,8 +78,9 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin { // Handle transitive dependency versions const keys: string[] = []; + let importerPackage: string | undefined; try { - const importerPackage = extractPackageName(args.importer); + importerPackage = extractPackageName(args.importer); keys.push( `node_modules/${importerPackage}/node_modules/${packageName}`, ); @@ -97,12 +99,13 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin { .find((info) => info); const packagePath = args.path.slice(packageName.length); - const version = packageInfo?.version; + const version = packageInfo?.version + || packageLock.packages[`node_modules/${importerPackage}`]?.peerDependencies?.[packageName]; - if (!version) return; - - const name = packageInfo.name ?? packageName; - const specifier = `${name}@${version}${packagePath}`; + const name = packageInfo?.name ?? packageName; + const specifier = version + ? `${name}@${version}${packagePath}` + : `${name}${packagePath}`; const url = new URL(`https://esm.sh/*${specifier}`); From 787877d2c750f1c280547144b960a5f5db7912b4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 23:15:58 -0500 Subject: [PATCH 34/37] Handle `data:` URLs --- src/lib/build/fsPlugin.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/build/fsPlugin.ts b/src/lib/build/fsPlugin.ts index 7d35b0eb..cb53dd4e 100644 --- a/src/lib/build/fsPlugin.ts +++ b/src/lib/build/fsPlugin.ts @@ -8,6 +8,13 @@ export function fsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { name: "fs", setup(build) { + build.onResolve({ filter: /^data:/ }, (args) => { + return { + path: args.path, + external: true, + }; + }); + build.onResolve({ filter: /.*/ }, async (args) => { let resolved: string; From f0223325955077cf12e5257f39ff0dfde79d2f61 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 23:47:53 -0500 Subject: [PATCH 35/37] Add shakespeare.svg and ShakespeareLogo component --- index.html | 2 +- public/manifest.webmanifest | 4 +- public/{favicon.png => shakespeare.png} | Bin public/shakespeare.svg | 63 ++++++++++++++++++++++++ src/components/OnboardingDialog.tsx | 8 ++- src/components/ProjectSidebar.tsx | 8 +-- src/components/Shakespeare/ChatPane.tsx | 9 ++-- src/components/ShakespeareLogo.tsx | 13 +++++ src/pages/Index.tsx | 7 +-- 9 files changed, 89 insertions(+), 25 deletions(-) rename public/{favicon.png => shakespeare.png} (100%) create mode 100644 public/shakespeare.svg create mode 100644 src/components/ShakespeareLogo.tsx diff --git a/index.html b/index.html index 752478ff..61806719 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index f30b2c96..ed0d3952 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -8,12 +8,12 @@ "theme_color": "#000000", "icons": [ { - "src": "/favicon.png", + "src": "/shakespeare.png", "sizes": "192x192", "type": "image/png" }, { - "src": "/favicon.png", + "src": "/shakespeare.png", "sizes": "512x512", "type": "image/png" } diff --git a/public/favicon.png b/public/shakespeare.png similarity index 100% rename from public/favicon.png rename to public/shakespeare.png diff --git a/public/shakespeare.svg b/public/shakespeare.svg new file mode 100644 index 00000000..7eba08b6 --- /dev/null +++ b/public/shakespeare.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/OnboardingDialog.tsx b/src/components/OnboardingDialog.tsx index a38f07a8..e1d2ae0c 100644 --- a/src/components/OnboardingDialog.tsx +++ b/src/components/OnboardingDialog.tsx @@ -13,6 +13,8 @@ import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useLoginActions } from '@/hooks/useLoginActions'; import { useProviderModels } from '@/hooks/useProviderModels'; import { CreditsDialog } from '@/components/CreditsDialog'; +import { ShakespeareLogo } from '@/components/ShakespeareLogo'; + interface OnboardingDialogProps { open: boolean; onOpenChange: (open: boolean) => void; @@ -151,11 +153,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) {step === 'welcome' && (
- Shakespeare +

diff --git a/src/components/ProjectSidebar.tsx b/src/components/ProjectSidebar.tsx index 0cf0ae77..ec800bc0 100644 --- a/src/components/ProjectSidebar.tsx +++ b/src/components/ProjectSidebar.tsx @@ -9,10 +9,10 @@ import { useProjects } from '@/hooks/useProjects'; import { useProjectSessionStatus } from '@/hooks/useProjectSessionStatus'; import { useLocalStorage } from '@/hooks/useLocalStorage'; import { useIsMobile } from '@/hooks/useIsMobile'; - import type { Project } from '@/lib/ProjectsManager'; import { cn } from '@/lib/utils'; import { useQueryClient } from '@tanstack/react-query'; +import { ShakespeareLogo } from '@/components/ShakespeareLogo'; interface ProjectItemProps { project: Project; @@ -137,11 +137,7 @@ export function ProjectSidebar({ onClick={() => navigateAndClose('/')} className="flex items-center gap-3 hover:opacity-80 transition-opacity text-left" > - Shakespeare +

Shakespeare

diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index 0a7cecd6..298e2ef6 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -41,6 +41,7 @@ import OpenAI from 'openai'; import { saveFileToTmp } from '@/lib/fileUtils'; import { useGit } from '@/hooks/useGit'; import { Quilly } from '@/components/Quilly'; +import { ShakespeareLogo } from '@/components/ShakespeareLogo'; // Clean interfaces now handled by proper hooks @@ -185,7 +186,7 @@ export const ChatPane = forwardRef(({ artist: `Working on ${projectId}...`, artwork: [ { - src: '/favicon.png', + src: '/shakespeare.png', sizes: '512x512', type: 'image/png' } @@ -526,11 +527,7 @@ export const ChatPane = forwardRef(({
- Shakespeare +

diff --git a/src/components/ShakespeareLogo.tsx b/src/components/ShakespeareLogo.tsx new file mode 100644 index 00000000..44230c1a --- /dev/null +++ b/src/components/ShakespeareLogo.tsx @@ -0,0 +1,13 @@ +export interface ShakespeareLogoProps { + className?: string; +} + +export function ShakespeareLogo({ className }: ShakespeareLogoProps) { + return ( + Shakespeare + ); +} \ No newline at end of file diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 5e87f3cf..2803d804 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -21,6 +21,7 @@ import { ModelSelector } from '@/components/ModelSelector'; import { FileAttachment } from '@/components/ui/file-attachment'; import { Plus } from 'lucide-react'; import { useSeoMeta } from '@unhead/react'; +import { ShakespeareLogo } from '@/components/ShakespeareLogo'; export default function Index() { const { t } = useTranslation(); @@ -268,11 +269,7 @@ export default function Index() {
- Shakespeare +

{t('buildNostrApps')} From bb8912dd579da83f2971b1b13571be6ca69bcb09 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 28 Sep 2025 16:10:59 +0700 Subject: [PATCH 36/37] show git failure toasts indefinitely --- src/components/GitDialog.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/GitDialog.tsx b/src/components/GitDialog.tsx index e53629ee..08f76ce4 100644 --- a/src/components/GitDialog.tsx +++ b/src/components/GitDialog.tsx @@ -335,6 +335,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog title: "Push to Nostr failed", description: errorMessage, variant: "destructive", + duration: Infinity, }); } finally { setIsPushingToNostr(false); @@ -396,6 +397,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog title: "Push failed", description: errorMessage, variant: "destructive", + duration: Infinity, }); } finally { setIsPushing(false); @@ -474,6 +476,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog title: "Pull failed", description: errorMessage, variant: "destructive", + duration: Infinity, }); } finally { setIsPulling(false); From d1d8f1dd15e51b2bcfe13e845dc02bf277ec7287 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 28 Sep 2025 10:16:22 -0500 Subject: [PATCH 37/37] Fix CSS relative imports --- src/lib/build/esmPlugin.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/build/esmPlugin.ts b/src/lib/build/esmPlugin.ts index cea8dba4..d41f50de 100644 --- a/src/lib/build/esmPlugin.ts +++ b/src/lib/build/esmPlugin.ts @@ -80,6 +80,10 @@ export function esmPlugin(packageLock: PackageLock, target?: string): Plugin { const keys: string[] = []; let importerPackage: string | undefined; try { + const { pathname } = new URL(args.importer); + if (/\.css$/.test(pathname)) { + return; // CSS imports don't have external dependencies + } importerPackage = extractPackageName(args.importer); keys.push( `node_modules/${importerPackage}/node_modules/${packageName}`,