diff --git a/corvid/templates/tickets_base.html b/corvid/templates/tickets_base.html index c86d6f1..3f32088 100644 --- a/corvid/templates/tickets_base.html +++ b/corvid/templates/tickets_base.html @@ -701,14 +701,15 @@ async function loadTickets() { function renderTicketRow(t) { const visibleChildIds = (t.child_ids || []).filter(cid => tickets.some(c => c.id === cid)); - const childCount = visibleChildIds.length; + const totalChildCount = (t.child_ids || []).length; + const visibleCount = visibleChildIds.length; const expanded = expandedParents.has(t.id); return `
${t.human_id} ${escHtml(t.title)} - ${childCount ? `${childCount}` : ''} + ${totalChildCount ? `${visibleCount ? `` : ''}${totalChildCount}` : ''}
${typeBadge(t.type)} @@ -783,9 +784,19 @@ function showDetail(id) { childList.innerHTML = t.child_ids.map(cid => { const child = tickets.find(c => c.id === cid); const label = child ? `${child.human_id} ${escHtml(child.title)}` : `#${cid}`; - return `${label}`; + return `${label}`; }).join(''); childWrap.style.display = ''; + // Fetch any children that aren't in the current filtered ticket list + t.child_ids.forEach(async cid => { + if (!tickets.find(c => c.id === cid)) { + try { + const child = await api(`/api/tickets/${cid}`); + const el = document.getElementById(`child-ref-${cid}`); + if (el) el.textContent = `${child.human_id} ${child.title}`; + } catch(e) { /* keep fallback label */ } + } + }); } else { childWrap.style.display = 'none'; }