Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
Update BestOfNEvalsPage.tsx
Abi Raja02d12598984e
diff --git a/frontend/src/components/evals/BestOfNEvalsPage.tsx b/frontend/src/components/evals/BestOfNEvalsPage.tsxindex e11d7f9a..e4a269dd 100644--- a/frontend/src/components/evals/BestOfNEvalsPage.tsx+++ b/frontend/src/components/evals/BestOfNEvalsPage.tsx@@ -306,7 +306,7 @@ function BestOfNEvalsPage() {return (<div className="mx-auto"><EvalNavigation />- <div className="w-full py-4 bg-gradient-to-b from-gray-900 to-gray-800 text-white border-b border-gray-700">+ <div className="w-full py-2 bg-gradient-to-b from-gray-900 to-gray-800 text-white border-b border-gray-700">{evals.length === 0 ? (/* Setup Section */<div className="flex flex-col gap-4 max-w-5xl mx-auto px-6">@@ -407,8 +407,8 @@ function BestOfNEvalsPage() {</div>) : (/* Comparison Header */- <div className="max-w-7xl mx-auto px-6">- <div className="flex flex-wrap items-center justify-between gap-4">+ <div className="max-w-7xl mx-auto px-4">+ <div className="flex flex-wrap items-center justify-between gap-3">{/* Left: Navigation */}<div className="flex items-center gap-2"><button@@ -419,7 +419,7 @@ function BestOfNEvalsPage() {setCurrentComparisonIndex(0);setCurrentModelIndex(0);}}- className="bg-gray-700 hover:bg-gray-600 text-white px-3 py-1.5 rounded-lg text-sm transition-colors"+ className="bg-gray-700 hover:bg-gray-600 text-white px-2.5 py-1 rounded-lg text-sm transition-colors"title="Back to setup"><svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">@@ -431,7 +431,7 @@ function BestOfNEvalsPage() {<buttononClick={goToPrevious}disabled={currentComparisonIndex === 0}- className="px-3 py-1.5 rounded-l-lg hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"+ className="px-2.5 py-1 rounded-l-lg hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"title="Previous comparison (↑)"><svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">@@ -442,7 +442,7 @@ function BestOfNEvalsPage() {<selectvalue={currentComparisonIndex}onChange={(e) => goToComparison(parseInt(e.target.value))}- className="bg-transparent text-white px-4 py-1.5 text-sm font-medium focus:outline-none appearance-none cursor-pointer"+ className="bg-transparent text-white px-3 py-1 text-sm font-medium focus:outline-none appearance-none cursor-pointer">{evals.map((_, index) => (<option key={index} value={index} className="bg-gray-800">@@ -454,7 +454,7 @@ function BestOfNEvalsPage() {<buttononClick={goToNext}disabled={currentComparisonIndex === evals.length - 1}- className="px-3 py-1.5 rounded-r-lg hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"+ className="px-2.5 py-1 rounded-r-lg hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"title="Next comparison (↓)"><svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">@@ -469,10 +469,10 @@ function BestOfNEvalsPage() {</div>{/* Center: Progress and Results */}- <div className="flex items-center gap-4">- <div className="flex items-center gap-3 bg-gray-700/50 px-4 py-2 rounded-lg">+ <div className="flex items-center gap-3">+ <div className="flex items-center gap-2 bg-gray-700/50 px-3 py-1 rounded-lg"><span className="text-xs text-gray-400 font-medium">Progress</span>- <div className="w-32 h-2 bg-gray-600 rounded-full overflow-hidden">+ <div className="w-24 h-1.5 bg-gray-600 rounded-full overflow-hidden"><divclassName="h-full bg-gradient-to-r from-blue-500 to-blue-400 transition-all duration-500 ease-out"style={{ width: `${Math.round((stats.totalVotes / evals.length) * 100)}%` }}@@ -485,7 +485,7 @@ function BestOfNEvalsPage() {<buttononClick={() => setShowResults(!showResults)}- className="flex items-center gap-2 px-3 py-1.5 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm text-gray-200 transition-colors"+ className="flex items-center gap-1.5 px-2.5 py-1 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm text-gray-200 transition-colors"><svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />@@ -498,11 +498,11 @@ function BestOfNEvalsPage() {{showResults && (<div className="bg-gray-800 rounded overflow-hidden">- <div className="flex items-center justify-between p-2 bg-gray-700">+ <div className="flex items-center justify-between px-2 py-1 bg-gray-700"><span className="text-xs text-gray-300 font-semibold">Results</span><buttononClick={copyResultsAsCSV}- className="text-xs px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded"+ className="text-xs px-2 py-0.5 bg-blue-600 hover:bg-blue-700 text-white rounded">Copy CSV</button>@@ -538,7 +538,7 @@ function BestOfNEvalsPage() {{/* Right: Quick help */}<div className="text-xs text-gray-400">- ↑ ↓ navigate | ← → Tab switch models | 1-{folderNames.length} vote | T tie+ ↑↓ nav | ←→ switch | 1-{folderNames.length} vote | T tie</div></div></div>@@ -548,19 +548,19 @@ function BestOfNEvalsPage() {{/* Single Comparison View */}{currentEval && (<div className="bg-gray-50 min-h-screen">- <div className="flex gap-6 p-6 max-w-full">+ <div className="flex gap-4 p-3 max-w-full">{/* Fixed Reference Image */}<div className="flex-shrink-0 w-[420px]"><div className="bg-white rounded-xl shadow-lg overflow-hidden">- <div className="bg-gray-100 text-gray-700 px-4 py-3 border-b border-gray-200">- <h3 className="font-semibold text-sm flex items-center gap-2">+ <div className="bg-gray-100 text-gray-700 px-3 py-2 border-b border-gray-200">+ <h3 className="font-semibold text-sm flex items-center gap-1.5"><svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>Reference Image</h3></div>- <div className="w-full h-[600px] flex items-center justify-center bg-gray-50 p-4">+ <div className="w-full h-[600px] flex items-center justify-center bg-gray-50 p-3"><imgsrc={currentEval.input}alt={`Input for comparison ${currentComparisonIndex + 1}`}