diff --git a/src/pages/bulk-eval/[id].astro b/src/pages/bulk-eval/[id].astro index 4e48f79..0f3d7d0 100644 --- a/src/pages/bulk-eval/[id].astro +++ b/src/pages/bulk-eval/[id].astro @@ -611,6 +611,7 @@ if (notFound || !initialData) { ` ) .join('')} + Actions @@ -672,7 +673,18 @@ if (notFound || !initialData) { `; }) .join('')} - + + + + ` ) .join('')} @@ -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); + } + }); + }); } /** @@ -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;