05/24 Enhance functionalities
This commit is contained in:
@@ -113,7 +113,16 @@
|
||||
|
||||
<!-- History card -->
|
||||
<div class="card mt-2">
|
||||
<div class="card-header"><span class="card-title">Analysis History</span></div>
|
||||
<div class="card-header">
|
||||
<span class="card-title">Analysis History</span>
|
||||
<div class="flex gap-1" style="flex-wrap:wrap">
|
||||
<button class="ai-hist-filter active" data-verdict="">All</button>
|
||||
<button class="ai-hist-filter" data-verdict="PURSUE">PURSUE</button>
|
||||
<button class="ai-hist-filter" data-verdict="PASS">PASS</button>
|
||||
<button class="ai-hist-filter" data-verdict="UNCLEAR">UNCLEAR</button>
|
||||
<button class="ai-hist-filter" data-verdict="none">No verdict</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
@@ -484,6 +493,22 @@ function deleteAnalysis() {
|
||||
.catch(function() { alert('Delete failed. Please try again.'); });
|
||||
}
|
||||
|
||||
/* ─── History verdict filter ────────────────────────────────── */
|
||||
document.querySelectorAll('.ai-hist-filter').forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
document.querySelectorAll('.ai-hist-filter').forEach(function(b) { b.classList.remove('active'); });
|
||||
btn.classList.add('active');
|
||||
var verdict = btn.dataset.verdict;
|
||||
document.querySelectorAll('.history-row').forEach(function(row) {
|
||||
if (!verdict) { row.style.display = ''; return; }
|
||||
var badge = row.querySelector('.badge');
|
||||
var rowVerdict = badge ? badge.textContent.trim() : '';
|
||||
var show = verdict === 'none' ? !badge : rowVerdict === verdict;
|
||||
row.style.display = show ? '' : 'none';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/* ─── Utility ───────────────────────────────────────────────── */
|
||||
function escHtml(str) {
|
||||
return String(str || '').replace(/[&<>"']/g, function(c) {
|
||||
@@ -577,6 +602,13 @@ function escHtml(str) {
|
||||
|
||||
/* ── History ───────────────────────────────────────────────── */
|
||||
.history-row:hover td{background:var(--bg-subtle)}
|
||||
.ai-hist-filter{
|
||||
background:none;border:1px solid var(--border);
|
||||
padding:.2rem .55rem;font-size:.72rem;border-radius:var(--r-sm);
|
||||
cursor:pointer;color:var(--text-secondary);font-family:inherit;
|
||||
transition:background var(--t),color var(--t);
|
||||
}
|
||||
.ai-hist-filter.active{background:var(--accent);border-color:var(--accent);color:#fff}
|
||||
|
||||
@media(max-width:960px){
|
||||
.ai-layout{grid-template-columns:1fr}
|
||||
|
||||
Reference in New Issue
Block a user