Skip to content
Merged
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
38 changes: 37 additions & 1 deletion src/pages/bulk-eval/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ if (notFound || !initialData) {
`
)
.join('')}
<th class="w-20 text-center">Actions</th>
</tr>
</thead>
<tbody id="results-body">
Expand Down Expand Up @@ -672,7 +673,18 @@ if (notFound || !initialData) {
`;
})
.join('')}
</tr>
<td class="px-2 py-1 text-center">
<button
class="btn btn-ghost btn-xs btn-circle view-details-btn"
data-row-index="${row.index}"
title="View all model outputs for this row"
>
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</button>
</td>
</tr>
`
)
.join('')}
Expand All @@ -688,6 +700,18 @@ if (notFound || !initialData) {
// Add row click handlers
const resultsBody = document.getElementById('results-body');
resultsBody?.addEventListener('click', handleRowClick);

// Add click handlers to view details buttons
const viewDetailsBtns = document.querySelectorAll('.view-details-btn');
viewDetailsBtns.forEach((btn) => {
btn.addEventListener('click', (e) => {
e.stopPropagation();
const rowIndex = parseInt((btn as HTMLElement).getAttribute('data-row-index') || '-1');
if (rowIndex >= 0 && currentData) {
showRowDetails(rowIndex);
}
});
});
}

/**
Expand All @@ -701,6 +725,18 @@ if (notFound || !initialData) {
const rowIndex = parseInt(row.getAttribute('data-row-index') || '-1');
if (rowIndex < 0) return;

// Don't trigger if clicking on the view details button
if (target.closest('.view-details-btn')) return;

showRowDetails(rowIndex);
}

/**
* Show row details for a given row index
*/
function showRowDetails(rowIndex: number): void {
if (!currentData) return;

// Get the row data
const rowData = currentData.rows[rowIndex];
if (!rowData) return;
Expand Down
Loading