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
40 changes: 39 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from "react-router-dom";
import { AppHeader } from "./components/AppHeader";
import { AssessmentPage } from "./components/AssessmentPage";
import { BatchStatusPage } from "./components/BatchStatusPage";
import { CostAnalysisPanel } from "./components/CostAnalysisPanel";
import { EmptyState } from "./components/EmptyState";
import { EvaluationInputPanel } from "./components/EvaluationInputPanel";
Expand Down Expand Up @@ -653,6 +654,39 @@ function AppContent() {
[api, navigate],
);

// Handle batch URL submission
const handleBatchSubmit = useCallback(
async (
urls: string[],
_evaluators: number,
provider?: "claude" | "opencode" | "cursor" | "github-copilot",
evaluatorFilter?: EvaluatorFilter,
concurrency?: number,
selectedEvaluators?: string[],
) => {
setApiError(null);
try {
const response = await api.submitBatch(
urls,
undefined,
provider,
evaluatorFilter,
undefined,
concurrency,
selectedEvaluators,
);
navigate(`/batch/${response.batchId}`);
} catch (error) {
setApiError(
error instanceof Error
? error.message
: "Failed to submit batch evaluation",
);
}
},
[api, navigate],
);

// Handle job cancellation
const handleCancelJob = useCallback(async () => {
if (currentJobId) {
Expand Down Expand Up @@ -1776,6 +1810,7 @@ function AppContent() {
<div className="max-w-2xl mx-auto">
<EvaluationInputPanel
onUrlSubmit={handleUrlSubmit}
onBatchSubmit={!cloudMode ? handleBatchSubmit : undefined}
isLoading={api.isLoading}
urlError={apiError}
hasData={false}
Expand Down Expand Up @@ -1868,7 +1903,7 @@ function App() {

// Routes component with feature flag access
function AppRoutes() {
const { assessmentEnabled } = useFeatureFlags();
const { assessmentEnabled, cloudMode } = useFeatureFlags();

return (
<Routes>
Expand All @@ -1881,6 +1916,9 @@ function AppRoutes() {
{assessmentEnabled && (
<Route path="/assessment" element={<AssessmentPage />} />
)}
{!cloudMode && (
<Route path="/batch/:batchId" element={<BatchStatusPage />} />
)}
</Routes>
);
}
Expand Down
Loading