diff --git a/api/handlers.go b/api/handlers.go index 2b84447..65c8f18 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -1643,13 +1643,8 @@ func (h *Handlers) RescrapeOrg(w http.ResponseWriter, r *http.Request) { return } - const maxPeople = 20 - truncated := false people := scraped.People - if len(people) > maxPeople { - people = people[:maxPeople] - truncated = true - } + truncated := false // no hard cap — return all found // Diff: existing members keyed by email (lowercased) or name type MemberStatus struct { @@ -1704,7 +1699,7 @@ func (h *Handlers) RescrapeOrg(w http.ResponseWriter, r *http.Request) { "new_people": newPeople, "not_found": notFound, "truncated": truncated, - "total_found": len(scraped.People), + "total_found": len(people), }) } diff --git a/portal/templates/app/orgs.html b/portal/templates/app/orgs.html index 9cc1c51..239af96 100644 --- a/portal/templates/app/orgs.html +++ b/portal/templates/app/orgs.html @@ -386,12 +386,10 @@ let title = ''; if (newPeople.length > 0) title = newPeople.length + ' new person' + (newPeople.length !== 1 ? 's' : '') + ' found on website'; else title = 'No new people found'; - if (truncated) title += ' (showing first 20 of ' + total + ' — rescrape again for more)'; + document.getElementById('rescrapeTitle').textContent = title; let html = ''; - if (truncated) { - html += '
⚠️ Only the first 20 results were pulled. You can rescrape again to get additional people.
'; - } + if (newPeople.length > 0) { html += '⚠️ These people are in your database but not found on the website — possibly inactive:
⚠️ ' + notFound.length + ' person' + (notFound.length !== 1 ? 's' : '') + ' in your database not found on the website:
' + + 'They may have left the organization. Review and remove individually if confirmed.
' + + 'Everyone in your database was found on the website. No suggestions.
'; document.getElementById('rescrapeContent').innerHTML = html; @@ -438,6 +445,26 @@ const sa = document.getElementById('rescrapeSelectAll'); if (sa) sa.checked = all.length > 0 && checked.length === all.length; } + function confirmRemoveInactive(idx) { + const people = window._rescrapeNotFound || []; + const p = people[idx]; + if (!p) return; + const name = p.name || p.email || 'this person'; + if (!confirm('Remove ' + name + ' from the organization? This cannot be undone.')) return; + // Remove from editingMembers by matching email or name + editingMembers = editingMembers.filter(m => { + if (p.email && m.email && m.email.toLowerCase() === p.email.toLowerCase()) return false; + if (p.name && m.name && m.name.toLowerCase() === p.name.toLowerCase()) return false; + return true; + }); + // Remove from notFound list and re-render + window._rescrapeNotFound = people.filter((_, i) => i !== idx); + renderMemberList(); + // Re-render the not-found section + const nfEl = document.querySelector('#rescrapeContent .border-t'); + if (window._rescrapeNotFound.length === 0 && nfEl) nfEl.remove(); + } + function addRescrapeSelected() { const people = window._rescrapeNewPeople || []; const checked = document.querySelectorAll('.rescrape-cb:checked');