mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
Merge branch 'ppqFeedback' into 'main'
PPQ Feedback See merge request soapbox-pub/shakespeare!97
This commit is contained in:
commit
79759af337
15 files changed
+273
-159
No files matched your search
Generated
-20
@@ -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": [
|
||||
|
||||
+2
-3
@@ -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() {
|
||||
<Route path="/oauth/vercel" element={<VercelOAuth />} />
|
||||
<Route path="/oauth/openrouter" element={<OpenRouterOAuth />} />
|
||||
<Route path="/settings" element={<SettingsLayout />}>
|
||||
<Route index element={<Settings />} />
|
||||
<Route index element={<Navigate to="/settings/preferences" replace />} />
|
||||
<Route path="preferences" element={<Preferences />} />
|
||||
<Route path="nostr" element={<NostrSettings />} />
|
||||
<Route path="ai" element={<AISettings />} />
|
||||
|
||||
@@ -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) ? (
|
||||
<X className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||
|
||||
@@ -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({
|
||||
|
||||
<DropdownMenuItem
|
||||
onClick={onNewChat}
|
||||
disabled={isAILoading}
|
||||
disabled={isAnyLoading}
|
||||
className="gap-2"
|
||||
>
|
||||
<MessageSquarePlus className="h-4 w-4" />
|
||||
|
||||
@@ -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 (
|
||||
<div className="border-t p-4">
|
||||
{/* Chat Input Container */}
|
||||
@@ -99,7 +114,7 @@ export const ChatInput = memo(function ChatInput({
|
||||
onDragEnter={onDragEnter}
|
||||
onDragOver={onDragOver}
|
||||
onDragLeave={onDragLeave}
|
||||
onDrop={onDrop}
|
||||
onDrop={handleDrop}
|
||||
>
|
||||
<Textarea
|
||||
value={input}
|
||||
|
||||
@@ -16,11 +16,8 @@ import { GitStatusIndicator } from '@/components/GitStatusIndicator';
|
||||
import { BranchSwitcher } from '@/components/BranchSwitcher';
|
||||
import { BrowserAddressBar } from '@/components/ui/browser-address-bar';
|
||||
import { type DeviceMode } from '@/components/ui/device-toggle';
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from '@/components/ui/popover';
|
||||
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '@/components/ui/resizable';
|
||||
import type { ImperativePanelHandle } from 'react-resizable-panels';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { FileTree } from './FileTree';
|
||||
import { FileEditor } from './FileEditor';
|
||||
@@ -83,8 +80,11 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable
|
||||
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
const [deviceMode, setDeviceMode] = useState<DeviceMode>('laptop');
|
||||
const [isLogsOpen, setIsLogsOpen] = useState(false);
|
||||
const previewContainerRef = useRef<HTMLDivElement>(null);
|
||||
const iframeRef = useRef<HTMLIFrameElement>(null);
|
||||
const iframePanelRef = useRef<ImperativePanelHandle>(null);
|
||||
const logsPanelRef = useRef<ImperativePanelHandle>(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<number | null>(null);
|
||||
const [copiedMessageIndex, setCopiedMessageIndex] = useState<number | null>(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 (
|
||||
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-8 gap-2 relative"
|
||||
>
|
||||
<Bug className="h-4 w-4" />
|
||||
<span className="hidden lg:inline">Logs</span>
|
||||
{hasConsoleErrors && (
|
||||
<span className="absolute -top-1 -right-1 h-3 w-3 rounded-full border-2 border-background bg-red-500" />
|
||||
)}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
align="end"
|
||||
className="w-[calc(100vw-1rem)] max-w-[480px] max-h-[512px] overflow-hidden shadow-lg border rounded-lg bg-background p-0 z-[9999]"
|
||||
sideOffset={4}
|
||||
>
|
||||
|
||||
{/* Messages */}
|
||||
<div className="h-[60vh] max-h-[512px] w-full bg-background text-foreground font-mono text-xs relative overflow-y-auto overflow-x-hidden [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">
|
||||
<div className="py-2 px-1 space-y-0">
|
||||
{messageCount === 0 ? (
|
||||
<div className="flex flex-col items-center justify-center py-12 text-center">
|
||||
<p className="text-sm text-muted-foreground font-medium">No console messages</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">Messages from your project will appear here</p>
|
||||
</div>
|
||||
) : (
|
||||
messages.map((msg, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="group relative py-0.5 px-1 hover:bg-muted/50 transition-colors duration-150 rounded cursor-pointer"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
copyMessageToClipboard(msg, index);
|
||||
}}
|
||||
>
|
||||
<div className={cn(
|
||||
"text-xs font-mono leading-tight whitespace-pre-wrap break-words",
|
||||
msg.level === 'error' ? "text-destructive" :
|
||||
msg.level === 'warn' ? "text-warning" :
|
||||
msg.level === 'info' ? "text-primary" :
|
||||
"text-muted-foreground"
|
||||
)}>
|
||||
{msg.message}
|
||||
</div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
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 ? (
|
||||
<Check className="h-2 w-2 text-success" />
|
||||
) : (
|
||||
<Copy className="h-2 w-2" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Close button */}
|
||||
<button
|
||||
onClick={() => 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"
|
||||
>
|
||||
<X className="h-5 w-5 text-muted-foreground" />
|
||||
</button>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
);
|
||||
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 (
|
||||
<div className="h-full">
|
||||
<Tabs value={activeTab} className="h-full">
|
||||
@@ -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 ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
@@ -659,45 +600,174 @@ export function PreviewPane({ projectId, activeTab, onToggleView, isPreviewable
|
||||
size="sm"
|
||||
onClick={onToggleView}
|
||||
className="h-8 gap-2"
|
||||
title={t('codeButtonTooltip')}
|
||||
>
|
||||
<Code className="h-4 w-4" />
|
||||
<span className="hidden lg:inline">Code</span>
|
||||
</Button>
|
||||
)}
|
||||
<ConsoleDropdown />
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsLogsOpen(!isLogsOpen)}
|
||||
className={cn("h-8 gap-2 relative", isLogsOpen && "bg-muted")}
|
||||
title={t('logsButtonTooltip')}
|
||||
>
|
||||
<Bug className="h-4 w-4" />
|
||||
<span className="hidden lg:inline">Logs</span>
|
||||
{hasConsoleErrors && (
|
||||
<span className="absolute -top-1 -right-1 h-3 w-3 rounded-full border-2 border-background bg-red-500" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Content area */}
|
||||
<div className="flex-1 flex items-center justify-center bg-muted/30">
|
||||
{hasBuiltProject ? (
|
||||
<div
|
||||
className={cn(
|
||||
"h-full transition-all duration-300 ease-in-out bg-background",
|
||||
deviceMode === 'laptop' && "w-full",
|
||||
deviceMode === 'tablet' && "w-full max-w-3xl shadow-lg",
|
||||
deviceMode === 'phone' && "w-full max-w-sm shadow-lg"
|
||||
)}
|
||||
<div className="flex-1 bg-muted/30 min-h-0 overflow-hidden">
|
||||
<ResizablePanelGroup direction="vertical" className="h-full">
|
||||
<ResizablePanel
|
||||
ref={iframePanelRef}
|
||||
defaultSize={isLogsOpen ? 60 : 100}
|
||||
minSize={30}
|
||||
className="min-h-0"
|
||||
>
|
||||
<iframe
|
||||
key={projectId}
|
||||
ref={iframeRef}
|
||||
src={`https://${projectId}.${previewDomain}/`}
|
||||
className="w-full h-full border-0"
|
||||
title="Project Preview"
|
||||
sandbox="allow-scripts allow-same-origin allow-forms"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="h-full w-full flex items-center justify-center bg-muted">
|
||||
<div className="text-center">
|
||||
<h3 className="text-lg font-semibold mb-2">{t('projectPreview')}</h3>
|
||||
<p className="text-muted-foreground">
|
||||
{t('buildProjectToSeePreview')}
|
||||
</p>
|
||||
<div className="h-full flex items-center justify-center min-h-0">
|
||||
{hasBuiltProject ? (
|
||||
<div
|
||||
className={cn(
|
||||
"h-full transition-all duration-300 ease-in-out bg-background",
|
||||
deviceMode === 'laptop' && "w-full",
|
||||
deviceMode === 'tablet' && "w-full max-w-3xl shadow-lg",
|
||||
deviceMode === 'phone' && "w-full max-w-sm shadow-lg"
|
||||
)}
|
||||
>
|
||||
<iframe
|
||||
key={projectId}
|
||||
ref={iframeRef}
|
||||
src={`https://${projectId}.${previewDomain}/`}
|
||||
className="w-full h-full border-0"
|
||||
title="Project Preview"
|
||||
sandbox="allow-scripts allow-same-origin allow-forms"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="h-full w-full flex items-center justify-center bg-muted">
|
||||
<div className="text-center">
|
||||
<h3 className="text-lg font-semibold mb-2">{t('projectPreview')}</h3>
|
||||
<p className="text-muted-foreground">
|
||||
{t('buildProjectToSeePreview')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</ResizablePanel>
|
||||
<ResizableHandle withHandle className={cn(!isLogsOpen && "hidden")} />
|
||||
<ResizablePanel
|
||||
ref={logsPanelRef}
|
||||
defaultSize={isLogsOpen ? 40 : 0}
|
||||
minSize={0}
|
||||
maxSize={isLogsOpen ? undefined : 0}
|
||||
className="min-h-0 min-w-0"
|
||||
collapsible
|
||||
collapsedSize={0}
|
||||
>
|
||||
{/* Logs Panel */}
|
||||
<div className="h-full flex flex-col bg-background border-t overflow-hidden min-h-0 w-full min-w-0">
|
||||
{/* Logs Header */}
|
||||
<div className="h-12 px-4 border-b flex items-center justify-between flex-shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
{hasConsoleErrors && (
|
||||
<span className="h-2 w-2 rounded-full bg-red-500" />
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{messageCount > 0 && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={copyAllMessagesToClipboard}
|
||||
className="h-7 px-2 text-xs"
|
||||
>
|
||||
{copiedAll ? (
|
||||
<>
|
||||
<Check className="h-3 w-3 mr-1.5 text-success" />
|
||||
{t('copied')}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Copy className="h-3 w-3 mr-1.5" />
|
||||
{t('copyAll')}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsLogsOpen(false)}
|
||||
className="h-7 w-7 p-0"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{/* Logs Content */}
|
||||
<div className="flex-1 min-h-0 overflow-hidden w-full">
|
||||
<ScrollArea className="h-full w-full">
|
||||
<div className="p-2 space-y-0 w-full min-w-0 max-w-full">
|
||||
{messageCount === 0 ? (
|
||||
<div className="flex flex-col items-center justify-center py-12 text-center">
|
||||
<p className="text-sm text-muted-foreground font-medium">No console messages</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">Messages from your project will appear here</p>
|
||||
</div>
|
||||
) : (
|
||||
messages.map((msg, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="group relative py-0.5 px-1 hover:bg-muted/50 transition-colors duration-150 rounded cursor-pointer w-full max-w-full"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
copyMessageToClipboard(msg, index);
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
"text-xs font-mono leading-tight whitespace-pre-wrap break-words w-full min-w-0 max-w-full",
|
||||
msg.level === 'error' ? "text-destructive" :
|
||||
msg.level === 'warn' ? "text-warning" :
|
||||
msg.level === 'info' ? "text-primary" :
|
||||
"text-muted-foreground"
|
||||
)}
|
||||
style={{ wordBreak: 'break-word', overflowWrap: 'break-word' }}
|
||||
>
|
||||
{msg.message}
|
||||
</div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
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 ? (
|
||||
<Check className="h-2 w-2 text-success" />
|
||||
) : (
|
||||
<Copy className="h-2 w-2" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</div>
|
||||
|
||||
{/* Build loading overlay */}
|
||||
|
||||
@@ -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 (
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
@@ -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')}
|
||||
>
|
||||
<Rocket className={cn("size-5 group-hover:text-foreground", open ? "text-foreground" : "text-muted-foreground")} />
|
||||
</Button>
|
||||
|
||||
@@ -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')}
|
||||
>
|
||||
<CloudUpload className={cn("size-5 group-hover:text-foreground", open ? "text-foreground" : "text-muted-foreground")} />
|
||||
{renderIndicator()}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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ẹ",
|
||||
|
||||
@@ -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": "创建您的第一个项目开始使用",
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user