Add scrutiny warnings to tool detail modal

Shows warnings at the top of the detail view with:
- Yellow warning styling
- Check name, message, and suggestion
- Warning icon for visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2026-01-16 15:25:40 -04:00
parent 807a0e28a5
commit b0bd692be5
1 changed files with 30 additions and 0 deletions

View File

@ -153,6 +153,12 @@
<div class="p-6 overflow-y-auto flex-grow">
<div id="detail-loading" class="py-8 text-center text-gray-500">Loading...</div>
<div id="detail-content" class="hidden">
<!-- Scrutiny Warnings -->
<div id="detail-warnings-section" class="mb-6 hidden">
<h4 class="text-sm font-medium text-gray-700 mb-2">Scrutiny Warnings</h4>
<div id="detail-warnings" class="space-y-2"></div>
</div>
<!-- Description -->
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-2">Description</h4>
@ -233,6 +239,30 @@ async function viewTool(toolId) {
// Update title
document.getElementById('detail-title').textContent = `${tool.owner}/${tool.name} v${tool.version}`;
// Scrutiny Warnings
const warningsSection = document.getElementById('detail-warnings-section');
const warningsDiv = document.getElementById('detail-warnings');
const warnings = tool.scrutiny_report?.findings?.filter(f => f.result === 'warning') || [];
if (warnings.length > 0) {
warningsSection.classList.remove('hidden');
warningsDiv.innerHTML = warnings.map(w => `
<div class="p-3 rounded-md bg-yellow-50 border border-yellow-200">
<div class="flex items-start">
<svg class="w-5 h-5 text-yellow-600 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
<div>
<div class="text-sm font-medium text-yellow-800">${escapeHtml(w.check || 'Warning')}</div>
<div class="text-sm text-yellow-700">${escapeHtml(w.message || '')}</div>
${w.suggestion ? `<div class="text-xs text-yellow-600 mt-1 italic">${escapeHtml(w.suggestion)}</div>` : ''}
</div>
</div>
</div>
`).join('');
} else {
warningsSection.classList.add('hidden');
}
// Description
document.getElementById('detail-description').textContent = tool.description || 'No description';