feat: add page text snippet and Brave description to discovery UI
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Show Brave search description under company name and scraped page text snippet (first 500 chars) as expandable row below each candidate, helping admin verify if the URL matches the company. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3340e176aa
commit
b1737defa9
@ -233,7 +233,8 @@ def admin_data_quality():
|
||||
'url': dc.candidate_url,
|
||||
'domain': dc.candidate_domain or '',
|
||||
'title': dc.brave_title or '',
|
||||
'description': (dc.brave_description or '')[:100],
|
||||
'brave_description': (dc.brave_description or '')[:120],
|
||||
'snippet': (dc.page_text_snippet or '')[:500],
|
||||
'match_nip': dc.match_nip,
|
||||
'match_regon': dc.match_regon,
|
||||
'match_krs': dc.match_krs,
|
||||
|
||||
@ -474,6 +474,28 @@
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.disc-snippet-row td {
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.disc-snippet {
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
background: var(--background);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
border-radius: var(--radius);
|
||||
line-height: 1.4;
|
||||
max-height: 60px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition: max-height 0.3s;
|
||||
}
|
||||
|
||||
.disc-snippet.expanded {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.dq-bar-label { width: 100px; font-size: var(--font-size-xs); }
|
||||
@ -658,11 +680,14 @@
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="{{ url_for('admin.admin_company_detail', company_id=d.company_id) }}" class="dq-company-link">{{ d.company_name }}</a>
|
||||
{% if d.brave_description %}
|
||||
<br><span style="font-size: var(--font-size-xs); color: var(--text-secondary);">{{ d.brave_description }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ d.url }}" target="_blank" style="color: var(--primary); text-decoration: none; font-weight: 500;">{{ d.domain }}</a>
|
||||
{% if d.title %}
|
||||
<br><span style="font-size: var(--font-size-xs); color: var(--text-secondary);">{{ d.title[:60] }}</span>
|
||||
<br><span style="font-size: var(--font-size-xs); color: var(--text-secondary);">{{ d.title[:80] }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
@ -701,6 +726,14 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% if d.snippet %}
|
||||
<tr class="disc-snippet-row" style="border-left: 3px solid {% if d.confidence == 'high' %}#22c55e{% elif d.confidence == 'medium' %}#f59e0b{% else %}#d1d5db{% endif %};">
|
||||
<td></td>
|
||||
<td colspan="4" style="padding-top: 0;">
|
||||
<div class="disc-snippet">{{ d.snippet }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1260,6 +1293,13 @@
|
||||
document.getElementById('discoveryModal').style.display = 'none';
|
||||
}
|
||||
|
||||
// Toggle snippet expansion
|
||||
document.querySelectorAll('.disc-snippet').forEach(function(el) {
|
||||
el.addEventListener('click', function() {
|
||||
this.classList.toggle('expanded');
|
||||
});
|
||||
});
|
||||
|
||||
function acceptDiscovery(candidateId, rowId) {
|
||||
var csrf = document.querySelector('meta[name=csrf-token]')?.content || '';
|
||||
fetch('/admin/discovery/' + candidateId + '/accept', {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user