diff --git a/package-lock.json b/package-lock.json index d3dccb46..cee59369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4656,7 +4656,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4670,7 +4669,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4684,7 +4682,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4698,7 +4695,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4712,7 +4708,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4726,7 +4721,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4740,7 +4734,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4754,7 +4747,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4768,7 +4760,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4782,7 +4773,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4796,7 +4786,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4810,7 +4799,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4824,7 +4812,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4838,7 +4825,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4852,7 +4838,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4866,7 +4851,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4880,7 +4864,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4894,7 +4877,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4908,7 +4890,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -4922,7 +4903,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ diff --git a/src/AppRouter.tsx b/src/AppRouter.tsx index 04d2723d..5fc72c30 100644 --- a/src/AppRouter.tsx +++ b/src/AppRouter.tsx @@ -1,11 +1,10 @@ -import { BrowserRouter, HashRouter, Route, Routes } from "react-router-dom"; +import { BrowserRouter, HashRouter, Route, Routes, Navigate } from "react-router-dom"; import { ScrollToTop } from "./components/ScrollToTop"; import { SessionMonitor } from "./components/SessionMonitor"; import { URLFragmentHandler } from "./components/URLFragmentHandler"; import Index from "./pages/Index"; import Clone from "./pages/Clone"; -import Settings from "./pages/Settings"; import Preferences from "./pages/Preferences"; import NostrSettings from "./pages/NostrSettings"; import AISettings from "./pages/AISettings"; @@ -42,7 +41,7 @@ export function AppRouter() { } /> } /> }> - } /> + } /> } /> } /> } /> diff --git a/src/components/ProjectSidebar.tsx b/src/components/ProjectSidebar.tsx index 108f5f5a..b30af91f 100644 --- a/src/components/ProjectSidebar.tsx +++ b/src/components/ProjectSidebar.tsx @@ -327,6 +327,7 @@ export function ProjectSidebar({ className="h-8 w-8 p-0 hover:bg-primary/10 -mr-2" onClick={handleToggleSidebar} aria-label={(onClose && isMobile) ? t('closeSidebar') : t('collapseSidebar')} + title={(onClose && isMobile) ? t('closeSidebar') : t('hidePaneButtonTooltip')} > {(onClose && isMobile) ? ( diff --git a/src/components/ProjectTitleMenu.tsx b/src/components/ProjectTitleMenu.tsx index 4ba8d067..1a76cdb4 100644 --- a/src/components/ProjectTitleMenu.tsx +++ b/src/components/ProjectTitleMenu.tsx @@ -27,7 +27,6 @@ interface ProjectTitleMenuProps { onDuplicate: () => void; onDelete: () => void; onProjectDetails: () => void; - isAILoading: boolean; isAnyLoading: boolean; className?: string; } @@ -40,7 +39,6 @@ export function ProjectTitleMenu({ onDuplicate, onDelete, onProjectDetails, - isAILoading, isAnyLoading, className = '', }: ProjectTitleMenuProps) { @@ -111,7 +109,7 @@ export function ProjectTitleMenu({ diff --git a/src/components/Shakespeare/ChatInput.tsx b/src/components/Shakespeare/ChatInput.tsx index 5c4fef04..3045fc6b 100644 --- a/src/components/Shakespeare/ChatInput.tsx +++ b/src/components/Shakespeare/ChatInput.tsx @@ -89,6 +89,21 @@ export const ChatInput = memo(function ChatInput({ setInput(e.target.value); }, []); + const handleDrop = useCallback((e: React.DragEvent) => { + e.preventDefault(); + e.stopPropagation(); + + // Call parent's drop handler for visual state management + onDrop(e); + + // Extract files from the drop event + const files = Array.from(e.dataTransfer.files); + if (files.length === 0) return; + + // Add all files without validation + setAttachedFiles(prev => [...prev, ...files]); + }, [onDrop]); + return ( {/* Chat Input Container */} @@ -99,7 +114,7 @@ export const ChatInput = memo(function ChatInput({ onDragEnter={onDragEnter} onDragOver={onDragOver} onDragLeave={onDragLeave} - onDrop={onDrop} + onDrop={handleDrop} > ('laptop'); + const [isLogsOpen, setIsLogsOpen] = useState(false); const previewContainerRef = useRef(null); const iframeRef = useRef(null); + const iframePanelRef = useRef(null); + const logsPanelRef = useRef(null); const { fs } = useFS(); const { projectsPath } = useFSPaths(); const projectsManager = useProjectsManager(); @@ -488,106 +488,47 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable } }; - const ConsoleDropdown = () => { - const [isOpen, setIsOpen] = useState(false); - const [copiedMessageIndex, setCopiedMessageIndex] = useState(null); + const [copiedMessageIndex, setCopiedMessageIndex] = useState(null); + const [copiedAll, setCopiedAll] = useState(false); - const messages = isOpen ? getConsoleMessages() : []; + const messages = isLogsOpen ? getConsoleMessages() : []; - const copyMessageToClipboard = async (msg: ConsoleMessage, index: number) => { - try { - await navigator.clipboard.writeText(msg.message); - setCopiedMessageIndex(index); - setTimeout(() => setCopiedMessageIndex(null), 2000); - } catch (error) { - console.error('Failed to copy message to clipboard:', error); - } - }; - - const messageCount = messages.length; - - return ( - - - - - Logs - {hasConsoleErrors && ( - - )} - - - - - {/* Messages */} - - - {messageCount === 0 ? ( - - No console messages - Messages from your project will appear here - - ) : ( - messages.map((msg, index) => ( - { - e.stopPropagation(); - copyMessageToClipboard(msg, index); - }} - > - - {msg.message} - - { - e.preventDefault(); - e.stopPropagation(); - copyMessageToClipboard(msg, index); - }} - className="h-3 w-3 p-0 opacity-0 group-hover:opacity-100 transition-all duration-200 absolute right-1 top-1 hover:bg-muted/70 text-muted-foreground hover:text-foreground bg-background/80 rounded border" - > - {copiedMessageIndex === index ? ( - - ) : ( - - )} - - - )) - )} - - - - {/* Close button */} - setIsOpen(false)} - className="absolute top-2 right-2 h-8 w-8 p-0 bg-muted/50 hover:bg-muted/70 rounded-md z-10 flex items-center justify-center border" - > - - - - - ); + const copyMessageToClipboard = async (msg: ConsoleMessage, index: number) => { + try { + await navigator.clipboard.writeText(msg.message); + setCopiedMessageIndex(index); + setTimeout(() => setCopiedMessageIndex(null), 2000); + } catch (error) { + console.error('Failed to copy message to clipboard:', error); + } }; + const copyAllMessagesToClipboard = async () => { + try { + const allMessages = messages.map(msg => msg.message).join('\n'); + await navigator.clipboard.writeText(allMessages); + setCopiedAll(true); + setTimeout(() => setCopiedAll(false), 2000); + } catch (error) { + console.error('Failed to copy all messages to clipboard:', error); + } + }; + + const messageCount = messages.length; + + // Programmatically resize panels when isLogsOpen changes + useEffect(() => { + if (isLogsOpen) { + // Open logs panel to 40% and resize iframe to 60% + logsPanelRef.current?.resize(40); + iframePanelRef.current?.resize(60); + } else { + // Close logs panel and expand iframe to 100% + logsPanelRef.current?.resize(0); + iframePanelRef.current?.resize(100); + } + }, [isLogsOpen]); + return ( @@ -644,7 +585,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable })} disabled={isBuildLoading} className="h-8 gap-2" - title="Build project" + title={t('buildButtonTooltip')} > {isBuildLoading ? ( @@ -659,45 +600,174 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable size="sm" onClick={onToggleView} className="h-8 gap-2" + title={t('codeButtonTooltip')} > Code )} - + setIsLogsOpen(!isLogsOpen)} + className={cn("h-8 gap-2 relative", isLogsOpen && "bg-muted")} + title={t('logsButtonTooltip')} + > + + Logs + {hasConsoleErrors && ( + + )} + {/* Content area */} - - {hasBuiltProject ? ( - + + - - - ) : ( - - - {t('projectPreview')} - - {t('buildProjectToSeePreview')} - + + {hasBuiltProject ? ( + + + + ) : ( + + + {t('projectPreview')} + + {t('buildProjectToSeePreview')} + + + + )} - - )} + + + + {/* Logs Panel */} + + {/* Logs Header */} + + + {hasConsoleErrors && ( + + )} + + + {messageCount > 0 && ( + + {copiedAll ? ( + <> + + {t('copied')} + > + ) : ( + <> + + {t('copyAll')} + > + )} + + )} + setIsLogsOpen(false)} + className="h-7 w-7 p-0" + > + + + + + {/* Logs Content */} + + + + {messageCount === 0 ? ( + + No console messages + Messages from your project will appear here + + ) : ( + messages.map((msg, index) => ( + { + e.stopPropagation(); + copyMessageToClipboard(msg, index); + }} + > + + {msg.message} + + { + e.preventDefault(); + e.stopPropagation(); + copyMessageToClipboard(msg, index); + }} + className="h-3 w-3 p-0 opacity-0 group-hover:opacity-100 transition-all duration-200 absolute right-1 top-1 hover:bg-muted/70 text-muted-foreground hover:text-foreground bg-background/80 rounded border" + > + {copiedMessageIndex === index ? ( + + ) : ( + + )} + + + )) + )} + + + + + + {/* Build loading overlay */} diff --git a/src/components/deploy/DeployButton.tsx b/src/components/deploy/DeployButton.tsx index bb2d2232..d78043be 100644 --- a/src/components/deploy/DeployButton.tsx +++ b/src/components/deploy/DeployButton.tsx @@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import { cn } from '@/lib/utils'; import { DeploySteps } from './DeploySteps'; +import { useTranslation } from 'react-i18next'; interface DeployButtonProps { projectId: string; @@ -14,6 +15,7 @@ interface DeployButtonProps { export function DeployButton({ projectId, projectName, className, disabled }: DeployButtonProps) { const [open, setOpen] = useState(false); + const { t } = useTranslation(); return ( @@ -24,6 +26,7 @@ export function DeployButton({ projectId, projectName, className, disabled }: De className={cn("size-8 p-0 group", className)} aria-label="Deploy project" disabled={disabled} + title={t('deployButtonTooltip')} > diff --git a/src/components/git-sync/GitSyncButton.tsx b/src/components/git-sync/GitSyncButton.tsx index e4227674..11972ff5 100644 --- a/src/components/git-sync/GitSyncButton.tsx +++ b/src/components/git-sync/GitSyncButton.tsx @@ -7,6 +7,7 @@ import { useGitSyncState } from '@/hooks/useGitSyncState'; import { useFSPaths } from '@/hooks/useFSPaths'; import { cn } from '@/lib/utils'; import { GitSyncSteps } from './GitSyncSteps'; +import { useTranslation } from 'react-i18next'; interface GitSyncButtonProps { projectId: string; @@ -18,6 +19,7 @@ export function GitSyncButton({ projectId, className }: GitSyncButtonProps) { const [syncSuccess, setSyncSuccess] = useState(false); const [showWarningPopover, setShowWarningPopover] = useState(false); const warningDismissed = useRef(false); + const { t } = useTranslation(); const { data: gitStatus, isLoading: isGitStatusLoading } = useGitStatus(projectId); const { getError, getState } = useGitSyncState(); @@ -129,6 +131,7 @@ export function GitSyncButton({ projectId, className }: GitSyncButtonProps) { className={cn("size-8 p-0 group relative", className)} aria-label="Sync with Git" onClick={handleButtonClick} + title={t('cloudSyncButtonTooltip')} > {renderIndicator()} diff --git a/src/locales/en.json b/src/locales/en.json index 31ae3827..ae0b8a9a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -78,6 +78,7 @@ "save": "Save", "cancel": "Cancel", "close": "Close", + "copyAll": "Copy All", "open": "Open", "edit": "Edit", "delete": "Delete", @@ -104,6 +105,12 @@ "gitSettingsDescription": "Configure Git credentials for HTTP authentication", "deploySettings": "Deployment", "deploySettingsDescription": "Configure deployment providers", + "deployButtonTooltip": "Deploy your project to a website", + "cloudSyncButtonTooltip": "Sync your project with Git to back up files", + "buildButtonTooltip": "Build project and update preview", + "codeButtonTooltip": "Switch to code editor to view and edit files", + "logsButtonTooltip": "View console messages and logs from project", + "hidePaneButtonTooltip": "Hide sidebar", "nostrSettings": "Nostr", "nostrSettingsDescription": "Configure relay connections and Nostr preferences", "storageSettings": "Storage", diff --git a/src/locales/ha.json b/src/locales/ha.json index 8cbc06f9..80844246 100644 --- a/src/locales/ha.json +++ b/src/locales/ha.json @@ -75,6 +75,7 @@ "save": "Ajiye", "cancel": "Soke", "close": "Rufe", + "copyAll": "Kwafi Duka", "open": "Buɗe", "edit": "Gyara", "delete": "Share", @@ -102,11 +103,18 @@ "gitSettingsDescription": "Saita bayanan shaidar Git don tabbatar da HTTP", "nostrSettings": "Nostr", "nostrSettingsDescription": "Saita haɗin relay da zaɓuɓɓukan Nostr", + "deployButtonTooltip": "Saka aikin ku zuwa gidan yanar gizo", + "cloudSyncButtonTooltip": "Haɗa aikin ku tare da Git don adana fayiloli", + "buildButtonTooltip": "Gina aiki kuma sabunta samfoti", + "codeButtonTooltip": "Canza zuwa editan code don duba da gyara fayiloli", + "logsButtonTooltip": "Duba saƙonni na console da log daga aiki", + "hidePaneButtonTooltip": "Ɓoye sidebar", "storageSettings": "Ajiya", "storageSettingsDescription": "Fitar da fayiloli da sarrafa bayanan gida", "emailUpdates": "Sabuntawar Imel", "emailUpdatesDescription": "Yi rajista don karbar sabuntawar Shakespeare da albarkatu", "newProject": "Sabon Aikin", + "newChat": "Sabon Hira", "importRepository": "Shigo da Repository", "noProjectsYet": "Babu ayyuka har yanzu", "createFirstProject": "Ƙirƙiri aikin farko don farawa", diff --git a/src/locales/ig.json b/src/locales/ig.json index c294627d..c2909e96 100644 --- a/src/locales/ig.json +++ b/src/locales/ig.json @@ -75,6 +75,7 @@ "save": "Chekwaa", "cancel": "Kagbuo", "close": "Mechie", + "copyAll": "Detuo Ihe Niile", "open": "Meghee", "edit": "Dezie", "delete": "Hichapụ", @@ -102,11 +103,18 @@ "gitSettingsDescription": "Hazie nzere Git maka nkwenye HTTP", "nostrSettings": "Nostr", "nostrSettingsDescription": "Hazie njikọ relay na nhọrọ Nostr", + "deployButtonTooltip": "Buga ọrụ gị na weebụsaịtị", + "cloudSyncButtonTooltip": "Mekọrịta ọrụ gị na Git iji chekwaa faịlụ", + "buildButtonTooltip": "Wulie ọrụ ma melite nlele", + "codeButtonTooltip": "Gbanwee gaa na onye dezie koodu iji lee ma dezie faịlụ", + "logsButtonTooltip": "Lelee ozi console na log sitere na ọrụ", + "hidePaneButtonTooltip": "Zoo sidebar", "storageSettings": "Nchekwa", "storageSettingsDescription": "Bupụta faịlụ na jikwaa data mpaghara", "emailUpdates": "Nmelite Email", "emailUpdatesDescription": "Debanye aha maka nmelite Shakespeare na akụrụngwa", "newProject": "Ọrụ Ọhụrụ", + "newChat": "Nkata Ọhụrụ", "importRepository": "Bubata Repository", "noProjectsYet": "Enwebeghị ọrụ ọ bụla", "createFirstProject": "Mepụta ọrụ mbụ gị iji malite", diff --git a/src/locales/pt.json b/src/locales/pt.json index 7fd72897..a015ac34 100644 --- a/src/locales/pt.json +++ b/src/locales/pt.json @@ -75,6 +75,7 @@ "save": "Salvar", "cancel": "Cancelar", "close": "Fechar", + "copyAll": "Copiar Tudo", "open": "Abrir", "edit": "Editar", "delete": "Excluir", @@ -102,6 +103,12 @@ "gitSettingsDescription": "Configure credenciais do Git para autenticação HTTP", "deploySettings": "Implantação", "deploySettingsDescription": "Configure provedores de implantação", + "deployButtonTooltip": "Implantar seu projeto em um site", + "cloudSyncButtonTooltip": "Sincronizar seu projeto com Git para fazer backup de arquivos", + "buildButtonTooltip": "Compilar projeto e atualizar visualização", + "codeButtonTooltip": "Alternar para o editor de código para visualizar e editar arquivos", + "logsButtonTooltip": "Visualizar mensagens do console e logs do projeto", + "hidePaneButtonTooltip": "Ocultar barra lateral", "nostrSettings": "Nostr", "nostrSettingsDescription": "Configure conexões de relay e preferências do Nostr", "storageSettings": "Armazenamento", @@ -109,6 +116,7 @@ "emailUpdates": "Atualizações por Email", "emailUpdatesDescription": "Inscreva-se para receber atualizações e recursos do Shakespeare", "newProject": "Novo Projeto", + "newChat": "Nova Conversa", "importRepository": "Importar Repositório", "noProjectsYet": "Nenhum projeto ainda", "createFirstProject": "Crie seu primeiro projeto para começar", diff --git a/src/locales/yo.json b/src/locales/yo.json index ed728d96..f784104a 100644 --- a/src/locales/yo.json +++ b/src/locales/yo.json @@ -75,6 +75,7 @@ "save": "Fi pamọ", "cancel": "Fagilee", "close": "Ti", + "copyAll": "Ṣẹda Gbogbo", "open": "Ṣi", "edit": "Ṣatunkọ", "delete": "Paarẹ", @@ -102,11 +103,18 @@ "gitSettingsDescription": "Tunto awọn ẹri Git fun ijẹrisi HTTP", "nostrSettings": "Nostr", "nostrSettingsDescription": "Tunto awọn asopọ relay ati awọn ayanfẹ Nostr", + "deployButtonTooltip": "Fi iṣẹ akanṣe rẹ sinu oju opo wẹẹbu kan", + "cloudSyncButtonTooltip": "Ṣe iṣopọ iṣẹ akanṣe rẹ pẹlu Git lati ṣe aabo awọn faili", + "buildButtonTooltip": "Kọ iṣẹ akanṣe ati ṣe imudojuiwọn awoṣe", + "codeButtonTooltip": "Yipada si olutọju koodu lati wo ati ṣatunkọ awọn faili", + "logsButtonTooltip": "Wo awọn ifiranṣẹ konsoli ati awọn log lati iṣẹ akanṣe", + "hidePaneButtonTooltip": "Fi ẹgbẹ ẹgbẹ pamọ", "storageSettings": "Ibi ipamọ", "storageSettingsDescription": "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", "newProject": "Iṣẹ akanṣe Tuntun", + "newChat": "Ibaraẹnisọrọ Tuntun", "importRepository": "Gbe Repository wọle", "noProjectsYet": "Ko si awọn iṣẹ akanṣe sibẹsibẹ", "createFirstProject": "Ṣẹda iṣẹ akanṣe akọkọ rẹ lati bẹrẹ", diff --git a/src/locales/zh.json b/src/locales/zh.json index fedad499..aa88ed17 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -75,6 +75,7 @@ "save": "保存", "cancel": "取消", "close": "关闭", + "copyAll": "复制全部", "open": "打开", "edit": "编辑", "delete": "删除", @@ -102,6 +103,12 @@ "gitSettingsDescription": "配置HTTP身份验证的Git凭据", "deploySettings": "部署", "deploySettingsDescription": "配置部署提供商", + "deployButtonTooltip": "将您的项目部署到网站", + "cloudSyncButtonTooltip": "使用Git同步项目以备份文件", + "buildButtonTooltip": "构建项目并更新预览", + "codeButtonTooltip": "切换到代码编辑器以查看和编辑文件", + "logsButtonTooltip": "查看项目的控制台消息和日志", + "hidePaneButtonTooltip": "隐藏侧边栏", "nostrSettings": "Nostr", "nostrSettingsDescription": "配置中继连接和Nostr偏好", "storageSettings": "存储", @@ -109,6 +116,7 @@ "emailUpdates": "邮件更新", "emailUpdatesDescription": "订阅Shakespeare更新和资源", "newProject": "新项目", + "newChat": "新聊天", "importRepository": "导入仓库", "noProjectsYet": "还没有项目", "createFirstProject": "创建您的第一个项目开始使用", diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx index 132c9c62..f033baef 100644 --- a/src/pages/ProjectView.tsx +++ b/src/pages/ProjectView.tsx @@ -217,7 +217,6 @@ export function ProjectView() { onDuplicate={() => setDuplicateDialogOpen(true)} onDelete={() => setDeleteDialogOpen(true)} onProjectDetails={() => setIsProjectDetailsOpen(true)} - isAILoading={isAILoading} isAnyLoading={isAnyLoading || isDeleting} className="text-base" /> @@ -447,7 +446,6 @@ export function ProjectView() { onDuplicate={() => setDuplicateDialogOpen(true)} onDelete={() => setDeleteDialogOpen(true)} onProjectDetails={() => setIsProjectDetailsOpen(true)} - isAILoading={isAILoading} isAnyLoading={isAnyLoading || isDeleting} className="text-lg" />
No console messages
Messages from your project will appear here
- {t('buildProjectToSeePreview')} -
+ {t('buildProjectToSeePreview')} +