Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions async-code-web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { SupabaseService } from "@/lib/supabase-service";
import { Project, Task } from "@/types";
import { ClaudeIcon } from "@/components/icon/claude";
import { OpenAIIcon } from "@/components/icon/openai";
import { toast } from "sonner";

interface TaskWithProject extends Task {
project?: Project
Expand Down Expand Up @@ -135,12 +136,12 @@ export default function Home() {

const handleStartTask = async () => {
if (!prompt.trim() || !githubToken.trim()) {
alert('Please provide both a prompt and GitHub token');
toast.error('Please provide both a prompt and GitHub token');
return;
}

if (!user?.id) {
alert('User not authenticated');
toast.error('User not authenticated');
return;
}

Expand All @@ -155,7 +156,7 @@ export default function Home() {
}
} else {
// Custom repo URL - would need an input field for this
alert('Custom repo URL input not implemented yet. Please select a project or create one first.');
toast.error('Custom repo URL input not implemented yet. Please select a project or create one first.');
return;
}

Expand Down Expand Up @@ -196,7 +197,7 @@ export default function Home() {
setShowNotification(true);
setTimeout(() => setShowNotification(false), 5000);
} catch (error) {
alert(`Error starting task: ${error}`);
toast.error(`Error starting task: ${error}`);
} finally {
setIsLoading(false);
}
Expand Down
5 changes: 3 additions & 2 deletions async-code-web/app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ProtectedRoute } from "@/components/protected-route";
import { useAuth } from "@/contexts/auth-context";
import { ApiService } from "@/lib/api-service";
import { Project } from "@/types";
import { toast } from "sonner";

interface ProjectWithStats extends Project {
task_count?: number
Expand Down Expand Up @@ -68,7 +69,7 @@ export default function ProjectsPage() {
loadProjects();
} catch (error) {
console.error('Error creating project:', error);
alert('Error creating project. Please check the GitHub URL format.');
toast.error('Error creating project. Please check the GitHub URL format.');
}
};

Expand All @@ -84,7 +85,7 @@ export default function ProjectsPage() {
loadProjects();
} catch (error) {
console.error('Error deleting project:', error);
alert('Error deleting project');
toast.error('Error deleting project');
}
};

Expand Down
11 changes: 6 additions & 5 deletions async-code-web/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { toast } from "sonner";

import Link from "next/link";

Expand Down Expand Up @@ -42,7 +43,7 @@ export default function SettingsPage() {

const handleValidateToken = async () => {
if (!githubToken.trim() || !repoUrl.trim()) {
alert('Please provide both GitHub token and repository URL');
toast.error('Please provide both GitHub token and repository URL');
return;
}

Expand Down Expand Up @@ -74,15 +75,15 @@ export default function SettingsPage() {
].join('\n');

if (permissions.create_branches) {
alert(`✅ Token is fully valid for PR creation!\n\n${permissionSummary}`);
toast.success(`✅ Token is fully valid for PR creation!\n\n${permissionSummary}`);
} else {
alert(`⚠️ Token validation partial success!\n\n${permissionSummary}\n\n❌ Cannot create branches - this will prevent PR creation.\nPlease ensure your token has 'repo' scope (not just 'public_repo').`);
toast.warning(`⚠️ Token validation partial success!\n\n${permissionSummary}\n\n❌ Cannot create branches - this will prevent PR creation.\nPlease ensure your token has 'repo' scope (not just 'public_repo').`);
}
} else {
alert(`❌ Token validation failed: ${data.error}`);
toast.error(`❌ Token validation failed: ${data.error}`);
}
} catch (error) {
alert(`Error validating token: ${error}`);
toast.error(`Error validating token: ${error}`);
setTokenValidation({ status: 'error', error: String(error) });
} finally {
setIsValidatingToken(false);
Expand Down