Compare commits

...
Author SHA1 Message Date
Siddharth Singh e024c3725d add signer required and signer permissions dialogs 2025-12-01 18:17:07 +05:30
Siddharth Singh 2e3a4b9bd7 proxy nip-07 requests to parent page 2025-12-01 18:07:29 +05:30
Alex Gleason f0c1784288 Clone from Nostr URL 2025-11-28 21:32:46 -06:00
Alex Gleason 94b4dcbda6 Filter out invalid repos 2025-11-28 21:29:23 -06:00
Alex Gleason c49e8811af Show follows repositories in Clone tab 2025-11-28 21:25:55 -06:00
Alex Gleason 37c72391a0 Projects Sidebar improvements 2025-11-28 21:16:41 -06:00
Alex Gleason 6c92b2dc4d Shrink down settings navigation again 2025-11-28 21:14:37 -06:00
Alex Gleason 676655ef66 Improve hover state of select 2025-11-28 21:01:01 -06:00
Alex Gleason 27f9435be9 Add foreground to many elements in settings 2025-11-28 20:58:31 -06:00
Alex Gleason 32656a8f5c Improve Settings Items hover states 2025-11-28 20:21:23 -06:00
Alex Gleason bd9a276275 Let PWA update nag be dismissed 2025-11-28 20:14:56 -06:00
Alex Gleason 7fa4330249 Remove Nostr pigeonholing from system prompt 2025-11-28 20:08:53 -06:00
Alex Gleason b5c2c79feb Remove pointless buttons from RepositoryCard 2025-11-28 20:05:42 -06:00
Alex Gleason f3a3d31977 Add a list of your own ngit repos to clone on the import page 2025-11-28 20:03:06 -06:00
Alex Gleason 68eee82c92 Make everything a bit rounder 2025-11-28 15:10:49 -06:00
Alex Gleason cd006889c8 Add search to projects sidebar 2025-11-28 15:02:37 -06:00
Alex Gleason d23778547f Clean up unused settings i18n strings 2025-11-28 14:42:14 -06:00
Alex Gleason 627a43309c Improve mobile settings design 2025-11-28 14:33:33 -06:00
Alex Gleason 07d594a373 Settings design improvements 2025-11-28 14:28:36 -06:00
DanConwayDev 5b8cb25675 Revert "Checkout branch with "force" so it updates the tree"
This reverts commit d13bc84232.

proceed with caution on this as i dont know what you were fixing
with this change
2025-11-28 11:34:19 -06:00
DanConwayDev 89de28cb0c fix: recovered for detached HEAD
git_commit tool was showing a false positive when in reality no
commits were changed. there are also other issues in the UI whilst
in this state. eg. current branch doesn't show, cannot push or pull,
or 'push to nostr' or github or other remote.

warning this must be done in combination with reverting
d13bc84232 or the user will lose all
uncomitted changes
2025-11-28 11:34:19 -06:00
Alex Gleason c5e5cafb77 Add "Try again" action to Quilly fallback 2025-11-26 12:05:33 -06:00
Alex Gleason 926e63bb81 Poll the Lightning invoice screen for payment 2025-11-25 17:36:42 -06:00
48 changed files with 1529 additions and 350 deletions

No files matched your search

@@ -38,7 +38,14 @@ class JSONRPCClient {
} }
} }
async fetch(request) { /**
* Generic JSON-RPC call method
* @param {string} method - The RPC method name
* @param {object} params - Parameters for the method
* @param {number} timeout - Timeout in milliseconds (default: 10000)
* @returns {Promise} - Resolves with the result or rejects with error
*/
async call(method, params, timeout = 10000) {
const id = ++this.requestId; const id = ++this.requestId;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -47,21 +54,25 @@ class JSONRPCClient {
// Send JSON-RPC request to parent // Send JSON-RPC request to parent
window.parent.postMessage({ window.parent.postMessage({
jsonrpc: "2.0", jsonrpc: "2.0",
method: "fetch", method,
params: { request }, params,
id, id,
}, "*"); }, "*");
// Timeout after 10 seconds // Timeout handling
setTimeout(() => { setTimeout(() => {
if (this.pendingRequests.has(id)) { if (this.pendingRequests.has(id)) {
this.pendingRequests.delete(id); this.pendingRequests.delete(id);
reject(new Error(`Timeout fetching: ${request.url}`)); reject(new Error(`RPC call to ${method} with ID ${id} timed out`));
} }
}, 10000); }, timeout);
}); });
} }
async fetch(request) {
return this.call("fetch", { request }, 10000);
}
handleResponse(message) { handleResponse(message) {
const { id, result, error } = message; const { id, result, error } = message;
const pending = this.pendingRequests.get(id); const pending = this.pendingRequests.get(id);
@@ -153,6 +164,38 @@ class ConsoleInterceptor {
} }
} }
// Nostr Bridge - proxies window.nostr calls to parent window
class NostrBridge {
constructor(rpcClient) {
this.rpcClient = rpcClient;
console.log('[NostrBridge] initializing...');
this.injectNostr();
}
injectNostr() {
// Create the window.nostr object
window.nostr = {
getPublicKey: () => this.callNostrMethod('getPublicKey', []),
signEvent: (event) => this.callNostrMethod('signEvent', [event]),
nip04: {
encrypt: (pubkey, plaintext) => this.callNostrMethod('nip04.encrypt', [pubkey, plaintext]),
decrypt: (pubkey, ciphertext) => this.callNostrMethod('nip04.decrypt', [pubkey, ciphertext]),
},
nip44: {
encrypt: (pubkey, plaintext) => this.callNostrMethod('nip44.encrypt', [pubkey, plaintext]),
decrypt: (pubkey, ciphertext) => this.callNostrMethod('nip44.decrypt', [pubkey, ciphertext]),
},
};
console.log('[NostrBridge] window.nostr injected');
}
async callNostrMethod(method, args) {
// Use the generic RPC client call method
// Extension prompts may take time, so use 30 second timeout
return this.rpcClient.call('nostr', { method, args }, 30000);
}
}
// Navigation Handler - manages iframe navigation and history // Navigation Handler - manages iframe navigation and history
class NavigationHandler { class NavigationHandler {
constructor() { constructor() {
@@ -319,8 +362,8 @@ class NavigationHandler {
// Main Fetch Client // Main Fetch Client
class FetchClient { class FetchClient {
constructor() { constructor(rpcClient) {
this.rpcClient = new JSONRPCClient(); this.rpcClient = rpcClient;
this.consoleInterceptor = new ConsoleInterceptor(); this.consoleInterceptor = new ConsoleInterceptor();
this.navigationHandler = new NavigationHandler(); this.navigationHandler = new NavigationHandler();
this.init(); this.init();
@@ -393,8 +436,8 @@ class FetchClient {
active: navigator.serviceWorker.controller, active: navigator.serviceWorker.controller,
installing: null, installing: null,
waiting: null, waiting: null,
addEventListener: () => {}, addEventListener: () => { },
removeEventListener: () => {}, removeEventListener: () => { },
}); });
}; };
} }
@@ -569,8 +612,14 @@ const setupGlobalErrorHandlers = () => {
// Initialize // Initialize
setupGlobalErrorHandlers(); setupGlobalErrorHandlers();
const init = () => {
const rpcClient = new JSONRPCClient();
new FetchClient(rpcClient);
new NostrBridge(rpcClient);
}
if (document.readyState === "loading") { if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => new FetchClient()); document.addEventListener("DOMContentLoaded", init);
} else { } else {
new FetchClient(); init();
} }
+2 -2
View File
@@ -99,7 +99,7 @@ export function AppLayout({
onClick={() => setIsSidebarVisible(false)} onClick={() => setIsSidebarVisible(false)}
/> />
{/* Sidebar - positioned above the backdrop */} {/* Sidebar - positioned above the backdrop */}
<div className="relative left-0 top-0 h-full w-80 max-w-[80vw] bg-background border-r shadow-lg z-10"> <div className="relative left-0 top-0 h-full w-72 max-w-[80vw] bg-background border-r shadow-lg z-10">
<ProjectSidebar <ProjectSidebar
selectedProject={selectedProject} selectedProject={selectedProject}
onSelectProject={(project) => { onSelectProject={(project) => {
@@ -123,7 +123,7 @@ export function AppLayout({
<div className="min-h-screen flex bg-background"> <div className="min-h-screen flex bg-background">
{/* Fixed Sidebar - show if showSidebar is true and sidebar is visible */} {/* Fixed Sidebar - show if showSidebar is true and sidebar is visible */}
{showSidebar && isSidebarVisible && ( {showSidebar && isSidebarVisible && (
<div className="w-80 border-r bg-sidebar transition-all duration-300"> <div className="w-72 border-r bg-sidebar transition-all duration-300">
<ProjectSidebar <ProjectSidebar
selectedProject={selectedProject} selectedProject={selectedProject}
onSelectProject={handleProjectSelect} onSelectProject={handleProjectSelect}
+127 -14
View File
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react'; import { useState, useEffect, useCallback } from 'react';
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import QRCode from 'qrcode'; import QRCode from 'qrcode';
import { CreditCard, Zap, ExternalLink, RefreshCw, Check, X, Clock, AlertCircle, Copy, RotateCcw, ArrowLeft, Gift, Plus, History, DollarSign, Printer, Download } from 'lucide-react'; import { CreditCard, Zap, ExternalLink, RefreshCw, Check, X, Clock, AlertCircle, Copy, RotateCcw, ArrowLeft, Gift, Plus, History, DollarSign, Printer, Download } from 'lucide-react';
@@ -85,17 +85,33 @@ const PRESET_AMOUNTS = [5, 10, 25, 50, 100];
interface LightningPaymentProps { interface LightningPaymentProps {
invoice: string; invoice: string;
amount: number; amount: number;
paymentId: string;
provider: AIProvider;
onClose: () => void; onClose: () => void;
onPaymentCompleted: () => void;
} }
function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) { function LightningPayment({ invoice, amount, paymentId, provider, onClose, onPaymentCompleted }: LightningPaymentProps) {
const { t } = useTranslation(); const { t } = useTranslation();
const { user } = useCurrentUser();
const { config } = useAppContext();
const queryClient = useQueryClient();
const [qrDataUrl, setQrDataUrl] = useState<string>(''); const [qrDataUrl, setQrDataUrl] = useState<string>('');
const [isWebLNAvailable, setIsWebLNAvailable] = useState(false); const [isWebLNAvailable, setIsWebLNAvailable] = useState(false);
const [isPayingWithWebLN, setIsPayingWithWebLN] = useState(false); const [isPayingWithWebLN, setIsPayingWithWebLN] = useState(false);
const [showCopiedTooltip, setShowCopiedTooltip] = useState(false); const [showCopiedTooltip, setShowCopiedTooltip] = useState(false);
const [paymentCompleted, setPaymentCompleted] = useState(false);
const { toast } = useToast(); const { toast } = useToast();
const formatCurrency = useCallback((amount: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(amount);
}, []);
useEffect(() => { useEffect(() => {
// Generate QR code // Generate QR code
QRCode.toDataURL(invoice, { QRCode.toDataURL(invoice, {
@@ -113,6 +129,98 @@ function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) {
setIsWebLNAvailable(typeof window !== 'undefined' && 'webln' in window); setIsWebLNAvailable(typeof window !== 'undefined' && 'webln' in window);
}, [invoice]); }, [invoice]);
// Poll payment status
useEffect(() => {
// Don't poll if payment already completed
if (paymentCompleted) return;
let intervalId: NodeJS.Timeout | null = null;
const pollPaymentStatus = async () => {
// Double-check in case state updated during async operation
if (paymentCompleted) return;
try {
const ai = createAIClient(provider, user, config.corsProxy);
const payment = await ai.get(`/credits/payments/${paymentId}`) as Payment;
if (payment.status === 'completed') {
// Mark as completed to prevent further polling
setPaymentCompleted(true);
// Clear the interval immediately
if (intervalId) {
clearInterval(intervalId);
intervalId = null;
}
// Update credits balance
queryClient.invalidateQueries({
queryKey: ['ai-credits', provider.nostr ? user?.pubkey ?? '' : '', provider.id],
});
// Update payments list
queryClient.invalidateQueries({
queryKey: ['ai-payments', provider.nostr ? user?.pubkey ?? '' : '', provider.id],
});
// Show toast
toast({
title: t('paymentCompleted'),
description: t('creditsAddedToAccount', { amount: formatCurrency(payment.amount) }),
});
// Close dialog immediately
onPaymentCompleted();
} else if (payment.status === 'failed') {
// Mark as completed to prevent further polling
setPaymentCompleted(true);
// Clear the interval immediately
if (intervalId) {
clearInterval(intervalId);
intervalId = null;
}
toast({
title: t('paymentFailed'),
description: t('paymentFailed'),
variant: 'destructive',
});
} else if (payment.status === 'expired') {
// Mark as completed to prevent further polling
setPaymentCompleted(true);
// Clear the interval immediately
if (intervalId) {
clearInterval(intervalId);
intervalId = null;
}
toast({
title: t('paymentExpired'),
description: t('paymentExpiredMessage'),
variant: 'destructive',
});
}
} catch (error) {
console.error('Failed to poll payment status:', error);
}
};
// Poll immediately on mount
pollPaymentStatus();
// Then poll every 3 seconds
intervalId = setInterval(pollPaymentStatus, 3000);
return () => {
if (intervalId) {
clearInterval(intervalId);
}
};
}, [paymentId, provider, user, config.corsProxy, queryClient, toast, t, onPaymentCompleted, formatCurrency, paymentCompleted]);
const handleWebLNPay = async () => { const handleWebLNPay = async () => {
if (!window.webln) return; if (!window.webln) return;
@@ -145,15 +253,6 @@ function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) {
setTimeout(() => setShowCopiedTooltip(false), 2000); setTimeout(() => setShowCopiedTooltip(false), 2000);
}; };
const formatCurrency = (amount: number) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(amount);
};
return ( return (
<div className="space-y-4"> <div className="space-y-4">
<div className="text-center"> <div className="text-center">
@@ -223,6 +322,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
const [amount, setAmount] = useState<number>(10); const [amount, setAmount] = useState<number>(10);
const [paymentMethod, setPaymentMethod] = useState<'stripe' | 'lightning'>('stripe'); const [paymentMethod, setPaymentMethod] = useState<'stripe' | 'lightning'>('stripe');
const [lightningInvoice, setLightningInvoice] = useState<string | null>(null); const [lightningInvoice, setLightningInvoice] = useState<string | null>(null);
const [lightningPaymentId, setLightningPaymentId] = useState<string | null>(null);
const [refreshingPayments, setRefreshingPayments] = useState<Set<string>>(new Set()); const [refreshingPayments, setRefreshingPayments] = useState<Set<string>>(new Set());
const [giftcardAmount, setGiftcardAmount] = useState<number>(10); const [giftcardAmount, setGiftcardAmount] = useState<number>(10);
const [giftcardQuantity, setGiftcardQuantity] = useState<number>(1); const [giftcardQuantity, setGiftcardQuantity] = useState<number>(1);
@@ -301,6 +401,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
} else if (payment.method === 'lightning') { } else if (payment.method === 'lightning') {
// Show Lightning payment interface // Show Lightning payment interface
setLightningInvoice(payment.url); setLightningInvoice(payment.url);
setLightningPaymentId(payment.id);
} }
// Refresh payments list // Refresh payments list
@@ -486,6 +587,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
} else if (paymentPreview.method === 'lightning') { } else if (paymentPreview.method === 'lightning') {
// Show Lightning payment interface // Show Lightning payment interface
setLightningInvoice(paymentPreview.url); setLightningInvoice(paymentPreview.url);
setLightningPaymentId(paymentPreview.id);
} }
// Refresh payments list // Refresh payments list
@@ -882,12 +984,22 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
</DialogHeader> </DialogHeader>
{/* Lightning Payment Interface */} {/* Lightning Payment Interface */}
{lightningInvoice ? ( {lightningInvoice && lightningPaymentId ? (
<div className="flex-1 overflow-y-auto px-1 -mx-1"> <div className="flex-1 overflow-y-auto px-1 -mx-1">
<LightningPayment <LightningPayment
invoice={lightningInvoice} invoice={lightningInvoice}
amount={amount} amount={amount}
onClose={() => setLightningInvoice(null)} paymentId={lightningPaymentId}
provider={provider}
onClose={() => {
setLightningInvoice(null);
setLightningPaymentId(null);
}}
onPaymentCompleted={() => {
// Close the lightning payment view immediately
setLightningInvoice(null);
setLightningPaymentId(null);
}}
/> />
</div> </div>
) : ( ) : (
@@ -1054,6 +1166,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
onClick={() => { onClick={() => {
if (payment.method === 'lightning') { if (payment.method === 'lightning') {
setLightningInvoice(payment.url); setLightningInvoice(payment.url);
setLightningPaymentId(payment.id);
} else { } else {
window.open(payment.url, '_blank'); window.open(payment.url, '_blank');
} }
@@ -1172,7 +1285,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
</AccordionItem> </AccordionItem>
{/* Your Gift Cards Accordion */} {/* Your Gift Cards Accordion */}
<AccordionItem value="list" className="border-b-0"> <AccordionItem value="list">
<AccordionTrigger className="hover:no-underline"> <AccordionTrigger className="hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<CreditCard className="h-4 w-4" /> <CreditCard className="h-4 w-4" />
-2
View File
@@ -182,7 +182,6 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
await git.checkout({ await git.checkout({
dir: projectPath, dir: projectPath,
ref: branchName, ref: branchName,
force: true,
}); });
toast({ toast({
@@ -1289,7 +1288,6 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
await git.checkout({ await git.checkout({
dir: projectPath, dir: projectPath,
ref: pr.sourceBranch, ref: pr.sourceBranch,
force: true,
}); });
await refetchGitStatus(); await refetchGitStatus();
toast({ toast({
+1 -1
View File
@@ -269,7 +269,7 @@ export function MCPServersSection() {
{/* Add New MCP Server */} {/* Add New MCP Server */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="add-server" className="border rounded-lg"> <AccordionItem value="add-server">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Plus className="h-4 w-4" /> <Plus className="h-4 w-4" />
+67
View File
@@ -0,0 +1,67 @@
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
import {
Alert,
AlertDescription,
AlertTitle,
} from '@/components/ui/alert';
import { Button } from '@/components/ui/button';
interface NostrPermissionDialogProps {
open: boolean;
onResponse: (granted: boolean) => void;
}
export function NostrPermissionDialog({ open, onResponse }: NostrPermissionDialogProps) {
return (
<Dialog open={open} onOpenChange={(isOpen) => {
if (!isOpen) {
onResponse(false);
}
}}>
<DialogContent>
<DialogHeader>
<DialogTitle>Allow Nostr Access?</DialogTitle>
<DialogDescription className="space-y-3">
<p>
This project is requesting access to your Nostr signer (window.nostr).
</p>
<Alert variant="destructive">
<AlertTitle>Warning</AlertTitle>
<AlertDescription>
Granting access will allow this app to take actions on your behalf, including:
<ul className="list-disc list-inside mt-2 space-y-1">
<li>Read your public key</li>
<li>Sign events (publish posts, reactions, etc.)</li>
<li>Encrypt and decrypt messages</li>
</ul>
</AlertDescription>
</Alert>
<p className="text-sm text-muted-foreground">
Only grant access if you trust this application.
</p>
</DialogDescription>
</DialogHeader>
<DialogFooter className="gap-2">
<Button
variant="outline"
onClick={() => onResponse(false)}
>
Deny
</Button>
<Button
onClick={() => onResponse(true)}
>
Allow
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}
@@ -0,0 +1,65 @@
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
interface NostrSignerRequiredDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
}
export function NostrSignerRequiredDialog({ open, onOpenChange }: NostrSignerRequiredDialogProps) {
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent>
<DialogHeader>
<DialogTitle>Nostr Signer Required</DialogTitle>
<DialogDescription className="space-y-3">
<p>
This page tried to use a NIP-07 signer, but you don't have one installed!
</p>
<p>
Please install a Nostr signer extension to continue:
</p>
<div className="space-y-2 mt-4">
<a
href="https://github.com/soapbox-pub/soapbox-signer"
target="_blank"
rel="noopener noreferrer"
className="block text-primary hover:underline"
>
• Soapbox Signer
</a>
<a
href="https://getalby.com/"
target="_blank"
rel="noopener noreferrer"
className="block text-primary hover:underline"
>
• Alby
</a>
<a
href="https://github.com/fiatjaf/nos2x"
target="_blank"
rel="noopener noreferrer"
className="block text-primary hover:underline"
>
• nos2x
</a>
</div>
</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button variant="outline" onClick={() => onOpenChange(false)}>
Close
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}
+27 -11
View File
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useRegisterSW } from 'virtual:pwa-register/react'; import { useRegisterSW } from 'virtual:pwa-register/react';
import { Sparkles } from 'lucide-react'; import { Sparkles, X } from 'lucide-react';
/** /**
* Component that prompts users to update when a new service worker is available * Component that prompts users to update when a new service worker is available
@@ -52,22 +52,38 @@ export function PWAUpdatePrompt() {
updateServiceWorker(true); updateServiceWorker(true);
}; };
const handleDismiss = (e: React.MouseEvent) => {
e.stopPropagation();
setShowPrompt(false);
};
if (!showPrompt) { if (!showPrompt) {
return null; return null;
} }
return ( return (
<div className="fixed bottom-4 left-1/2 -translate-x-1/2 md:top-4 md:right-4 md:bottom-auto md:left-auto md:translate-x-0 z-50 animate-in slide-in-from-bottom-4 md:slide-in-from-top-4 duration-500 max-w-full"> <div className="fixed bottom-4 left-1/2 -translate-x-1/2 md:top-4 md:right-4 md:bottom-auto md:left-auto md:translate-x-0 z-50 animate-in slide-in-from-bottom-4 md:slide-in-from-top-4 duration-500 max-w-full">
<button <div className="relative group">
onClick={handleUpdate} <button
disabled={isUpdating} onClick={handleUpdate}
className="group relative flex items-center gap-2 px-4 py-2.5 bg-gradient-to-r from-amber-100 to-yellow-100 dark:from-amber-900 dark:to-yellow-900 border border-amber-300 dark:border-amber-700 rounded-full shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105 active:scale-95 disabled:cursor-not-allowed disabled:hover:scale-100 max-w-full truncate" disabled={isUpdating}
> className={`relative flex items-center gap-2 px-4 py-2.5 ${!isUpdating ? 'pr-10' : ''} bg-gradient-to-r from-amber-100 to-yellow-100 dark:from-amber-900 dark:to-yellow-900 border border-amber-300 dark:border-amber-700 rounded-full shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105 active:scale-95 disabled:cursor-not-allowed disabled:hover:scale-100 max-w-full truncate`}
<Sparkles className={`h-4 w-4 text-amber-600 dark:text-amber-400 ${isUpdating ? 'animate-spin' : 'group-hover:rotate-12 transition-transform duration-300'}`} /> >
<span className="text-sm font-medium whitespace-nowrap max-w-full truncate text-amber-900 dark:text-amber-100"> <Sparkles className={`h-4 w-4 text-amber-600 dark:text-amber-400 ${isUpdating ? 'animate-spin' : 'group-hover:rotate-12 transition-transform duration-300'}`} />
{isUpdating ? 'Updating...' : 'Update available — Click to refresh'} <span className="text-sm font-medium whitespace-nowrap max-w-full truncate text-amber-900 dark:text-amber-100">
</span> {isUpdating ? 'Updating...' : 'Update available — Click to refresh'}
</button> </span>
</button>
{!isUpdating && (
<button
onClick={handleDismiss}
className="absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-full hover:bg-amber-200 dark:hover:bg-amber-800 transition-colors duration-200"
aria-label="Dismiss update notification"
>
<X className="h-4 w-4 text-amber-700 dark:text-amber-300" />
</button>
)}
</div>
</div> </div>
); );
} }
+1 -1
View File
@@ -122,7 +122,7 @@ export function PluginsSection() {
{/* Add Plugin Section */} {/* Add Plugin Section */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="add-plugin" className="border rounded-lg"> <AccordionItem value="add-plugin">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Plus className="h-4 w-4" /> <Plus className="h-4 w-4" />
+41 -6
View File
@@ -1,9 +1,10 @@
import React, { useEffect } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Plus, Folder, GitBranch, Loader2, ChevronDown, Star, Columns2, X, Settings, HelpCircle } from 'lucide-react'; import { Plus, Folder, GitBranch, Loader2, ChevronDown, Star, Columns2, X, Settings, HelpCircle, Search } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton'; import { Skeleton } from '@/components/ui/skeleton';
import { Input } from '@/components/ui/input';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import { useProjects } from '@/hooks/useProjects'; import { useProjects } from '@/hooks/useProjects';
import { useProjectSessionStatus } from '@/hooks/useProjectSessionStatus'; import { useProjectSessionStatus } from '@/hooks/useProjectSessionStatus';
@@ -93,10 +94,24 @@ export function ProjectSidebar({
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const { data: projects = [], isLoading, error } = useProjects(); const { data: projects = [], isLoading, error } = useProjects();
const [favorites] = useLocalStorage<string[]>('project-favorites', []); const [favorites] = useLocalStorage<string[]>('project-favorites', []);
const [searchQuery, setSearchQuery] = useState('');
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const navigate = useNavigate(); const navigate = useNavigate();
// Fast in-memory search filtering
const filteredProjects = useMemo(() => {
if (!searchQuery.trim()) {
return projects;
}
const query = searchQuery.toLowerCase();
return projects.filter(project =>
project.id.toLowerCase().includes(query) ||
project.name.toLowerCase().includes(query)
);
}, [projects, searchQuery]);
// Custom navigate function that closes sidebar on mobile // Custom navigate function that closes sidebar on mobile
const navigateAndClose = (path: string) => { const navigateAndClose = (path: string) => {
navigate(path); navigate(path);
@@ -166,12 +181,12 @@ export function ProjectSidebar({
<div className="flex-1 overflow-y-auto"> <div className="flex-1 overflow-y-auto">
<div className="p-2"> <div className="p-2">
<div className="mb-2"> <div className="mb-2 space-y-3">
<div className="relative rounded-md bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90 transition-all duration-200"> <div className="relative rounded-md bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90 transition-all duration-200">
<div className="flex"> <div className="flex">
<button <button
onClick={handleNewProject} onClick={handleNewProject}
className="flex-1 flex items-center justify-center px-3 py-2 text-sm font-medium text-primary-foreground rounded-l-md hover:bg-white/10 transition-colors" className="flex-1 flex items-center justify-center px-3 py-2.5 text-sm font-medium text-primary-foreground rounded-l-md hover:bg-white/10 transition-colors"
> >
<Plus className="h-4 w-4 mr-2" /> <Plus className="h-4 w-4 mr-2" />
{t('newProject')} {t('newProject')}
@@ -179,7 +194,7 @@ export function ProjectSidebar({
<div className="w-px bg-white/20" /> <div className="w-px bg-white/20" />
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<button className="px-2 py-2 text-primary-foreground hover:bg-white/10 rounded-r-md transition-colors"> <button className="px-3 py-2.5 text-primary-foreground hover:bg-white/10 rounded-r-md transition-colors">
<ChevronDown className="h-4 w-4" /> <ChevronDown className="h-4 w-4" />
</button> </button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
@@ -195,6 +210,20 @@ export function ProjectSidebar({
</DropdownMenu> </DropdownMenu>
</div> </div>
</div> </div>
{/* Search Input */}
{projects.length > 0 && (
<div className="relative">
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" />
<Input
type="text"
placeholder={t('searchProjects')}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="pl-9 h-9 text-sm bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-primary/50"
/>
</div>
)}
</div> </div>
{isLoading ? ( {isLoading ? (
@@ -214,9 +243,15 @@ export function ProjectSidebar({
<p className="text-sm">{t('noProjectsYet')}</p> <p className="text-sm">{t('noProjectsYet')}</p>
<p className="text-xs">{t('createFirstProject')}</p> <p className="text-xs">{t('createFirstProject')}</p>
</div> </div>
) : filteredProjects.length === 0 ? (
<div className="text-center p-6 text-muted-foreground">
<Search className="h-8 w-8 mx-auto mb-2 opacity-50" />
<p className="text-sm">{t('noProjectsFound')}</p>
<p className="text-xs">{t('tryDifferentSearch')}</p>
</div>
) : ( ) : (
<div className="space-y-1"> <div className="space-y-1">
{projects.map((project) => ( {filteredProjects.map((project) => (
<ProjectItem <ProjectItem
key={project.id} key={project.id}
project={project} project={project}
+7 -1
View File
@@ -197,7 +197,13 @@ function QuillyContent({ error, onDismiss, onNewChat, onOpenModelSelector, onTry
message: error.message message: error.message
? `AI service error: ${error.message}` ? `AI service error: ${error.message}`
: 'Sorry, I encountered an unexpected error. Please try again.', : 'Sorry, I encountered an unexpected error. Please try again.',
actions: [], actions: onTryAgain ? [{
label: 'Try again',
onClick: () => {
onTryAgain();
onDismiss();
},
}] : [],
}; };
}; };
+99
View File
@@ -0,0 +1,99 @@
import React from 'react';
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { GitBranch } from 'lucide-react';
import type { Repository } from '@/hooks/useUserRepositories';
import { useAuthor } from '@/hooks/useAuthor';
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
import { genUserName } from '@/lib/genUserName';
import { useNavigate } from 'react-router-dom';
import { nip19 } from 'nostr-tools';
interface RepositoryCardProps {
repo: Repository;
}
export function RepositoryCard({ repo }: RepositoryCardProps) {
const { data: authorData } = useAuthor(repo.pubkey);
const navigate = useNavigate();
const displayName = authorData?.metadata?.name || genUserName(repo.pubkey);
const profileImage = authorData?.metadata?.picture;
// Construct Nostr clone URL
const nostrCloneUrl = `nostr://${nip19.npubEncode(repo.pubkey)}/${repo.repoId}`;
const handleClone = () => {
// Navigate to clone page with Nostr URL parameter
navigate(`/clone?url=${encodeURIComponent(nostrCloneUrl)}`);
};
return (
<Card className="h-full flex flex-col hover:shadow-lg transition-shadow cursor-pointer" onClick={handleClone}>
<CardContent className="p-6 flex flex-col flex-1">
{/* Header with name and author */}
<div className="mb-4">
<h3 className="font-semibold text-lg leading-tight mb-2 truncate">
{repo.name}
</h3>
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<Avatar className="h-4 w-4">
{profileImage && (
<AvatarImage src={profileImage} alt={displayName} />
)}
<AvatarFallback className="text-[8px]">
{displayName.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span className="truncate">{displayName}</span>
</div>
</div>
{/* Description */}
{repo.description && (
<p className="text-sm text-muted-foreground line-clamp-2 mb-4">
{repo.description}
</p>
)}
{/* Tags */}
{repo.repoTags.length > 0 && (
<div className="flex flex-wrap gap-1 mb-4">
{repo.repoTags.slice(0, 3).map((tag, index) => (
<Badge key={index} variant="secondary" className="text-xs">
{tag}
</Badge>
))}
{repo.repoTags.length > 3 && (
<Badge variant="secondary" className="text-xs">
+{repo.repoTags.length - 3}
</Badge>
)}
</div>
)}
{/* Personal fork badge */}
{repo.isPersonalFork && (
<div className="mb-4">
<Badge variant="outline" className="text-xs">
Personal Fork
</Badge>
</div>
)}
{/* Actions */}
<div className="mt-auto">
<Button
size="sm"
className="w-full"
onClick={handleClone}
>
<GitBranch className="h-4 w-4 mr-2" />
Clone
</Button>
</div>
</CardContent>
</Card>
);
}
+57
View File
@@ -0,0 +1,57 @@
import { ChevronRight } from 'lucide-react';
import { cn } from '@/lib/utils';
interface SettingsItemProps {
icon: React.ComponentType<{ className?: string }>;
title: string;
onClick: () => void;
isActive?: boolean;
className?: string;
}
export function SettingsItem({
icon: Icon,
title,
onClick,
isActive = false,
className,
}: SettingsItemProps) {
return (
<button
onClick={onClick}
className={cn(
'group w-full text-left p-2 rounded-lg transition-all duration-200 border',
{
'bg-primary/10 border-primary/20 shadow-sm': isActive,
'border-transparent hover:bg-muted/60 hover:shadow-sm': !isActive,
},
className
)}
>
<div className="flex items-center gap-2.5">
<div className="rounded-md transition-all duration-200">
<Icon className={cn('h-4 w-4 flex-shrink-0 transition-colors duration-200', {
'text-primary': isActive,
'text-muted-foreground group-hover:text-foreground': !isActive,
})} />
</div>
<div className="flex-1 min-w-0">
<div className={cn('text-sm font-medium transition-colors duration-200', {
'text-primary': isActive,
'text-foreground': !isActive,
})}>
{title}
</div>
</div>
<ChevronRight className={cn(
'h-4 w-4 flex-shrink-0 transition-all duration-200',
'opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0',
{
'text-primary opacity-60': isActive,
'text-muted-foreground': !isActive,
}
)} />
</div>
</button>
);
}
+43
View File
@@ -0,0 +1,43 @@
import { ChevronRight } from 'lucide-react';
import { cn } from '@/lib/utils';
interface SettingsItemMobileProps {
icon: React.ComponentType<{ className?: string }>;
title: string;
onClick: () => void;
isFirst?: boolean;
isLast?: boolean;
}
export function SettingsItemMobile({
icon: Icon,
title,
onClick,
isFirst = false,
isLast = false,
}: SettingsItemMobileProps) {
return (
<button
onClick={onClick}
className={cn(
'w-full text-left px-4 py-3.5 bg-background transition-colors active:bg-muted/50',
'flex items-center gap-3',
'border-b border-border last:border-b-0',
{
'rounded-t-xl': isFirst,
'rounded-b-xl': isLast,
}
)}
>
<div className="flex items-center justify-center w-7 h-7 rounded-lg bg-primary/10">
<Icon className="h-4 w-4 text-primary flex-shrink-0" />
</div>
<div className="flex-1 min-w-0">
<div className="text-base text-foreground">
{title}
</div>
</div>
<ChevronRight className="h-5 w-5 text-muted-foreground/50 flex-shrink-0" />
</button>
);
}
+31 -36
View File
@@ -8,8 +8,8 @@ import { ProjectSidebar } from '@/components/ProjectSidebar';
import { useProjectsManager } from '@/hooks/useProjectsManager'; import { useProjectsManager } from '@/hooks/useProjectsManager';
import { useIsMobile } from '@/hooks/useIsMobile'; import { useIsMobile } from '@/hooks/useIsMobile';
import { type Project } from '@/lib/ProjectsManager'; import { type Project } from '@/lib/ProjectsManager';
import { cn } from '@/lib/utils'; import { getSettingsCategories } from '@/lib/settingsItems';
import { getSettingsItems } from '@/lib/settingsItems'; import { SettingsItem } from '@/components/SettingsItem';
export function SettingsLayout() { export function SettingsLayout() {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -60,9 +60,11 @@ export function SettingsLayout() {
}; };
// Get current settings page // Get current settings page
const settingsItems = getSettingsItems(t); const settingsCategories = getSettingsCategories(t);
const currentPath = location.pathname; const currentPath = location.pathname;
const currentSettingsId = settingsItems.find(item => item.href === currentPath)?.id; const currentSettingsId = settingsCategories
.flatMap(category => category.items)
.find(item => item.href === currentPath)?.id;
if (isMobile) { if (isMobile) {
return ( return (
@@ -89,7 +91,7 @@ export function SettingsLayout() {
className="absolute inset-0" className="absolute inset-0"
onClick={() => setIsSidebarVisible(false)} onClick={() => setIsSidebarVisible(false)}
/> />
<div className="relative left-0 top-0 h-full w-80 max-w-[80vw] bg-background border-r shadow-lg z-10"> <div className="relative left-0 top-0 h-full w-72 max-w-[80vw] bg-background border-r shadow-lg z-10">
<ProjectSidebar <ProjectSidebar
selectedProject={null} selectedProject={null}
onSelectProject={(project) => { onSelectProject={(project) => {
@@ -112,7 +114,7 @@ export function SettingsLayout() {
<div className="h-screen flex bg-background overflow-hidden"> <div className="h-screen flex bg-background overflow-hidden">
{/* Left Column - Projects Sidebar (optionally hidden) */} {/* Left Column - Projects Sidebar (optionally hidden) */}
{isSidebarVisible && ( {isSidebarVisible && (
<div className="w-80 border-r bg-sidebar flex-shrink-0"> <div className="w-72 border-r bg-sidebar flex-shrink-0">
<ProjectSidebar <ProjectSidebar
selectedProject={null} selectedProject={null}
onSelectProject={handleProjectSelect} onSelectProject={handleProjectSelect}
@@ -123,7 +125,7 @@ export function SettingsLayout() {
)} )}
{/* Middle Column - Settings Navigation */} {/* Middle Column - Settings Navigation */}
<div className="w-96 border-r bg-background flex flex-col flex-shrink-0"> <div className="w-72 border-r bg-background flex flex-col flex-shrink-0">
{/* Header with toggle button */} {/* Header with toggle button */}
<div className="h-12 px-4 py-2 border-b flex-shrink-0"> <div className="h-12 px-4 py-2 border-b flex-shrink-0">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
@@ -146,36 +148,29 @@ export function SettingsLayout() {
{/* Settings Navigation - Scrollable */} {/* Settings Navigation - Scrollable */}
<ScrollArea className="flex-1"> <ScrollArea className="flex-1">
<div className="p-4"> <div className="p-4 space-y-6">
<div className="space-y-2"> {settingsCategories.map((category) => (
{settingsItems.map((item) => { <div key={category.id}>
const Icon = item.icon; <h3 className="text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 px-2">
const isActive = currentSettingsId === item.id; {category.title}
</h3>
<div className="space-y-1">
{category.items.map((item) => {
const isActive = currentSettingsId === item.id;
return ( return (
<button <SettingsItem
key={item.id} key={item.id}
onClick={() => navigate(item.href)} icon={item.icon}
className={cn('w-full text-left p-3 rounded-lg transition-colors border border-transparent', { title={item.title}
'bg-primary/10 border border-primary/20': isActive, onClick={() => navigate(item.href)}
'hover:bg-muted/50': !isActive, isActive={isActive}
})} />
> );
<div className="flex items-start gap-3"> })}
<Icon className={`h-5 w-5 mt-0.5 ${isActive ? 'text-primary' : 'text-muted-foreground'}`} /> </div>
<div className="flex-1 min-w-0"> </div>
<div className={`font-medium ${isActive ? 'text-primary' : 'text-foreground'}`}> ))}
{item.title}
</div>
<div className="text-sm text-muted-foreground mt-0.5">
{item.description}
</div>
</div>
</div>
</button>
);
})}
</div>
</div> </div>
</ScrollArea> </ScrollArea>
</div> </div>
+179 -2
View File
@@ -7,6 +7,7 @@ import { useFSPaths } from '@/hooks/useFSPaths';
import { addConsoleMessage, getConsoleMessages, type ConsoleMessage } from '@/lib/consoleMessages'; import { addConsoleMessage, getConsoleMessages, type ConsoleMessage } from '@/lib/consoleMessages';
import { useConsoleError } from '@/hooks/useConsoleError'; import { useConsoleError } from '@/hooks/useConsoleError';
import { useBuildProject } from '@/hooks/useBuildProject'; import { useBuildProject } from '@/hooks/useBuildProject';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { Tabs, TabsContent } from '@/components/ui/tabs'; import { Tabs, TabsContent } from '@/components/ui/tabs';
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
@@ -25,6 +26,8 @@ import {
PopoverContent, PopoverContent,
PopoverTrigger, PopoverTrigger,
} from '@/components/ui/popover'; } from '@/components/ui/popover';
import { NostrPermissionDialog } from '@/components/NostrPermissionDialog';
import { NostrSignerRequiredDialog } from '@/components/NostrSignerRequiredDialog';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { FileTree } from './FileTree'; import { FileTree } from './FileTree';
import { FileEditor } from './FileEditor'; import { FileEditor } from './FileEditor';
@@ -57,6 +60,16 @@ interface JSONRPCRequest {
id: number; id: number;
} }
interface NostrRPCRequest {
jsonrpc: '2.0';
method: 'nostr';
params: {
method: string;
args: unknown[];
};
id: number;
}
interface JSONRPCResponse { interface JSONRPCResponse {
jsonrpc: '2.0'; jsonrpc: '2.0';
result?: { result?: {
@@ -93,6 +106,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
const { fs } = useFS(); const { fs } = useFS();
const { projectsPath } = useFSPaths(); const { projectsPath } = useFSPaths();
const projectsManager = useProjectsManager(); const projectsManager = useProjectsManager();
const { user } = useCurrentUser();
// Use console error state from provider // Use console error state from provider
const { hasErrors: hasConsoleErrors, clearErrors } = useConsoleError(); const { hasErrors: hasConsoleErrors, clearErrors } = useConsoleError();
@@ -319,6 +333,155 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
} }
}, [historyIndex, navigationHistory, sendNavigationCommand]); }, [historyIndex, navigationHistory, sendNavigationCommand]);
// Track which projects have been granted Nostr access
const [nostrPermissions, setNostrPermissions] = useState<Set<string>>(new Set());
const [nostrPermissionDialog, setNostrPermissionDialog] = useState<{
open: boolean;
projectId: string;
resolve: (granted: boolean) => void;
} | null>(null);
const [noSignerDialog, setNoSignerDialog] = useState(false);
const requestNostrPermission = useCallback(async (projectId: string): Promise<boolean> => {
// Check if permission already granted
if (nostrPermissions.has(projectId)) {
return true;
}
// Show permission dialog and wait for user response
return new Promise<boolean>((resolve) => {
setNostrPermissionDialog({
open: true,
projectId,
resolve,
});
});
}, [nostrPermissions]);
const handleNostrPermissionResponse = useCallback((granted: boolean) => {
if (nostrPermissionDialog) {
const { projectId, resolve } = nostrPermissionDialog;
if (granted) {
// Grant permission for this project
setNostrPermissions(prev => new Set([...prev, projectId]));
}
// Close dialog and resolve the promise
setNostrPermissionDialog(null);
resolve(granted);
}
}, [nostrPermissionDialog]);
const handleNostr = useCallback(async (request: NostrRPCRequest) => {
const { params, id } = request;
const { method, args } = params;
console.log('[NOSTR BRIDGE] Handling request:', method, args);
try {
// Check if user is logged in with a signer
if (!user?.signer) {
// Show the "no signer" dialog
setNoSignerDialog(true);
throw new Error('NO_SIGNER_INSTALLED');
}
// Request permission if this is the first Nostr access from this project
const hasPermission = await requestNostrPermission(projectId);
if (!hasPermission) {
throw new Error('User denied Nostr access');
}
let result: unknown;
// Route to appropriate signer method
switch (method) {
case 'getPublicKey':
result = await user.signer.getPublicKey();
break;
case 'signEvent':
if (!args[0] || typeof args[0] !== 'object') {
throw new Error('Invalid event object');
}
result = await user.signer.signEvent(args[0] as Parameters<typeof user.signer.signEvent>[0]);
break;
case 'nip04.encrypt':
if (!user.signer.nip04?.encrypt) {
throw new Error('NIP-04 encryption not supported by signer');
}
if (typeof args[0] !== 'string' || typeof args[1] !== 'string') {
throw new Error('Invalid arguments for nip04.encrypt');
}
result = await user.signer.nip04.encrypt(args[0], args[1]);
break;
case 'nip04.decrypt':
if (!user.signer.nip04?.decrypt) {
throw new Error('NIP-04 decryption not supported by signer');
}
if (typeof args[0] !== 'string' || typeof args[1] !== 'string') {
throw new Error('Invalid arguments for nip04.decrypt');
}
result = await user.signer.nip04.decrypt(args[0], args[1]);
break;
case 'nip44.encrypt':
if (!user.signer.nip44?.encrypt) {
throw new Error('NIP-44 encryption not supported by signer');
}
if (typeof args[0] !== 'string' || typeof args[1] !== 'string') {
throw new Error('Invalid arguments for nip44.encrypt');
}
result = await user.signer.nip44.encrypt(args[0], args[1]);
break;
case 'nip44.decrypt':
if (!user.signer.nip44?.decrypt) {
throw new Error('NIP-44 decryption not supported by signer');
}
if (typeof args[0] !== 'string' || typeof args[1] !== 'string') {
throw new Error('Invalid arguments for nip44.decrypt');
}
result = await user.signer.nip44.decrypt(args[0], args[1]);
break;
default:
throw new Error(`Unsupported Nostr method: ${method}`);
}
console.log('[NOSTR BRIDGE] Success:', method, result);
// Send success response
if (iframeRef.current?.contentWindow) {
const targetOrigin = `https://${projectId}.${previewDomain}`;
iframeRef.current.contentWindow.postMessage({
jsonrpc: '2.0',
result,
id
}, targetOrigin);
}
} catch (error) {
console.error('[NOSTR BRIDGE] Error:', method, error);
// Send error response
if (iframeRef.current?.contentWindow) {
const targetOrigin = `https://${projectId}.${previewDomain}`;
iframeRef.current.contentWindow.postMessage({
jsonrpc: '2.0',
error: {
code: -32000,
message: error instanceof Error ? error.message : String(error),
},
id
}, targetOrigin);
}
}
}, [user, projectId, previewDomain, requestNostrPermission]);
const handleFetch = useCallback(async (request: JSONRPCRequest) => { const handleFetch = useCallback(async (request: JSONRPCRequest) => {
const { params, id } = request; const { params, id } = request;
const { request: fetchRequest } = params; const { request: fetchRequest } = params;
@@ -441,7 +604,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
// Verify origin for security // Verify origin for security
const expectedOrigin = `https://${projectId}.${previewDomain}`; const expectedOrigin = `https://${projectId}.${previewDomain}`;
if (event.origin !== expectedOrigin) { if (event.origin !== expectedOrigin) {
console.log(`Ignoring message from unexpected origin: ${event.origin}, expected: ${expectedOrigin}`); console.log(`Ignoring message with source ${event.data.source} from unexpected origin: ${event.origin}, expected: ${expectedOrigin}`);
return; return;
} }
@@ -449,6 +612,8 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
console.log('Received message from iframe:', message); console.log('Received message from iframe:', message);
if (message.jsonrpc === '2.0' && message.method === 'fetch') { if (message.jsonrpc === '2.0' && message.method === 'fetch') {
handleFetch(message); handleFetch(message);
} else if (message.jsonrpc === '2.0' && message.method === 'nostr') {
handleNostr(message);
} else if (message.jsonrpc === '2.0' && message.method === 'console') { } else if (message.jsonrpc === '2.0' && message.method === 'console') {
handleConsoleMessage(message); handleConsoleMessage(message);
} else if (message.jsonrpc === '2.0' && message.method === 'updateNavigationState') { } else if (message.jsonrpc === '2.0' && message.method === 'updateNavigationState') {
@@ -458,7 +623,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
window.addEventListener('message', handleMessage); window.addEventListener('message', handleMessage);
return () => window.removeEventListener('message', handleMessage); return () => window.removeEventListener('message', handleMessage);
}, [handleFetch, handleConsoleMessage, handleUpdateNavigationState, projectId, previewDomain]); }, [handleFetch, handleNostr, handleConsoleMessage, handleUpdateNavigationState, projectId, previewDomain]);
useEffect(() => { useEffect(() => {
if (selectedFile) { if (selectedFile) {
@@ -948,6 +1113,18 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
onOpenChange={setDeployDialogOpen} onOpenChange={setDeployDialogOpen}
/> />
)} )}
{/* Nostr Permission Dialog */}
<NostrPermissionDialog
open={nostrPermissionDialog?.open ?? false}
onResponse={handleNostrPermissionResponse}
/>
{/* No Signer Installed Dialog */}
<NostrSignerRequiredDialog
open={noSignerDialog}
onOpenChange={setNoSignerDialog}
/>
</div> </div>
); );
} }
-1
View File
@@ -223,7 +223,6 @@ export function BranchManager({ projectId, currentBranch, onBranchChange }: Bran
await git.checkout({ await git.checkout({
dir: projectPath, dir: projectPath,
ref: branchName, ref: branchName,
force: true,
}); });
toast({ toast({
+1 -1
View File
@@ -12,7 +12,7 @@ const AccordionItem = React.forwardRef<
>(({ className, ...props }, ref) => ( >(({ className, ...props }, ref) => (
<AccordionPrimitive.Item <AccordionPrimitive.Item
ref={ref} ref={ref}
className={cn("border-b", className)} className={cn("border rounded-lg bg-card text-card-foreground shadow-sm", className)}
{...props} {...props}
/> />
)) ))
+1 -1
View File
@@ -11,7 +11,7 @@ const Checkbox = React.forwardRef<
<CheckboxPrimitive.Root <CheckboxPrimitive.Root
ref={ref} ref={ref}
className={cn( className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", "peer h-4 w-4 shrink-0 rounded-xs border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className className
)} )}
{...props} {...props}
+1 -1
View File
@@ -17,7 +17,7 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger <SelectPrimitive.Trigger
ref={ref} ref={ref}
className={cn( className={cn(
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground hover:bg-border/20 dark:hover:bg-border/50 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
className className
)} )}
{...props} {...props}
+43
View File
@@ -0,0 +1,43 @@
import { useNostr } from '@nostrify/react';
import { useQuery } from '@tanstack/react-query';
/**
* Hook to get the user's contact list (kind 3 follow list)
* Returns an array of pubkeys that the user follows
*/
export function useContacts(userPubkey?: string) {
const { nostr } = useNostr();
return useQuery({
queryKey: ['nostr', 'contacts', userPubkey],
queryFn: async (): Promise<string[]> => {
if (!userPubkey) {
return [];
}
// Get the user's contact list (kind 3)
const events = await nostr.query([{
kinds: [3],
authors: [userPubkey],
limit: 1,
}], { signal: AbortSignal.timeout(3000) });
if (events.length === 0) {
return [];
}
// Get the most recent contact list event
const contactList = events.sort((a, b) => b.created_at - a.created_at)[0];
// Extract pubkeys from 'p' tags
const followedPubkeys = contactList.tags
.filter(tag => tag[0] === 'p' && tag[1])
.map(tag => tag[1]);
return followedPubkeys;
},
enabled: !!userPubkey,
staleTime: 60000, // 1 minute
refetchInterval: 300000, // 5 minutes
});
}
+92
View File
@@ -0,0 +1,92 @@
import { useNostr } from '@nostrify/react';
import { useQuery } from '@tanstack/react-query';
import type { NostrEvent } from '@nostrify/nostrify';
import type { Repository } from './useUserRepositories';
// Kind 30617 for repository announcements (NIP-34)
const REPOSITORY_KIND = 30617;
/**
* Hook to get repositories from a list of followed users
*/
export function useFollowedRepositories(followedPubkeys: string[] = []) {
const { nostr } = useNostr();
return useQuery({
queryKey: ['nostr', 'followed-repositories', followedPubkeys.sort().join(',')],
queryFn: async (): Promise<Repository[]> => {
if (followedPubkeys.length === 0) {
return [];
}
// Get all repository announcements from followed users
const events = await nostr.query([{
kinds: [REPOSITORY_KIND],
authors: followedPubkeys,
limit: 500, // Increased limit to get more repos from follows
}], { signal: AbortSignal.timeout(5000) });
// Process repository events
const repositories: Repository[] = [];
const repoMap = new Map<string, NostrEvent>();
// Group by author+d-tag to get latest version of each repo
for (const event of events) {
const dTag = event.tags.find(tag => tag[0] === 'd')?.[1];
if (!dTag) continue;
const key = `${event.pubkey}:${dTag}`;
const existing = repoMap.get(key);
if (!existing || event.created_at > existing.created_at) {
repoMap.set(key, event);
}
}
// Convert to Repository objects
for (const [, event] of repoMap) {
try {
const dTag = event.tags.find(tag => tag[0] === 'd')?.[1];
if (!dTag) continue;
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
const webUrls = event.tags.filter(tag => tag[0] === 'web').map(tag => tag[1]).filter(Boolean);
const cloneUrls = event.tags.filter(tag => tag[0] === 'clone').map(tag => tag[1]).filter(Boolean);
const relays = event.tags.filter(tag => tag[0] === 'relays').map(tag => tag[1]).filter(Boolean);
const maintainers = event.tags.filter(tag => tag[0] === 'maintainers').map(tag => tag[1]).filter(Boolean);
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
// Filter out invalid repositories without clone URLs
if (cloneUrls.length === 0) {
console.warn('Skipping repository without clone URLs:', dTag);
continue;
}
repositories.push({
...event,
repoId: dTag,
name,
description,
webUrls,
cloneUrls,
relays,
maintainers,
repoTags,
earliestUniqueCommit,
isPersonalFork,
});
} catch (error) {
console.warn('Failed to parse repository:', error);
}
}
// Sort by created_at (newest first)
return repositories.sort((a, b) => b.created_at - a.created_at);
},
enabled: followedPubkeys.length > 0,
staleTime: 30000, // 30 seconds
refetchInterval: 60000, // 1 minute
});
}
+96
View File
@@ -0,0 +1,96 @@
import { useNostr } from '@nostrify/react';
import { useQuery } from '@tanstack/react-query';
import type { NostrEvent } from '@nostrify/nostrify';
// Kind 30617 for repository announcements (NIP-34)
const REPOSITORY_KIND = 30617;
export interface Repository extends NostrEvent {
repoId: string;
name: string;
description: string;
webUrls: string[];
cloneUrls: string[];
relays: string[];
maintainers: string[];
repoTags: string[];
earliestUniqueCommit?: string;
isPersonalFork: boolean;
}
export function useUserRepositories(userPubkey?: string) {
const { nostr } = useNostr();
return useQuery({
queryKey: ['nostr', 'user-repositories', userPubkey],
queryFn: async (): Promise<Repository[]> => {
if (!userPubkey) {
return [];
}
// Get all repository announcements for this user
const events = await nostr.query([{
kinds: [REPOSITORY_KIND],
authors: [userPubkey],
limit: 100,
}], { signal: AbortSignal.timeout(3000) });
// Process repository events
const repositories: Repository[] = [];
const repoMap = new Map<string, NostrEvent>();
// Group by d-tag (repo-id) to get latest version
for (const event of events) {
const dTag = event.tags.find(tag => tag[0] === 'd')?.[1];
if (!dTag) continue;
const existing = repoMap.get(dTag);
if (!existing || event.created_at > existing.created_at) {
repoMap.set(dTag, event);
}
}
// Convert to Repository objects
for (const [dTag, event] of repoMap) {
try {
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
const webUrls = event.tags.filter(tag => tag[0] === 'web').map(tag => tag[1]).filter(Boolean);
const cloneUrls = event.tags.filter(tag => tag[0] === 'clone').map(tag => tag[1]).filter(Boolean);
const relays = event.tags.filter(tag => tag[0] === 'relays').map(tag => tag[1]).filter(Boolean);
const maintainers = event.tags.filter(tag => tag[0] === 'maintainers').map(tag => tag[1]).filter(Boolean);
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
// Filter out invalid repositories without clone URLs
if (cloneUrls.length === 0) {
console.warn('Skipping repository without clone URLs:', dTag);
continue;
}
repositories.push({
...event,
repoId: dTag,
name,
description,
webUrls,
cloneUrls,
relays,
maintainers,
repoTags,
earliestUniqueCommit,
isPersonalFork,
});
} catch (error) {
console.warn('Failed to parse repository:', error);
}
}
return repositories;
},
enabled: !!userPubkey,
staleTime: 30000, // 30 seconds
refetchInterval: 60000, // 1 minute
});
}
+1 -1
View File
@@ -37,7 +37,7 @@
--input: 220 13% 91%; --input: 220 13% 91%;
--ring: 271 81% 56%; --ring: 271 81% 56%;
--radius: 0.375rem; --radius: 0.75rem;
/* Sidebar colors - Enhanced purple theme */ /* Sidebar colors - Enhanced purple theme */
--sidebar-background: 271 81% 96%; --sidebar-background: 271 81% 96%;
-2
View File
@@ -122,7 +122,6 @@ export class GitCheckoutCommand implements GitSubcommand {
await this.git.checkout({ await this.git.checkout({
dir: cwd, dir: cwd,
ref: branchName, ref: branchName,
force: true,
}); });
return createSuccessResult(`Switched to branch '${branchName}'\n`); return createSuccessResult(`Switched to branch '${branchName}'\n`);
@@ -165,7 +164,6 @@ export class GitCheckoutCommand implements GitSubcommand {
await this.git.checkout({ await this.git.checkout({
dir: cwd, dir: cwd,
ref: branchName, ref: branchName,
force: true,
}); });
return createSuccessResult(`Switched to a new branch '${branchName}'\n`); return createSuccessResult(`Switched to a new branch '${branchName}'\n`);
-1
View File
@@ -1244,7 +1244,6 @@ export class Git {
fs: this.fs, fs: this.fs,
dir: options.dir, dir: options.dir,
ref: expectedBranch, ref: expectedBranch,
force: true,
}); });
} catch (checkoutError) { } catch (checkoutError) {
console.warn(`Failed to checkout branch ${expectedBranch}:`, checkoutError); console.warn(`Failed to checkout branch ${expectedBranch}:`, checkoutError);
+70 -55
View File
@@ -2,72 +2,87 @@ import { Bot, GitBranch, Database, Wifi, Settings2, Info, Settings, Rocket } fro
export interface SettingsItem { export interface SettingsItem {
id: string; id: string;
title: string;
description: string;
icon: React.ComponentType<{ className?: string }>; icon: React.ComponentType<{ className?: string }>;
title: string;
href: string; href: string;
} }
export interface SettingsCategory {
id: string;
title: string;
items: SettingsItem[];
}
/** /**
* Get the list of settings items with translations * Get the categorized list of settings items with translations
* @param t - Translation function from useTranslation hook * @param t - Translation function from useTranslation hook
* @returns Array of settings items * @returns Array of settings categories with translated items
*/ */
export const getSettingsItems = (t: (key: string) => string): SettingsItem[] => [ export const getSettingsCategories = (t: (key: string) => string): SettingsCategory[] => [
{ {
id: 'preferences', id: 'general',
title: t('preferences'), title: t('general'),
description: t('preferencesDescription'), items: [
icon: Settings2, {
href: '/settings/preferences', id: 'preferences',
icon: Settings2,
title: t('preferences'),
href: '/settings/preferences',
},
],
}, },
{ {
id: 'ai', id: 'integrations',
title: t('aiSettings'), title: t('integrations'),
description: t('aiSettingsDescription'), items: [
icon: Bot, {
href: '/settings/ai', id: 'ai',
icon: Bot,
title: t('aiSettings'),
href: '/settings/ai',
},
{
id: 'git',
icon: GitBranch,
title: t('gitSettings'),
href: '/settings/git',
},
{
id: 'nostr',
icon: Wifi,
title: t('nostrSettings'),
href: '/settings/nostr',
},
{
id: 'deploy',
icon: Rocket,
title: t('deploySettings'),
href: '/settings/deploy',
},
],
}, },
{ {
id: 'git', id: 'advanced',
title: t('gitSettings'), title: t('advanced'),
description: t('gitSettingsDescription'), items: [
icon: GitBranch, {
href: '/settings/git', id: 'storage',
}, icon: Database,
{ title: t('storageSettings'),
id: 'deploy', href: '/settings/storage',
title: t('deploySettings'), },
description: t('deploySettingsDescription'), {
icon: Rocket, id: 'system',
href: '/settings/deploy', icon: Settings,
}, title: t('systemSettings'),
{ href: '/settings/system',
id: 'nostr', },
title: t('nostrSettings'), {
description: t('nostrSettingsDescription'), id: 'about',
icon: Wifi, icon: Info,
href: '/settings/nostr', title: t('aboutShakespeare'),
}, href: '/settings/about',
{ },
id: 'storage', ],
title: t('storageSettings'),
description: t('storageSettingsDescription'),
icon: Database,
href: '/settings/storage',
},
{
id: 'system',
title: t('systemSettings'),
description: t('systemSettingsDescription'),
icon: Settings,
href: '/settings/system',
},
{
id: 'about',
title: t('aboutShakespeare'),
description: t('aboutShakespeareDescription'),
icon: Info,
href: '/settings/about',
}, },
]; ];
+4 -4
View File
@@ -29,7 +29,7 @@ export const defaultSystemPrompt = `{% if mode === "init" %}You are Shakespeare,
# Your Environment # Your Environment
You are operating within **Shakespeare**, an AI-powered Nostr website builder that allows users to create custom Nostr applications through natural language conversation. You are operating within **Shakespeare**, an AI-powered website builder that allows users to create custom applications through natural language conversation.
- **Current Date**: {{ date }} - **Current Date**: {{ date }}
- **Current Page**: {{ location.href }} - **Current Page**: {{ location.href }}
@@ -38,7 +38,7 @@ You are operating within **Shakespeare**, an AI-powered Nostr website builder th
## What Shakespeare Is ## What Shakespeare Is
Shakespeare is a web-based development environment where users can build Nostr websites and applications by chatting with an AI assistant (you). The platform combines the power of AI-driven development with a user-friendly interface that requires no coding knowledge from the user. Shakespeare is a web-based development environment where users can build websites and applications by chatting with an AI assistant (you). The platform combines the power of AI-driven development with a user-friendly interface that requires no coding knowledge from the user.
**Important Architecture Notes:** **Important Architecture Notes:**
@@ -140,11 +140,11 @@ Shakespeare operates on a browser-based virtual filesystem (VFS) that persists a
As the AI assistant in Shakespeare, you help users by: As the AI assistant in Shakespeare, you help users by:
- Understanding their requirements through natural conversation - Understanding their requirements through natural conversation
- Writing and modifying code files to build their Nostr applications - Writing and modifying code files to build their applications
- Explaining technical concepts in accessible terms - Explaining technical concepts in accessible terms
- Providing suggestions and best practices - Providing suggestions and best practices
- Troubleshooting issues and implementing fixes - Troubleshooting issues and implementing fixes
- Building complete, functional Nostr websites and applications - Building complete, functional websites and applications
- Learning from existing projects in the VFS to provide better solutions - Learning from existing projects in the VFS to provide better solutions
The user expects you to handle all technical implementation while they focus on describing their vision and requirements. You can leverage the knowledge from other projects in the VFS to build better, more sophisticated applications. The user expects you to handle all technical implementation while they focus on describing their vision and requirements. You can leverage the knowledge from other projects in the VFS to build better, more sophisticated applications.
+54
View File
@@ -185,4 +185,58 @@ describe('GitCommitTool', () => {
expect(result).toContain('✅ Successfully committed'); expect(result).toContain('✅ Successfully committed');
}); });
it('should error when HEAD is detached (currentBranch returns null)', async () => {
// Mock .git directory exists
vi.mocked(mockFS.stat).mockResolvedValue({
isDirectory: () => true,
isFile: () => false,
});
// Mock detached HEAD state - currentBranch returns null
vi.mocked(mockGitInstance.currentBranch).mockResolvedValue(null);
await expect(tool.execute({ message: 'Test commit' })).rejects.toThrow('❌ Cannot commit: Git is in a detached HEAD state');
// Verify commit was never called
expect(mockGitInstance.commit).not.toHaveBeenCalled();
});
it('should error when HEAD is detached (currentBranch returns undefined)', async () => {
// Mock .git directory exists
vi.mocked(mockFS.stat).mockResolvedValue({
isDirectory: () => true,
isFile: () => false,
});
// Mock detached HEAD state - currentBranch returns undefined
vi.mocked(mockGitInstance.currentBranch).mockResolvedValue(undefined);
await expect(tool.execute({ message: 'Test commit' })).rejects.toThrow('❌ Cannot commit: Git is in a detached HEAD state');
// Verify commit was never called
expect(mockGitInstance.commit).not.toHaveBeenCalled();
});
it('should provide helpful instructions when HEAD is detached', async () => {
// Mock .git directory exists
vi.mocked(mockFS.stat).mockResolvedValue({
isDirectory: () => true,
isFile: () => false,
});
// Mock detached HEAD state
vi.mocked(mockGitInstance.currentBranch).mockResolvedValue(null);
try {
await tool.execute({ message: 'Test commit' });
expect.fail('Should have thrown an error');
} catch (error) {
const errorMessage = (error as Error).message;
// Verify the error message contains safe instructions that preserve changes
expect(errorMessage).toContain('git checkout -b temp-branch');
expect(errorMessage).toContain('try the commit again');
expect(errorMessage).toContain('preserving all changes');
}
});
}); });
+20 -10
View File
@@ -41,6 +41,26 @@ export class GitCommitTool implements Tool<GitCommitParams> {
throw new Error(`❌ Commit message cannot be empty.`); throw new Error(`❌ Commit message cannot be empty.`);
} }
// Check for detached HEAD state before doing any work
// currentBranch returns null when HEAD is detached
const currentBranch = await this.git.currentBranch({
dir: this.cwd,
});
if (currentBranch === null || currentBranch === undefined) {
throw new Error(
`❌ Cannot commit: Git is in a detached HEAD state.\n\n` +
`This usually happens after checking out a specific commit. ` +
`Your changes need to be on a branch before committing.\n\n` +
`To fix this and preserve your staged changes:\n` +
` 1. Run: git checkout -b temp-branch\n` +
` (This creates a new branch from your current state, preserving all changes)\n` +
` 2. Then try the commit again\n` +
` 3. After committing, you can merge to main with:\n` +
` git checkout main && git merge temp-branch`
);
}
// Get git status to see what files have changed // Get git status to see what files have changed
const statusMatrix = await this.git.statusMatrix({ const statusMatrix = await this.git.statusMatrix({
dir: this.cwd, dir: this.cwd,
@@ -79,16 +99,6 @@ export class GitCommitTool implements Tool<GitCommitParams> {
} }
} }
// Get current branch name
let currentBranch = 'main';
try {
currentBranch = await this.git.currentBranch({
dir: this.cwd,
}) || 'main';
} catch {
// Default to 'main' if we can't get the current branch
}
// Commit the changes (author/committer will be set automatically by Git class) // Commit the changes (author/committer will be set automatically by Git class)
const commitSha = await this.git.commit({ const commitSha = await this.git.commit({
dir: this.cwd, dir: this.cwd,
+6 -6
View File
@@ -3,6 +3,9 @@
"settings": "Settings", "settings": "Settings",
"backToSettings": "Back to Settings", "backToSettings": "Back to Settings",
"help": "Help", "help": "Help",
"general": "General",
"integrations": "Integrations",
"advanced": "Advanced",
"anonymous": "Anonymous", "anonymous": "Anonymous",
"logIn": "Log in", "logIn": "Log in",
"signUp": "Sign up", "signUp": "Sign up",
@@ -94,14 +97,12 @@
"chooseModel": "Choose a model...", "chooseModel": "Choose a model...",
"selectModelToDescribe": "Please select a model below, then describe what you'd like to build...", "selectModelToDescribe": "Please select a model below, then describe what you'd like to build...",
"examplePrompt": "e.g., Create a farming equipment marketplace for local farmers to buy and sell tractors, tools, and supplies...", "examplePrompt": "e.g., Create a farming equipment marketplace for local farmers to buy and sell tractors, tools, and supplies...",
"settingsDescription": "Manage your application settings and preferences.",
"aiSettings": "AI", "aiSettings": "AI",
"aiSettingsDescription": "Configure AI providers and API keys", "aiSettingsDescription": "Configure AI providers and API keys",
"gitSettings": "Git", "gitSettings": "Git",
"gitSettingsDescription": "Configure Git credentials for HTTP authentication", "gitSettingsDescription": "Configure Git credentials for HTTP authentication",
"deploySettings": "Deployment", "deploySettings": "Deployment",
"deploySettingsDescription": "Configure deployment providers", "deploySettingsDescription": "Configure deployment providers",
"deploySettingsDescriptionLong": "Configure deployment providers to deploy your projects to various hosting platforms.",
"nostrSettings": "Nostr", "nostrSettings": "Nostr",
"nostrSettingsDescription": "Configure relay connections and Nostr preferences", "nostrSettingsDescription": "Configure relay connections and Nostr preferences",
"storageSettings": "Storage", "storageSettings": "Storage",
@@ -112,6 +113,9 @@
"importRepository": "Import Repository", "importRepository": "Import Repository",
"noProjectsYet": "No projects yet", "noProjectsYet": "No projects yet",
"createFirstProject": "Create your first project to get started", "createFirstProject": "Create your first project to get started",
"searchProjects": "Search projects...",
"noProjectsFound": "No projects found",
"tryDifferentSearch": "Try a different search term",
"closeSidebar": "Close sidebar", "closeSidebar": "Close sidebar",
"collapseSidebar": "Collapse sidebar", "collapseSidebar": "Collapse sidebar",
"welcomeToShakespeare": "Welcome to Shakespeare", "welcomeToShakespeare": "Welcome to Shakespeare",
@@ -179,7 +183,6 @@
"pushFailed": "Push failed", "pushFailed": "Push failed",
"pullSuccessful": "Pull successful", "pullSuccessful": "Pull successful",
"pullFailed": "Pull failed", "pullFailed": "Pull failed",
"aiSettingsDescriptionLong": "Configure AI providers by adding your API keys. Settings are automatically saved and stored locally in your browser.",
"configuredProviders": "Configured Providers", "configuredProviders": "Configured Providers",
"addProvider": "Add Provider", "addProvider": "Add Provider",
"getApiKey": "Get API key", "getApiKey": "Get API key",
@@ -205,7 +208,6 @@
"shakespeareDeployNostrAuth": "This provider uses Nostr authentication. Make sure you are logged in to deploy.", "shakespeareDeployNostrAuth": "This provider uses Nostr authentication. Make sure you are logged in to deploy.",
"providerType": "Provider Type", "providerType": "Provider Type",
"selectProviderType": "Select a provider type", "selectProviderType": "Select a provider type",
"gitSettingsDescriptionLong": "Configure Git credentials for HTTP authentication. Settings are automatically saved and stored locally in your browser.",
"configuredCredentials": "Configured Credentials", "configuredCredentials": "Configured Credentials",
"origin": "Origin", "origin": "Origin",
"username": "Username", "username": "Username",
@@ -226,7 +228,6 @@
"license": "License", "license": "License",
"loadingLicense": "Loading license...", "loadingLicense": "Loading license...",
"failedToLoadLicense": "Failed to load license", "failedToLoadLicense": "Failed to load license",
"dataSettingsDescriptionLong": "Export files and manage local data.",
"offlineCache": "Offline Cache", "offlineCache": "Offline Cache",
"offlineCacheDescription": "Shakespeare caches files locally to enable offline functionality. Clear the cache to free up space or troubleshoot issues.", "offlineCacheDescription": "Shakespeare caches files locally to enable offline functionality. Clear the cache to free up space or troubleshoot issues.",
"cacheSize": "Cache size", "cacheSize": "Cache size",
@@ -294,7 +295,6 @@
"untracked": "untracked", "untracked": "untracked",
"toggleSidebar": "Toggle sidebar", "toggleSidebar": "Toggle sidebar",
"openSidebar": "Open sidebar", "openSidebar": "Open sidebar",
"nostrSettingsDescriptionLong": "Configure your Nostr connection settings and relay preferences.",
"nostrAccounts": "Nostr Accounts", "nostrAccounts": "Nostr Accounts",
"noAccountsLoggedIn": "No accounts logged in. Add an account to get started.", "noAccountsLoggedIn": "No accounts logged in. Add an account to get started.",
"createAccount": "Create Account", "createAccount": "Create Account",
+6 -4
View File
@@ -3,6 +3,9 @@
"settings": "Saitunan", "settings": "Saitunan",
"backToSettings": "Koma zuwa Saitunan", "backToSettings": "Koma zuwa Saitunan",
"help": "Taimako", "help": "Taimako",
"general": "Gabaɗaya",
"integrations": "Haɗin Kai",
"advanced": "Ci Gaba",
"anonymous": "Maras Suna", "anonymous": "Maras Suna",
"logIn": "Shiga", "logIn": "Shiga",
"signUp": "Yi Rajista", "signUp": "Yi Rajista",
@@ -105,6 +108,9 @@
"importRepository": "Shigo da Repository", "importRepository": "Shigo da Repository",
"noProjectsYet": "Babu ayyuka har yanzu", "noProjectsYet": "Babu ayyuka har yanzu",
"createFirstProject": "Ƙirƙiri aikin farko don farawa", "createFirstProject": "Ƙirƙiri aikin farko don farawa",
"searchProjects": "Nemo ayyuka...",
"noProjectsFound": "Ba a sami ayyuka ba",
"tryDifferentSearch": "Gwada kalmar nema daban",
"closeSidebar": "Rufe gefen mashigi", "closeSidebar": "Rufe gefen mashigi",
"collapseSidebar": "Rufe gefen mashigi", "collapseSidebar": "Rufe gefen mashigi",
"welcomeToShakespeare": "Maraba da Shakespeare", "welcomeToShakespeare": "Maraba da Shakespeare",
@@ -172,7 +178,6 @@
"pushFailed": "Turawa ta gaza", "pushFailed": "Turawa ta gaza",
"pullSuccessful": "Ja ya yi nasara", "pullSuccessful": "Ja ya yi nasara",
"pullFailed": "Ja ya gaza", "pullFailed": "Ja ya gaza",
"aiSettingsDescriptionLong": "Saita masu samar da AI ta hanyar ƙara maɓallan API. Saitunan ana ajiye su kai tsaye kuma ana adana su a cikin burauzar ku.",
"configuredProviders": "Masu Samarwa da aka Saita", "configuredProviders": "Masu Samarwa da aka Saita",
"addProvider": "Ƙara Mai Samarwa", "addProvider": "Ƙara Mai Samarwa",
"getApiKey": "Sami maɓallin API", "getApiKey": "Sami maɓallin API",
@@ -198,7 +203,6 @@
"shakespeareDeployNostrAuth": "Wannan mai samarwa yana amfani da tabbatar da Nostr. Tabbatar cewa kun shiga don tura.", "shakespeareDeployNostrAuth": "Wannan mai samarwa yana amfani da tabbatar da Nostr. Tabbatar cewa kun shiga don tura.",
"providerType": "Nau'in Mai Samarwa", "providerType": "Nau'in Mai Samarwa",
"selectProviderType": "Zaɓi nau'in mai samarwa", "selectProviderType": "Zaɓi nau'in mai samarwa",
"gitSettingsDescriptionLong": "Saita bayanan shaidar Git don tabbatar da HTTP. Saitunan ana ajiye su kai tsaye kuma ana adana su a cikin burauzar ku.",
"configuredCredentials": "Bayanan Shaidar da aka Saita", "configuredCredentials": "Bayanan Shaidar da aka Saita",
"origin": "Asali", "origin": "Asali",
"username": "Sunan mai amfani", "username": "Sunan mai amfani",
@@ -210,7 +214,6 @@
"gitEmail": "Imel Git", "gitEmail": "Imel Git",
"coAuthoredByShakespeare": "Haɗin marubuta da Shakespeare", "coAuthoredByShakespeare": "Haɗin marubuta da Shakespeare",
"gitIdentityDescription": "Idan an saita suna da imel, za a yi amfani da su azaman marubucin aikin. In ba haka ba, za a yi amfani da shakespeare.diy. Lokacin da aka kunna haɗin marubuta, za a ƙara Shakespeare azaman haɗin marubuta.", "gitIdentityDescription": "Idan an saita suna da imel, za a yi amfani da su azaman marubucin aikin. In ba haka ba, za a yi amfani da shakespeare.diy. Lokacin da aka kunna haɗin marubuta, za a ƙara Shakespeare azaman haɗin marubuta.",
"dataSettingsDescriptionLong": "Fitar da fayiloli da sarrafa bayanan gida.",
"exportFiles": "Fitar da Fayiloli", "exportFiles": "Fitar da Fayiloli",
"exportFilesDescription": "Sauke duk ayyukanku da fayiloli azaman ajiyar ZIP. Wannan ya haɗa da duk fayilolin aikin, saitunan, da bayanan da aka adana a gida.", "exportFilesDescription": "Sauke duk ayyukanku da fayiloli azaman ajiyar ZIP. Wannan ya haɗa da duk fayilolin aikin, saitunan, da bayanan da aka adana a gida.",
"exportAllFiles": "Fitar da Duk Fayiloli", "exportAllFiles": "Fitar da Duk Fayiloli",
@@ -280,7 +283,6 @@
"untracked": "ba a bi ba", "untracked": "ba a bi ba",
"toggleSidebar": "Juya gefen mashigi", "toggleSidebar": "Juya gefen mashigi",
"openSidebar": "Buɗe gefen mashigi", "openSidebar": "Buɗe gefen mashigi",
"nostrSettingsDescriptionLong": "Saita saitunan haɗin Nostr da zaɓuɓɓukan relay.",
"nostrAccounts": "Asusun Nostr", "nostrAccounts": "Asusun Nostr",
"noAccountsLoggedIn": "Babu asusun da aka shiga. Ƙara asusu don farawa.", "noAccountsLoggedIn": "Babu asusun da aka shiga. Ƙara asusu don farawa.",
"createAccount": "Ƙirƙiri Asusu", "createAccount": "Ƙirƙiri Asusu",
+6 -4
View File
@@ -3,6 +3,9 @@
"settings": "Ntọala", "settings": "Ntọala",
"backToSettings": "Laghachi na Ntọala", "backToSettings": "Laghachi na Ntọala",
"help": "Enyemaka", "help": "Enyemaka",
"general": "Izugbe",
"integrations": "Njikọta",
"advanced": "Dị elu",
"anonymous": "Onye na-amaghị aha", "anonymous": "Onye na-amaghị aha",
"logIn": "Banye", "logIn": "Banye",
"signUp": "Debanye aha", "signUp": "Debanye aha",
@@ -105,6 +108,9 @@
"importRepository": "Bubata Repository", "importRepository": "Bubata Repository",
"noProjectsYet": "Enwebeghị ọrụ ọ bụla", "noProjectsYet": "Enwebeghị ọrụ ọ bụla",
"createFirstProject": "Mepụta ọrụ mbụ gị iji malite", "createFirstProject": "Mepụta ọrụ mbụ gị iji malite",
"searchProjects": "Chọọ ọrụ...",
"noProjectsFound": "Achọtaghị ọrụ ọ bụla",
"tryDifferentSearch": "Nwalee okwu ọchụchọ dị iche",
"closeSidebar": "Mechie sidebar", "closeSidebar": "Mechie sidebar",
"collapseSidebar": "Gbakọọ sidebar", "collapseSidebar": "Gbakọọ sidebar",
"welcomeToShakespeare": "Nnọọ na Shakespeare", "welcomeToShakespeare": "Nnọọ na Shakespeare",
@@ -172,7 +178,6 @@
"pushFailed": "Nkwanye dara", "pushFailed": "Nkwanye dara",
"pullSuccessful": "Ndọta gara nke ọma", "pullSuccessful": "Ndọta gara nke ọma",
"pullFailed": "Ndọta dara", "pullFailed": "Ndọta dara",
"aiSettingsDescriptionLong": "Hazie ndị na-enye AI site na ịtinye igodo API gị. Ntọala na-echekwa onwe ya ma chekwaa ya na mpaghara na browser gị.",
"configuredProviders": "Ndị Na-enye Ahaziri", "configuredProviders": "Ndị Na-enye Ahaziri",
"addProvider": "Tinye Onye Na-enye", "addProvider": "Tinye Onye Na-enye",
"getApiKey": "Nweta igodo API", "getApiKey": "Nweta igodo API",
@@ -198,7 +203,6 @@
"shakespeareDeployNostrAuth": "Onye na-enye a na-eji nkwenye Nostr. Jide n'aka na ị banyere iji bufee.", "shakespeareDeployNostrAuth": "Onye na-enye a na-eji nkwenye Nostr. Jide n'aka na ị banyere iji bufee.",
"providerType": "Ụdị Onye Na-enye", "providerType": "Ụdị Onye Na-enye",
"selectProviderType": "Họrọ ụdị onye na-enye", "selectProviderType": "Họrọ ụdị onye na-enye",
"gitSettingsDescriptionLong": "Hazie nzere Git maka nkwenye HTTP. Ntọala na-echekwa onwe ya ma chekwaa ya na mpaghara na browser gị.",
"configuredCredentials": "Nzere Ahaziri", "configuredCredentials": "Nzere Ahaziri",
"origin": "Mmalite", "origin": "Mmalite",
"username": "Aha onye ọrụ", "username": "Aha onye ọrụ",
@@ -210,7 +214,6 @@
"gitEmail": "Ozi-eletrọniki Git", "gitEmail": "Ozi-eletrọniki Git",
"coAuthoredByShakespeare": "Ndekọ ọnụ na Shakespeare", "coAuthoredByShakespeare": "Ndekọ ọnụ na Shakespeare",
"gitIdentityDescription": "Ọ bụrụ na ahaziri aha na ozi-eletrọniki, a ga-eji ha dị ka onye dere ya. Ma ọ bụghị, a ga-eji shakespeare.diy. Mgbe emere ndekọ ọnụ, a ga-etinye Shakespeare dị ka ndekọ ọnụ.", "gitIdentityDescription": "Ọ bụrụ na ahaziri aha na ozi-eletrọniki, a ga-eji ha dị ka onye dere ya. Ma ọ bụghị, a ga-eji shakespeare.diy. Mgbe emere ndekọ ọnụ, a ga-etinye Shakespeare dị ka ndekọ ọnụ.",
"dataSettingsDescriptionLong": "Bupụta faịlụ ma jikwaa data mpaghara.",
"exportFiles": "Bupụta Faịlụ", "exportFiles": "Bupụta Faịlụ",
"exportFilesDescription": "Budata ọrụ gị niile na faịlụ dị ka mkpokọta ZIP. Nke a gụnyere faịlụ ọrụ niile, ntọala, na data echekwara na mpaghara.", "exportFilesDescription": "Budata ọrụ gị niile na faịlụ dị ka mkpokọta ZIP. Nke a gụnyere faịlụ ọrụ niile, ntọala, na data echekwara na mpaghara.",
"exportAllFiles": "Bupụta Faịlụ Niile", "exportAllFiles": "Bupụta Faịlụ Niile",
@@ -277,7 +280,6 @@
"untracked": "na-esoghị", "untracked": "na-esoghị",
"toggleSidebar": "Gbanwee sidebar", "toggleSidebar": "Gbanwee sidebar",
"openSidebar": "Meghee sidebar", "openSidebar": "Meghee sidebar",
"nostrSettingsDescriptionLong": "Hazie ntọala njikọ Nostr gị na nhọrọ relay.",
"nostrAccounts": "Akaụntụ Nostr", "nostrAccounts": "Akaụntụ Nostr",
"noAccountsLoggedIn": "Enweghị akaụntụ banyere. Tinye akaụntụ iji malite.", "noAccountsLoggedIn": "Enweghị akaụntụ banyere. Tinye akaụntụ iji malite.",
"createAccount": "Mepụta Akaụntụ", "createAccount": "Mepụta Akaụntụ",
+6 -5
View File
@@ -3,6 +3,9 @@
"settings": "Configurações", "settings": "Configurações",
"backToSettings": "Voltar às Configurações", "backToSettings": "Voltar às Configurações",
"help": "Ajuda", "help": "Ajuda",
"general": "Geral",
"integrations": "Integrações",
"advanced": "Avançado",
"anonymous": "Anônimo", "anonymous": "Anônimo",
"logIn": "Entrar", "logIn": "Entrar",
"signUp": "Cadastrar", "signUp": "Cadastrar",
@@ -97,7 +100,6 @@
"gitSettingsDescription": "Configure credenciais do Git para autenticação HTTP", "gitSettingsDescription": "Configure credenciais do Git para autenticação HTTP",
"deploySettings": "Implantação", "deploySettings": "Implantação",
"deploySettingsDescription": "Configure provedores de implantação", "deploySettingsDescription": "Configure provedores de implantação",
"deploySettingsDescriptionLong": "Configure provedores de implantação para implantar seus projetos em várias plataformas de hospedagem.",
"nostrSettings": "Nostr", "nostrSettings": "Nostr",
"nostrSettingsDescription": "Configure conexões de relay e preferências do Nostr", "nostrSettingsDescription": "Configure conexões de relay e preferências do Nostr",
"storageSettings": "Armazenamento", "storageSettings": "Armazenamento",
@@ -108,6 +110,9 @@
"importRepository": "Importar Repositório", "importRepository": "Importar Repositório",
"noProjectsYet": "Nenhum projeto ainda", "noProjectsYet": "Nenhum projeto ainda",
"createFirstProject": "Crie seu primeiro projeto para começar", "createFirstProject": "Crie seu primeiro projeto para começar",
"searchProjects": "Pesquisar projetos...",
"noProjectsFound": "Nenhum projeto encontrado",
"tryDifferentSearch": "Tente um termo de pesquisa diferente",
"closeSidebar": "Fechar barra lateral", "closeSidebar": "Fechar barra lateral",
"collapseSidebar": "Recolher barra lateral", "collapseSidebar": "Recolher barra lateral",
"welcomeToShakespeare": "Bem-vindo ao Shakespeare", "welcomeToShakespeare": "Bem-vindo ao Shakespeare",
@@ -175,7 +180,6 @@
"pushFailed": "Push falhou", "pushFailed": "Push falhou",
"pullSuccessful": "Pull realizado com sucesso", "pullSuccessful": "Pull realizado com sucesso",
"pullFailed": "Pull falhou", "pullFailed": "Pull falhou",
"aiSettingsDescriptionLong": "Configure provedores de IA adicionando suas chaves de API. As configurações são salvas automaticamente e armazenadas localmente em seu navegador.",
"configuredProviders": "Provedores Configurados", "configuredProviders": "Provedores Configurados",
"addProvider": "Adicionar Provedor", "addProvider": "Adicionar Provedor",
"getApiKey": "Obter chave de API", "getApiKey": "Obter chave de API",
@@ -201,7 +205,6 @@
"shakespeareDeployNostrAuth": "Este provedor usa autenticação Nostr. Certifique-se de estar logado para implantar.", "shakespeareDeployNostrAuth": "Este provedor usa autenticação Nostr. Certifique-se de estar logado para implantar.",
"providerType": "Tipo de Provedor", "providerType": "Tipo de Provedor",
"selectProviderType": "Selecione um tipo de provedor", "selectProviderType": "Selecione um tipo de provedor",
"gitSettingsDescriptionLong": "Configure credenciais do Git para autenticação HTTP. As configurações são salvas automaticamente e armazenadas localmente em seu navegador.",
"configuredCredentials": "Credenciais Configuradas", "configuredCredentials": "Credenciais Configuradas",
"origin": "Origem", "origin": "Origem",
"username": "Nome de usuário", "username": "Nome de usuário",
@@ -213,7 +216,6 @@
"gitEmail": "Email Git", "gitEmail": "Email Git",
"coAuthoredByShakespeare": "Co-autoria de Shakespeare", "coAuthoredByShakespeare": "Co-autoria de Shakespeare",
"gitIdentityDescription": "Se nome e email estiverem configurados, eles serão usados como autor do commit. Caso contrário, shakespeare.diy será usado. Quando co-autoria estiver ativada, Shakespeare será adicionado como co-autor.", "gitIdentityDescription": "Se nome e email estiverem configurados, eles serão usados como autor do commit. Caso contrário, shakespeare.diy será usado. Quando co-autoria estiver ativada, Shakespeare será adicionado como co-autor.",
"dataSettingsDescriptionLong": "Exporte arquivos e gerencie dados locais.",
"offlineCache": "Cache Offline", "offlineCache": "Cache Offline",
"offlineCacheDescription": "O Shakespeare armazena arquivos localmente para permitir funcionalidade offline. Limpe o cache para liberar espaço ou solucionar problemas.", "offlineCacheDescription": "O Shakespeare armazena arquivos localmente para permitir funcionalidade offline. Limpe o cache para liberar espaço ou solucionar problemas.",
"cacheSize": "Tamanho do cache", "cacheSize": "Tamanho do cache",
@@ -290,7 +292,6 @@
"untracked": "não rastreado", "untracked": "não rastreado",
"toggleSidebar": "Alternar barra lateral", "toggleSidebar": "Alternar barra lateral",
"openSidebar": "Abrir barra lateral", "openSidebar": "Abrir barra lateral",
"nostrSettingsDescriptionLong": "Configure suas configurações de conexão Nostr e preferências de relay.",
"nostrAccounts": "Contas Nostr", "nostrAccounts": "Contas Nostr",
"noAccountsLoggedIn": "Nenhuma conta logada. Adicione uma conta para começar.", "noAccountsLoggedIn": "Nenhuma conta logada. Adicione uma conta para começar.",
"createAccount": "Criar Conta", "createAccount": "Criar Conta",
+6 -4
View File
@@ -3,6 +3,9 @@
"settings": "Awọn eto", "settings": "Awọn eto",
"backToSettings": "Pada si Awọn eto", "backToSettings": "Pada si Awọn eto",
"help": "Iranlọwọ", "help": "Iranlọwọ",
"general": "Gbogbogbo",
"integrations": "Awọn isopọ",
"advanced": "To siwaju",
"anonymous": "Alainidamọ", "anonymous": "Alainidamọ",
"logIn": "Wọle", "logIn": "Wọle",
"signUp": "Forukọsilẹ", "signUp": "Forukọsilẹ",
@@ -105,6 +108,9 @@
"importRepository": "Gbe Repository wọle", "importRepository": "Gbe Repository wọle",
"noProjectsYet": "Ko si awọn iṣẹ akanṣe sibẹsibẹ", "noProjectsYet": "Ko si awọn iṣẹ akanṣe sibẹsibẹ",
"createFirstProject": "Ṣẹda iṣẹ akanṣe akọkọ rẹ lati bẹrẹ", "createFirstProject": "Ṣẹda iṣẹ akanṣe akọkọ rẹ lati bẹrẹ",
"searchProjects": "Wa awọn iṣẹ akanṣe...",
"noProjectsFound": "Ko ri awọn iṣẹ akanṣe",
"tryDifferentSearch": "Gbiyanju ọrọ wiwa miiran",
"closeSidebar": "Ti ẹgbẹ sidebar", "closeSidebar": "Ti ẹgbẹ sidebar",
"collapseSidebar": "Subu sidebar", "collapseSidebar": "Subu sidebar",
"welcomeToShakespeare": "Kaabo si Shakespeare", "welcomeToShakespeare": "Kaabo si Shakespeare",
@@ -172,7 +178,6 @@
"pushFailed": "Titari kuna", "pushFailed": "Titari kuna",
"pullSuccessful": "Fifa ni aṣeyọri", "pullSuccessful": "Fifa ni aṣeyọri",
"pullFailed": "Fifa kuna", "pullFailed": "Fifa kuna",
"aiSettingsDescriptionLong": "Tunto awọn olupese AI nipa fifi awọn bọtini API rẹ kun. Awọn eto ni a fi pamọ laifọwọyi ati pe a tọju wọn ni agbegbe ninu awọn aṣawakiri rẹ.",
"configuredProviders": "Awọn Olupese Ti a Tunto", "configuredProviders": "Awọn Olupese Ti a Tunto",
"addProvider": "Fi Olupese kun", "addProvider": "Fi Olupese kun",
"getApiKey": "Gba bọtini API", "getApiKey": "Gba bọtini API",
@@ -198,7 +203,6 @@
"shakespeareDeployNostrAuth": "Olupese yii nlo ijẹrisi Nostr. Rii daju pe o ti wọle lati gbe jade.", "shakespeareDeployNostrAuth": "Olupese yii nlo ijẹrisi Nostr. Rii daju pe o ti wọle lati gbe jade.",
"providerType": "Iru Olupese", "providerType": "Iru Olupese",
"selectProviderType": "Yan iru olupese kan", "selectProviderType": "Yan iru olupese kan",
"gitSettingsDescriptionLong": "Tunto awọn ẹri Git fun ijẹrisi HTTP. Awọn eto ni a fi pamọ laifọwọyi ati pe a tọju wọn ni agbegbe ninu awọn aṣawakiri rẹ.",
"configuredCredentials": "Awọn Ẹri Ti a Tunto", "configuredCredentials": "Awọn Ẹri Ti a Tunto",
"origin": "Ipilẹṣẹ", "origin": "Ipilẹṣẹ",
"username": "Orukọ olumulo", "username": "Orukọ olumulo",
@@ -210,7 +214,6 @@
"gitEmail": "Imeeli Git", "gitEmail": "Imeeli Git",
"coAuthoredByShakespeare": "Ajọpọ onkọwe pẹlu Shakespeare", "coAuthoredByShakespeare": "Ajọpọ onkọwe pẹlu Shakespeare",
"gitIdentityDescription": "Ti a ba tunto orukọ ati imeeli, wọn yoo jẹ lilo bi onkọwe. Bibẹẹkọ, shakespeare.diy yoo jẹ lilo. Nigbati a ba mu ajọpọ onkọwe ṣiṣẹ, Shakespeare yoo jẹ fifikun bi ajọpọ onkọwe.", "gitIdentityDescription": "Ti a ba tunto orukọ ati imeeli, wọn yoo jẹ lilo bi onkọwe. Bibẹẹkọ, shakespeare.diy yoo jẹ lilo. Nigbati a ba mu ajọpọ onkọwe ṣiṣẹ, Shakespeare yoo jẹ fifikun bi ajọpọ onkọwe.",
"dataSettingsDescriptionLong": "Gbe awọn faili jade ati ṣakoso data agbegbe.",
"exportFiles": "Gbe Awọn faili jade", "exportFiles": "Gbe Awọn faili jade",
"exportFilesDescription": "Gba gbogbo awọn iṣẹ akanṣe ati awọn faili rẹ gẹgẹbi apo ZIP. Eyi pẹlu gbogbo awọn faili iṣẹ akanṣe, awọn eto, ati data ti a tọju ni agbegbe.", "exportFilesDescription": "Gba gbogbo awọn iṣẹ akanṣe ati awọn faili rẹ gẹgẹbi apo ZIP. Eyi pẹlu gbogbo awọn faili iṣẹ akanṣe, awọn eto, ati data ti a tọju ni agbegbe.",
"exportAllFiles": "Gbe Gbogbo Awọn faili jade", "exportAllFiles": "Gbe Gbogbo Awọn faili jade",
@@ -277,7 +280,6 @@
"untracked": "ti a ko tọpa", "untracked": "ti a ko tọpa",
"toggleSidebar": "Yipada sidebar", "toggleSidebar": "Yipada sidebar",
"openSidebar": "Ṣi sidebar", "openSidebar": "Ṣi sidebar",
"nostrSettingsDescriptionLong": "Tunto awọn eto asopọ Nostr rẹ ati awọn ayanfẹ relay.",
"nostrAccounts": "Awọn Akọọlẹ Nostr", "nostrAccounts": "Awọn Akọọlẹ Nostr",
"noAccountsLoggedIn": "Ko si awọn akọọlẹ ti o wọle. Fi akọọlẹ kun lati bẹrẹ.", "noAccountsLoggedIn": "Ko si awọn akọọlẹ ti o wọle. Fi akọọlẹ kun lati bẹrẹ.",
"createAccount": "Ṣẹda Akọọlẹ", "createAccount": "Ṣẹda Akọọlẹ",
+6 -5
View File
@@ -3,6 +3,9 @@
"settings": "设置", "settings": "设置",
"backToSettings": "返回设置", "backToSettings": "返回设置",
"help": "帮助", "help": "帮助",
"general": "常规",
"integrations": "集成",
"advanced": "高级",
"anonymous": "匿名", "anonymous": "匿名",
"logIn": "登录", "logIn": "登录",
"signUp": "注册", "signUp": "注册",
@@ -97,7 +100,6 @@
"gitSettingsDescription": "配置HTTP身份验证的Git凭据", "gitSettingsDescription": "配置HTTP身份验证的Git凭据",
"deploySettings": "部署", "deploySettings": "部署",
"deploySettingsDescription": "配置部署提供商", "deploySettingsDescription": "配置部署提供商",
"deploySettingsDescriptionLong": "配置部署提供商以将您的项目部署到各种托管平台。",
"nostrSettings": "Nostr", "nostrSettings": "Nostr",
"nostrSettingsDescription": "配置中继连接和Nostr偏好", "nostrSettingsDescription": "配置中继连接和Nostr偏好",
"storageSettings": "存储", "storageSettings": "存储",
@@ -108,6 +110,9 @@
"importRepository": "导入仓库", "importRepository": "导入仓库",
"noProjectsYet": "还没有项目", "noProjectsYet": "还没有项目",
"createFirstProject": "创建您的第一个项目开始使用", "createFirstProject": "创建您的第一个项目开始使用",
"searchProjects": "搜索项目...",
"noProjectsFound": "未找到项目",
"tryDifferentSearch": "尝试不同的搜索词",
"closeSidebar": "关闭侧边栏", "closeSidebar": "关闭侧边栏",
"collapseSidebar": "折叠侧边栏", "collapseSidebar": "折叠侧边栏",
"welcomeToShakespeare": "欢迎使用Shakespeare", "welcomeToShakespeare": "欢迎使用Shakespeare",
@@ -175,7 +180,6 @@
"pushFailed": "推送失败", "pushFailed": "推送失败",
"pullSuccessful": "拉取成功", "pullSuccessful": "拉取成功",
"pullFailed": "拉取失败", "pullFailed": "拉取失败",
"aiSettingsDescriptionLong": "通过添加您的API密钥来配置AI提供商。设置会自动保存并存储在您的浏览器本地。",
"configuredProviders": "已配置的提供商", "configuredProviders": "已配置的提供商",
"addProvider": "添加提供商", "addProvider": "添加提供商",
"getApiKey": "获取API密钥", "getApiKey": "获取API密钥",
@@ -201,7 +205,6 @@
"shakespeareDeployNostrAuth": "此提供商使用Nostr身份验证。请确保您已登录以进行部署。", "shakespeareDeployNostrAuth": "此提供商使用Nostr身份验证。请确保您已登录以进行部署。",
"providerType": "提供商类型", "providerType": "提供商类型",
"selectProviderType": "选择提供商类型", "selectProviderType": "选择提供商类型",
"gitSettingsDescriptionLong": "配置HTTP身份验证的Git凭据。设置会自动保存并存储在您的浏览器本地。",
"configuredCredentials": "已配置的凭据", "configuredCredentials": "已配置的凭据",
"origin": "源", "origin": "源",
"username": "用户名", "username": "用户名",
@@ -213,7 +216,6 @@
"gitEmail": "Git邮箱", "gitEmail": "Git邮箱",
"coAuthoredByShakespeare": "Shakespeare共同作者", "coAuthoredByShakespeare": "Shakespeare共同作者",
"gitIdentityDescription": "如果配置了名称和邮箱,它们将用作提交作者。否则,将使用shakespeare.diy。启用共同作者时,Shakespeare将被添加为共同作者。", "gitIdentityDescription": "如果配置了名称和邮箱,它们将用作提交作者。否则,将使用shakespeare.diy。启用共同作者时,Shakespeare将被添加为共同作者。",
"dataSettingsDescriptionLong": "导出文件和管理本地数据。",
"offlineCache": "离线缓存", "offlineCache": "离线缓存",
"offlineCacheDescription": "Shakespeare在本地缓存文件以启用离线功能。清除缓存以释放空间或解决问题。", "offlineCacheDescription": "Shakespeare在本地缓存文件以启用离线功能。清除缓存以释放空间或解决问题。",
"cacheSize": "缓存大小", "cacheSize": "缓存大小",
@@ -290,7 +292,6 @@
"untracked": "未跟踪", "untracked": "未跟踪",
"toggleSidebar": "切换侧边栏", "toggleSidebar": "切换侧边栏",
"openSidebar": "打开侧边栏", "openSidebar": "打开侧边栏",
"nostrSettingsDescriptionLong": "配置您的Nostr连接设置和中继偏好。",
"nostrAccounts": "Nostr账户", "nostrAccounts": "Nostr账户",
"noAccountsLoggedIn": "没有账户登录。添加账户开始使用。", "noAccountsLoggedIn": "没有账户登录。添加账户开始使用。",
"createAccount": "创建账户", "createAccount": "创建账户",
+42 -39
View File
@@ -26,6 +26,7 @@ import { PasswordInput } from '@/components/ui/password-input';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label';
import { Checkbox } from '@/components/ui/checkbox'; import { Checkbox } from '@/components/ui/checkbox';
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
import { Card, CardContent } from '@/components/ui/card';
import { CreditsBadge } from '@/components/CreditsBadge'; import { CreditsBadge } from '@/components/CreditsBadge';
import { CreditsDialog } from '@/components/CreditsDialog'; import { CreditsDialog } from '@/components/CreditsDialog';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
@@ -303,7 +304,7 @@ export function AISettings() {
{t('aiSettings')} {t('aiSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('aiSettingsDescriptionLong')} {t('aiSettingsDescription')}
</p> </p>
</div> </div>
</div> </div>
@@ -316,7 +317,7 @@ export function AISettings() {
{t('aiSettings')} {t('aiSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('aiSettingsDescriptionLong')} {t('aiSettingsDescription')}
</p> </p>
</div> </div>
)} )}
@@ -368,43 +369,44 @@ export function AISettings() {
const showNostrLoginRequired = isNostrPreset && !isLoggedIntoNostr; const showNostrLoginRequired = isNostrPreset && !isLoggedIntoNostr;
return ( return (
<div key={preset.id} className="border rounded-lg p-4 space-y-3"> <Card key={preset.id}>
<div className="flex items-center justify-between"> <CardContent className="p-4 space-y-3">
<div className="flex items-center gap-2"> <div className="flex items-center justify-between">
<ExternalFavicon <div className="flex items-center gap-2">
url={preset.baseURL} <ExternalFavicon
size={16} url={preset.baseURL}
fallback={<Bot size={16} />} size={16}
/> fallback={<Bot size={16} />}
<h5 className="font-medium">{preset.name}</h5> />
<h5 className="font-medium">{preset.name}</h5>
</div>
{(preset.apiKeysURL && preset.id !== "routstr") && (
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.apiKeysURL, '_blank')}
>
{t('getApiKey')}
</button>
)}
</div> </div>
{(preset.apiKeysURL && preset.id !== "routstr") && (
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.apiKeysURL, '_blank')}
>
{t('getApiKey')}
</button>
)}
</div>
{showNostrLoginRequired ? ( {showNostrLoginRequired ? (
<div className="space-y-2"> <div className="space-y-2">
<p className="text-sm text-muted-foreground"> <p className="text-sm text-muted-foreground">
{t('loginToNostrRequired')} {t('loginToNostrRequired')}
</p> </p>
<Button <Button
asChild asChild
className="w-full" className="w-full"
> >
<Link to="/settings/nostr"> <Link to="/settings/nostr">
{t('goToNostrSettings')} {t('goToNostrSettings')}
</Link> </Link>
</Button> </Button>
</div> </div>
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
<div className="flex gap-2"> <div className="flex gap-2">
{!preset.nostr && ( {!preset.nostr && (
<PasswordInput <PasswordInput
@@ -469,7 +471,8 @@ export function AISettings() {
</div> </div>
</div> </div>
)} )}
</div> </CardContent>
</Card>
); );
})} })}
</div> </div>
@@ -479,7 +482,7 @@ export function AISettings() {
{/* Custom Provider */} {/* Custom Provider */}
<div className="space-y-3"> <div className="space-y-3">
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="custom-provider" className="border rounded-lg"> <AccordionItem value="custom-provider">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<h4 className="text-sm font-medium">{t('addCustomProvider')}</h4> <h4 className="text-sm font-medium">{t('addCustomProvider')}</h4>
</AccordionTrigger> </AccordionTrigger>
+18 -13
View File
@@ -5,6 +5,7 @@ import { Info, ExternalLink, Loader2, AlertTriangle, ArrowLeft, Code, Globe } fr
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
import { Alert, AlertDescription } from '@/components/ui/alert'; import { Alert, AlertDescription } from '@/components/ui/alert';
import { Card, CardContent } from '@/components/ui/card';
import { useIsMobile } from '@/hooks/useIsMobile'; import { useIsMobile } from '@/hooks/useIsMobile';
import { EmailSubscription } from '@/components/EmailSubscription'; import { EmailSubscription } from '@/components/EmailSubscription';
@@ -85,7 +86,7 @@ export function AboutSettings() {
<div className="space-y-3"> <div className="space-y-3">
{/* Mirrors */} {/* Mirrors */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="mirrors" className="border rounded-lg"> <AccordionItem value="mirrors">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Globe className="h-5 w-5" /> <Globe className="h-5 w-5" />
@@ -131,21 +132,25 @@ export function AboutSettings() {
</Accordion> </Accordion>
{/* Project Information */} {/* Project Information */}
<Button <Card>
variant="outline" <CardContent className="p-0">
className="w-full h-12 flex items-center gap-2 justify-start text-base" <Button
asChild variant="ghost"
> className="w-full h-12 flex items-center gap-2 justify-start text-base"
<a href="https://gitlab.com/soapbox-pub/shakespeare" target="_blank"> asChild
<Code className="!size-5" /> >
{t('sourceCode')} <a href="https://gitlab.com/soapbox-pub/shakespeare" target="_blank">
<ExternalLink className="ml-auto" /> <Code className="!size-5" />
</a> {t('sourceCode')}
</Button> <ExternalLink className="ml-auto" />
</a>
</Button>
</CardContent>
</Card>
{/* License */} {/* License */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="license-text" className="border rounded-lg"> <AccordionItem value="license-text">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Info className="h-5 w-5" /> <Info className="h-5 w-5" />
+135
View File
@@ -10,6 +10,14 @@ import { useToast } from '@/hooks/useToast';
import { ZipImportDialog } from '@/components/ZipImportDialog'; import { ZipImportDialog } from '@/components/ZipImportDialog';
import { useSeoMeta } from '@unhead/react'; import { useSeoMeta } from '@unhead/react';
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useUserRepositories } from '@/hooks/useUserRepositories';
import { useContacts } from '@/hooks/useContacts';
import { useFollowedRepositories } from '@/hooks/useFollowedRepositories';
import { RepositoryCard } from '@/components/RepositoryCard';
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent } from '@/components/ui/card';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
export default function Clone() { export default function Clone() {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -22,6 +30,11 @@ export default function Clone() {
const { toast } = useToast(); const { toast } = useToast();
const autoCloneInitiatedRef = useRef(false); const autoCloneInitiatedRef = useRef(false);
const [isZipDialogOpen, setIsZipDialogOpen] = useState(false); const [isZipDialogOpen, setIsZipDialogOpen] = useState(false);
const { user } = useCurrentUser();
const { data: repositories = [], isLoading: isLoadingRepos } = useUserRepositories(user?.pubkey);
const { data: contacts = [] } = useContacts(user?.pubkey);
const { data: followedRepositories = [], isLoading: isLoadingFollowedRepos } = useFollowedRepositories(contacts);
const [activeTab, setActiveTab] = useState<'my-projects' | 'follows'>('my-projects');
useSeoMeta({ useSeoMeta({
title: `${t('importRepository')} - Shakespeare`, title: `${t('importRepository')} - Shakespeare`,
@@ -276,6 +289,128 @@ export default function Clone() {
open={isZipDialogOpen} open={isZipDialogOpen}
onOpenChange={setIsZipDialogOpen} onOpenChange={setIsZipDialogOpen}
/> />
{/* NIP-34 Repositories with Tabs */}
{user && (
<div className="mt-16 max-w-7xl mx-auto">
<Tabs value={activeTab} onValueChange={(value) => setActiveTab(value as 'my-projects' | 'follows')}>
<TabsList className="mb-6">
<TabsTrigger value="my-projects">
My Projects
</TabsTrigger>
<TabsTrigger value="follows">
Follows
</TabsTrigger>
</TabsList>
<TabsContent value="my-projects">
{isLoadingRepos ? (
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
{Array.from({ length: 3 }).map((_, i) => (
<Card key={i} className="h-full flex flex-col">
<CardContent className="p-6 flex flex-col flex-1">
<div className="flex items-start gap-3 mb-4">
<Skeleton className="w-12 h-12 rounded-lg" />
<div className="flex-1 space-y-2">
<Skeleton className="h-5 w-32" />
<Skeleton className="h-4 w-24" />
</div>
</div>
<div className="space-y-2 mb-4">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-4/5" />
</div>
<div className="flex gap-1 mb-4">
<Skeleton className="h-5 w-16" />
<Skeleton className="h-5 w-20" />
</div>
<div className="mt-auto flex gap-2">
<Skeleton className="h-9 flex-1" />
<Skeleton className="h-9 w-9" />
</div>
</CardContent>
</Card>
))}
</div>
) : repositories.length > 0 ? (
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
{repositories.map((repo) => (
<RepositoryCard key={repo.id} repo={repo} />
))}
</div>
) : (
<Card className="border-dashed">
<CardContent className="py-12 px-8 text-center">
<div className="max-w-sm mx-auto space-y-4">
<p className="text-muted-foreground">
No repositories found. Publish your first repository to Nostr to see it here.
</p>
</div>
</CardContent>
</Card>
)}
</TabsContent>
<TabsContent value="follows">
{isLoadingFollowedRepos ? (
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
{Array.from({ length: 6 }).map((_, i) => (
<Card key={i} className="h-full flex flex-col">
<CardContent className="p-6 flex flex-col flex-1">
<div className="flex items-start gap-3 mb-4">
<Skeleton className="w-12 h-12 rounded-lg" />
<div className="flex-1 space-y-2">
<Skeleton className="h-5 w-32" />
<Skeleton className="h-4 w-24" />
</div>
</div>
<div className="space-y-2 mb-4">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-4/5" />
</div>
<div className="flex gap-1 mb-4">
<Skeleton className="h-5 w-16" />
<Skeleton className="h-5 w-20" />
</div>
<div className="mt-auto flex gap-2">
<Skeleton className="h-9 flex-1" />
<Skeleton className="h-9 w-9" />
</div>
</CardContent>
</Card>
))}
</div>
) : followedRepositories.length > 0 ? (
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
{followedRepositories.map((repo) => (
<RepositoryCard key={repo.id} repo={repo} />
))}
</div>
) : contacts.length > 0 ? (
<Card className="border-dashed">
<CardContent className="py-12 px-8 text-center">
<div className="max-w-sm mx-auto space-y-4">
<p className="text-muted-foreground">
None of the people you follow have published repositories yet.
</p>
</div>
</CardContent>
</Card>
) : (
<Card className="border-dashed">
<CardContent className="py-12 px-8 text-center">
<div className="max-w-sm mx-auto space-y-4">
<p className="text-muted-foreground">
You're not following anyone yet. Follow people on Nostr to see their repositories here.
</p>
</div>
</CardContent>
</Card>
)}
</TabsContent>
</Tabs>
</div>
)}
</AppLayout> </AppLayout>
); );
} }
+35 -33
View File
@@ -32,6 +32,7 @@ import { Input } from '@/components/ui/input';
import { PasswordInput } from '@/components/ui/password-input'; import { PasswordInput } from '@/components/ui/password-input';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label';
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
import { Card, CardContent } from '@/components/ui/card';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { useDeploySettings } from '@/hooks/useDeploySettings'; import { useDeploySettings } from '@/hooks/useDeploySettings';
import { useNetlifyOAuth } from '@/hooks/useNetlifyOAuth'; import { useNetlifyOAuth } from '@/hooks/useNetlifyOAuth';
@@ -83,7 +84,6 @@ function SortableProviderItem({ provider, index, preset, onRemove, onUpdate, sho
ref={setNodeRef} ref={setNodeRef}
style={style} style={style}
value={String(index)} value={String(index)}
className="border rounded-lg"
> >
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
@@ -519,7 +519,7 @@ export function DeploySettings() {
{t('deploySettings')} {t('deploySettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('deploySettingsDescriptionLong')} {t('deploySettingsDescription')}
</p> </p>
</div> </div>
</div> </div>
@@ -532,7 +532,7 @@ export function DeploySettings() {
{t('deploySettings')} {t('deploySettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('deploySettingsDescriptionLong')} {t('deploySettingsDescription')}
</p> </p>
</div> </div>
)} )}
@@ -591,36 +591,37 @@ export function DeploySettings() {
const oauthError = oauthHook?.error ?? null; const oauthError = oauthHook?.error ?? null;
return ( return (
<div key={preset.id} className="border rounded-lg p-4 space-y-3"> <Card key={preset.id}>
<div className="flex items-center justify-between"> <CardContent className="p-4 space-y-3">
<div className="flex items-center gap-2"> <div className="flex items-center justify-between">
{(() => { <div className="flex items-center gap-2">
const url = getProviderUrl(preset); {(() => {
return url ? ( const url = getProviderUrl(preset);
<ExternalFavicon return url ? (
url={url} <ExternalFavicon
size={16} url={url}
fallback={<Rocket size={16} />} size={16}
/> fallback={<Rocket size={16} />}
) : ( />
<Rocket size={16} /> ) : (
); <Rocket size={16} />
})()} );
<h5 className="font-medium">{preset.name}</h5> })()}
<h5 className="font-medium">{preset.name}</h5>
</div>
{preset.apiKeyURL && !isOAuthConfigured && (
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.apiKeyURL, '_blank')}
>
{t('getApiKey')}
</button>
)}
</div> </div>
{preset.apiKeyURL && !isOAuthConfigured && ( <p className="text-sm text-muted-foreground">{preset.description}</p>
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.apiKeyURL, '_blank')}
>
{t('getApiKey')}
</button>
)}
</div>
<p className="text-sm text-muted-foreground">{preset.description}</p>
{showNostrLoginRequired ? ( {showNostrLoginRequired ? (
<div className="space-y-2"> <div className="space-y-2">
<p className="text-sm text-muted-foreground"> <p className="text-sm text-muted-foreground">
{t('loginToNostrRequired')} {t('loginToNostrRequired')}
@@ -724,7 +725,8 @@ export function DeploySettings() {
</div> </div>
</div> </div>
)} )}
</div> </CardContent>
</Card>
); );
})} })}
</div> </div>
@@ -734,7 +736,7 @@ export function DeploySettings() {
{/* Custom Provider */} {/* Custom Provider */}
<div className="space-y-3"> <div className="space-y-3">
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="custom-provider" className="border rounded-lg"> <AccordionItem value="custom-provider">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<h4 className="text-sm font-medium">{t('addCustomProvider')}</h4> <h4 className="text-sm font-medium">{t('addCustomProvider')}</h4>
</AccordionTrigger> </AccordionTrigger>
+29 -26
View File
@@ -6,6 +6,7 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label';
import { Badge } from '@/components/ui/badge'; import { Badge } from '@/components/ui/badge';
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
import { Card, CardContent } from '@/components/ui/card';
import { Switch } from '@/components/ui/switch'; import { Switch } from '@/components/ui/switch';
import { import {
DropdownMenu, DropdownMenu,
@@ -126,7 +127,7 @@ export function GitSettings() {
{t('gitSettings')} {t('gitSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('gitSettingsDescriptionLong')} {t('gitSettingsDescription')}
</p> </p>
</div> </div>
</div> </div>
@@ -139,7 +140,7 @@ export function GitSettings() {
{t('gitSettings')} {t('gitSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('gitSettingsDescriptionLong')} {t('gitSettingsDescription')}
</p> </p>
</div> </div>
)} )}
@@ -156,7 +157,7 @@ export function GitSettings() {
const isCustom = !preset; const isCustom = !preset;
return ( return (
<AccordionItem key={origin} value={origin} className="border rounded-lg"> <AccordionItem key={origin} value={origin}>
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<ExternalFavicon <ExternalFavicon
@@ -223,28 +224,29 @@ export function GitSettings() {
<h4 className="text-sm font-medium">{t('addProvider')}</h4> <h4 className="text-sm font-medium">{t('addProvider')}</h4>
<div className="grid grid-cols-1 md:grid-cols-2 gap-3"> <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
{availablePresets.map((preset) => ( {availablePresets.map((preset) => (
<div key={preset.id} className="border rounded-lg p-4 space-y-3"> <Card key={preset.id}>
<div className="flex items-center justify-between"> <CardContent className="p-4 space-y-3">
<div className="flex items-center gap-2"> <div className="flex items-center justify-between">
<ExternalFavicon <div className="flex items-center gap-2">
url={preset.origin} <ExternalFavicon
size={16} url={preset.origin}
fallback={<GitBranch size={16} />} size={16}
/> fallback={<GitBranch size={16} />}
<h5 className="font-medium">{preset.name}</h5> />
<h5 className="font-medium">{preset.name}</h5>
</div>
{preset.tokenURL && (preset.id !== 'github' || !isOAuthConfigured) && (
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.tokenURL, '_blank')}
>
{t('getToken')}
</button>
)}
</div> </div>
{preset.tokenURL && (preset.id !== 'github' || !isOAuthConfigured) && (
<button
type="button"
className="text-xs text-muted-foreground underline hover:text-foreground"
onClick={() => window.open(preset.tokenURL, '_blank')}
>
{t('getToken')}
</button>
)}
</div>
{preset.id === 'github' ? ( {preset.id === 'github' ? (
// Special rendering for GitHub - OAuth button if configured, otherwise token input // Special rendering for GitHub - OAuth button if configured, otherwise token input
isOAuthConfigured && !forceManualEntry[preset.id] ? ( isOAuthConfigured && !forceManualEntry[preset.id] ? (
<div className="space-y-3"> <div className="space-y-3">
@@ -349,7 +351,8 @@ export function GitSettings() {
</Button> </Button>
</div> </div>
)} )}
</div> </CardContent>
</Card>
))} ))}
</div> </div>
</div> </div>
@@ -358,7 +361,7 @@ export function GitSettings() {
{/* Custom Provider */} {/* Custom Provider */}
<div className="space-y-3"> <div className="space-y-3">
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="custom-provider" className="border rounded-lg"> <AccordionItem value="custom-provider">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<h4 className="text-sm font-medium">{t('addCustomProvider')}</h4> <h4 className="text-sm font-medium">{t('addCustomProvider')}</h4>
</AccordionTrigger> </AccordionTrigger>
@@ -419,7 +422,7 @@ export function GitSettings() {
{/* Git Identity */} {/* Git Identity */}
<div className="space-y-3"> <div className="space-y-3">
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="git-identity" className="border rounded-lg"> <AccordionItem value="git-identity">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<h4 className="text-sm font-medium">{t('gitIdentity')}</h4> <h4 className="text-sm font-medium">{t('gitIdentity')}</h4>
</AccordionTrigger> </AccordionTrigger>
+2 -2
View File
@@ -150,7 +150,7 @@ export function NostrSettings() {
{t('nostrSettings')} {t('nostrSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('nostrSettingsDescriptionLong')} {t('nostrSettingsDescription')}
</p> </p>
</div> </div>
</div> </div>
@@ -163,7 +163,7 @@ export function NostrSettings() {
{t('nostrSettings')} {t('nostrSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('nostrSettingsDescriptionLong')} {t('nostrSettingsDescription')}
</p> </p>
</div> </div>
)} )}
+2 -2
View File
@@ -199,7 +199,7 @@ export function ProjectView() {
onClick={() => setIsSidebarVisible(false)} onClick={() => setIsSidebarVisible(false)}
/> />
{/* Sidebar - positioned above the backdrop */} {/* Sidebar - positioned above the backdrop */}
<div className="relative left-0 top-0 h-full w-80 max-w-[80vw] bg-background border-r shadow-lg z-10"> <div className="relative left-0 top-0 h-full w-72 max-w-[80vw] bg-background border-r shadow-lg z-10">
<ProjectSidebar <ProjectSidebar
selectedProject={project} selectedProject={project}
onSelectProject={(selectedProject) => { onSelectProject={(selectedProject) => {
@@ -314,7 +314,7 @@ export function ProjectView() {
return ( return (
<div className="h-screen flex bg-background"> <div className="h-screen flex bg-background">
{/* Fixed Sidebar */} {/* Fixed Sidebar */}
<div className={`w-80 border-r bg-sidebar duration-300 ${isSidebarVisible ? 'block' : 'hidden'}`}> <div className={`w-72 border-r bg-sidebar duration-300 ${isSidebarVisible ? 'block' : 'hidden'}`}>
<ProjectSidebar <ProjectSidebar
selectedProject={project} selectedProject={project}
onSelectProject={(selectedProject) => { onSelectProject={(selectedProject) => {
+23 -27
View File
@@ -1,42 +1,38 @@
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useIsMobile } from '@/hooks/useIsMobile'; import { useIsMobile } from '@/hooks/useIsMobile';
import { getSettingsItems } from '@/lib/settingsItems'; import { getSettingsCategories } from '@/lib/settingsItems';
import { SettingsItemMobile } from '@/components/SettingsItemMobile';
export function Settings() { export function Settings() {
const { t } = useTranslation(); const { t } = useTranslation();
const navigate = useNavigate(); const navigate = useNavigate();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const settingsItems = getSettingsItems(t); const settingsCategories = getSettingsCategories(t);
if (isMobile) { if (isMobile) {
return ( return (
<div className="p-6 space-y-4"> <div className="p-4 space-y-8">
<div className="space-y-2"> {settingsCategories.map((category) => (
<h2 className="text-xl font-bold">{t('settings')}</h2> <div key={category.id}>
<p className="text-muted-foreground"> <h3 className="text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 px-2">
{t('settingsDescription')} {category.title}
</p> </h3>
</div> <div className="overflow-hidden rounded-xl border border-border shadow-sm">
<div className="space-y-3"> {category.items.map((item, index) => (
{settingsItems.map((item) => { <SettingsItemMobile
const Icon = item.icon; key={item.id}
return ( icon={item.icon}
<div title={item.title}
key={item.id} onClick={() => navigate(item.href)}
className="flex items-center gap-3 p-4 rounded-lg border hover:border-primary/20 hover:bg-primary/5 cursor-pointer transition-colors" isFirst={index === 0}
onClick={() => navigate(item.href)} isLast={index === category.items.length - 1}
> />
<Icon className="h-5 w-5 text-primary flex-shrink-0" /> ))}
<div className="flex-1 min-w-0"> </div>
<div className="font-medium">{item.title}</div> </div>
<div className="text-sm text-muted-foreground">{item.description}</div> ))}
</div>
</div>
);
})}
</div>
{import.meta.env.VERSION && ( {import.meta.env.VERSION && (
<div className="text-center text-xs text-muted-foreground/60 pt-4"> <div className="text-center text-xs text-muted-foreground/60 pt-4">
v{import.meta.env.VERSION} v{import.meta.env.VERSION}
+1 -1
View File
@@ -15,7 +15,7 @@ describe('StorageSettings', () => {
expect(screen.getByText('Storage')).toBeInTheDocument(); expect(screen.getByText('Storage')).toBeInTheDocument();
// Check for description // Check for description
expect(screen.getByText('Export files and manage local data.')).toBeInTheDocument(); expect(screen.getByText('Export files and manage local data')).toBeInTheDocument();
// Check for Persist Data section // Check for Persist Data section
expect(screen.getByText('Persist Data')).toBeInTheDocument(); expect(screen.getByText('Persist Data')).toBeInTheDocument();
+2 -2
View File
@@ -288,7 +288,7 @@ export function StorageSettings() {
{t('storageSettings')} {t('storageSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('dataSettingsDescriptionLong')} {t('storageSettingsDescription')}
</p> </p>
</div> </div>
</div> </div>
@@ -301,7 +301,7 @@ export function StorageSettings() {
{t('storageSettings')} {t('storageSettings')}
</h1> </h1>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
{t('dataSettingsDescriptionLong')} {t('storageSettingsDescription')}
</p> </p>
</div> </div>
)} )}
+11 -11
View File
@@ -308,7 +308,7 @@ export function SystemSettings() {
<div className="space-y-3 max-w-xl"> <div className="space-y-3 max-w-xl">
{/* Service Worker Configuration */} {/* Service Worker Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="service-worker" className="border rounded-lg"> <AccordionItem value="service-worker">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<h4 className="text-sm font-medium">{t('serviceWorker')}</h4> <h4 className="text-sm font-medium">{t('serviceWorker')}</h4>
</AccordionTrigger> </AccordionTrigger>
@@ -411,7 +411,7 @@ export function SystemSettings() {
{/* Project Template Configuration */} {/* Project Template Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="project-template" className="border rounded-lg"> <AccordionItem value="project-template">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('projectTemplate')}</h4> <h4 className="text-sm font-medium">{t('projectTemplate')}</h4>
@@ -459,7 +459,7 @@ export function SystemSettings() {
{/* CORS Proxy Configuration */} {/* CORS Proxy Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="cors-proxy" className="border rounded-lg"> <AccordionItem value="cors-proxy">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('corsProxy')}</h4> <h4 className="text-sm font-medium">{t('corsProxy')}</h4>
@@ -507,7 +507,7 @@ export function SystemSettings() {
{/* Favicon URL Configuration */} {/* Favicon URL Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="favicon-url" className="border rounded-lg"> <AccordionItem value="favicon-url">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('faviconUrl')}</h4> <h4 className="text-sm font-medium">{t('faviconUrl')}</h4>
@@ -555,7 +555,7 @@ export function SystemSettings() {
{/* JavaScript CDN Configuration */} {/* JavaScript CDN Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="esm-url" className="border rounded-lg"> <AccordionItem value="esm-url">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('esmUrl')}</h4> <h4 className="text-sm font-medium">{t('esmUrl')}</h4>
@@ -604,7 +604,7 @@ export function SystemSettings() {
{/* Preview Domain Configuration */} {/* Preview Domain Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="preview-domain" className="border rounded-lg"> <AccordionItem value="preview-domain">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('previewDomain')}</h4> <h4 className="text-sm font-medium">{t('previewDomain')}</h4>
@@ -652,7 +652,7 @@ export function SystemSettings() {
{/* Showcase Configuration */} {/* Showcase Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="showcase" className="border rounded-lg"> <AccordionItem value="showcase">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('showcase')}</h4> <h4 className="text-sm font-medium">{t('showcase')}</h4>
@@ -746,7 +746,7 @@ export function SystemSettings() {
{/* Sentry DSN Configuration */} {/* Sentry DSN Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="sentry-dsn" className="border rounded-lg"> <AccordionItem value="sentry-dsn">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('sentryDsn')}</h4> <h4 className="text-sm font-medium">{t('sentryDsn')}</h4>
@@ -794,7 +794,7 @@ export function SystemSettings() {
{/* Filesystem Paths Configuration */} {/* Filesystem Paths Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="filesystem-paths" className="border rounded-lg"> <AccordionItem value="filesystem-paths">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('filesystemPaths')}</h4> <h4 className="text-sm font-medium">{t('filesystemPaths')}</h4>
@@ -1016,7 +1016,7 @@ export function SystemSettings() {
{/* System Prompt Configuration */} {/* System Prompt Configuration */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="system-prompt" className="border rounded-lg"> <AccordionItem value="system-prompt">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('systemPrompt')}</h4> <h4 className="text-sm font-medium">{t('systemPrompt')}</h4>
@@ -1063,7 +1063,7 @@ export function SystemSettings() {
{/* Terminal */} {/* Terminal */}
<Accordion type="single" collapsible className="w-full"> <Accordion type="single" collapsible className="w-full">
<AccordionItem value="terminal" className="border rounded-lg"> <AccordionItem value="terminal">
<AccordionTrigger className="px-4 py-3 hover:no-underline"> <AccordionTrigger className="px-4 py-3 hover:no-underline">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<h4 className="text-sm font-medium">{t('terminal')}</h4> <h4 className="text-sm font-medium">{t('terminal')}</h4>
+2 -1
View File
@@ -81,7 +81,8 @@ export default {
borderRadius: { borderRadius: {
lg: 'var(--radius)', lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)', md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)' sm: 'calc(var(--radius) - 4px)',
xs: '2px'
}, },
keyframes: { keyframes: {
'accordion-down': { 'accordion-down': {