Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Update BestOfNEvalsPage.tsx

Abi Raja78f5712aef43
diff --git a/frontend/src/components/evals/BestOfNEvalsPage.tsx b/frontend/src/components/evals/BestOfNEvalsPage.tsx
index 28f45a10..5c0354df 100644
--- a/frontend/src/components/evals/BestOfNEvalsPage.tsx
+++ b/frontend/src/components/evals/BestOfNEvalsPage.tsx
@@ -274,6 +274,7 @@ function BestOfNEvalsPage() {
return `${days}d ago`;
}
};
+
// Copy results as CSV to clipboard
const copyResultsAsCSV = async () => {
@@ -330,39 +331,56 @@ function BestOfNEvalsPage() {
Refresh
</button>
</div>
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
+ <div className="space-y-3">
{folderPaths.map((path, index) => (
- <div key={index} className="flex gap-2">
- <select
- value={path}
- onChange={(e) => updateFolderPath(index, e.target.value)}
- className="flex-1 px-4 py-2 rounded-lg bg-gray-700 text-white border border-gray-600 focus:border-blue-500 focus:outline-none transition-colors text-sm"
- >
- <option value="">Select a folder...</option>
- {availableFolders.map((folder) => (
- <option key={folder.path} value={folder.path}>
- {folder.name} ({formatTimeAgo(folder.modified_time)})
- </option>
- ))}
- </select>
- {index > 0 && (
- <button
- onClick={() => removeFolderInput(index)}
- className="bg-red-500 hover:bg-red-600 px-3 py-2 rounded-lg transition-colors"
- title="Remove model"
- >
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
- </svg>
- </button>
+ <div key={index} className="relative">
+ <div className="flex items-center gap-2">
+ <span className="text-sm text-gray-400 font-medium w-16">Model {index + 1}</span>
+ <div className="flex-1 relative">
+ <select
+ value={path}
+ onChange={(e) => updateFolderPath(index, e.target.value)}
+ className="w-full px-4 py-3 pr-10 rounded-lg bg-gray-700 text-white border border-gray-600 focus:border-blue-500 focus:outline-none transition-colors text-sm appearance-none cursor-pointer"
+ >
+ <option value="">Select a folder...</option>
+ {availableFolders.map((folder) => (
+ <option key={folder.path} value={folder.path} title={folder.name}>
+ {folder.name}
+ </option>
+ ))}
+ </select>
+ <div className="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
+ <svg className="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
+ </svg>
+ </div>
+ </div>
+ {index > 0 && (
+ <button
+ onClick={() => removeFolderInput(index)}
+ className="bg-red-500 hover:bg-red-600 px-3 py-3 rounded-lg transition-colors"
+ title="Remove model"
+ >
+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
+ </svg>
+ </button>
+ )}
+ </div>
+ {path && (
+ <div className="mt-1 ml-20">
+ <span className="text-xs text-gray-500">
+ {availableFolders.find(f => f.path === path)?.name} • {formatTimeAgo(availableFolders.find(f => f.path === path)?.modified_time || 0)}
+ </span>
+ </div>
)}
</div>
))}
</div>
- <div className="flex gap-3 justify-center mt-2">
+ <div className="flex gap-3 justify-center mt-6">
<button
onClick={addFolderInput}
- className="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center gap-2"
+ className="bg-gray-600 hover:bg-gray-700 text-white px-5 py-2.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-2"
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
@@ -371,8 +389,8 @@ function BestOfNEvalsPage() {
</button>
<button
onClick={loadEvals}
- disabled={isLoading}
- className="bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors flex items-center gap-2"
+ disabled={isLoading || folderPaths.some(p => !p)}
+ className="bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white px-8 py-2.5 rounded-lg text-sm font-medium transition-colors flex items-center gap-2"
>
{isLoading ? (
<>