(taskId, immediatePush = null, userId = currentUser(), pollToken = state.dailyPollToken)
| 2349 | |
| 2350 | function renderPush(push, options = {}) { |
| 2351 | state.push = push; |
| 2352 | state.selected.clear(); |
| 2353 | state.skipped.clear(); |
| 2354 | state.later.clear(); |
| 2355 | const papers = push?.papers || []; |
| 2356 | const metadata = push?.metadata || {}; |
| 2357 | $("candidateStat").textContent = metadata.total_fetched ?? metadata.fetched_count ?? papers.length ?? 0; |
| 2358 | $("filteredStat").textContent = metadata.paper_count ?? metadata.filtered_count ?? metadata.ranked_count ?? papers.length ?? 0; |
| 2359 | $("latestPushStat").textContent = papers.length || "-"; |
| 2360 | $("readingQueueStat").textContent = "0"; |
| 2361 | $("pushMeta").textContent = pushMetaText(push, papers, metadata, options); |
| 2362 | if (!papers.length) { |
| 2363 | $("paperList").className = "paper-list empty"; |
| 2364 | $("paperList").textContent = ui().papers.noRecommendations; |
| 2365 | updateSelectionSummary(); |
| 2366 | return; |
| 2367 | } |
| 2368 | $("paperList").className = "paper-list"; |
| 2369 | $("paperList").innerHTML = papers.map((paper, index) => { |
| 2370 | const number = Number(paper.number || index + 1); |
| 2371 | const reportKey = paperReportKey(number, push?.push_id); |
| 2372 | const reportId = state.paperReports.get(reportKey); |
| 2373 | const isReading = state.paperReading.has(reportKey); |
| 2374 | const score = normalizeScore(paper.score ?? paper.relevance ?? paper.relevance_score ?? 80); |
| 2375 | const tags = paperDisplayTags(paper); |
| 2376 | const title = paper.title || "Untitled Paper"; |
| 2377 | // Each action button names its paper so a screen reader announces |
no test coverage detected