fix: web dashboard Reader fetches article content on select
All checks were successful
Security Checks / dependency-audit (push) Successful in 21s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 4s

Slim list mode means list responses no longer include content.
Now selectArticle() fetches the full entry via GET /entries/{id}
before displaying, then optionally crawls for full content if short.
Also uses API thumbnail field instead of extracting from empty content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 20:01:40 -05:00
parent 678a71def7
commit aad9b92342

View File

@@ -62,7 +62,7 @@
return {
id: e.id, title: e.title, feed: e.feed?.title || '', url: e.url,
timeAgo: timeAgo(e.published_at), readingTime: `${e.reading_time || 1} min`,
content: e.content || '', thumbnail: extractThumb(e.content),
content: e.content || '', thumbnail: e.thumbnail || extractThumb(e.content),
starred: e.starred || false, read: e.status === 'read',
author: e.author || ''
};
@@ -305,10 +305,25 @@
markEntryRead(article.id);
decrementUnread();
}
// Auto-fetch full article content if we only have RSS summary
if (article.content && article.content.length < 1500) {
fetchFullContent(article);
}
// Fetch full entry content (slim list doesn't include it)
loadArticleContent(article);
}
async function loadArticleContent(article: Article) {
try {
const data = await api(`/entries/${article.id}`);
const content = data.full_content || data.content || '';
article.content = content;
if (data.thumbnail) article.thumbnail = data.thumbnail;
if (selectedArticle?.id === article.id) {
selectedArticle = { ...article };
}
articles = [...articles];
// If content is short, try fetching full article via crawler
if (content.length < 1500) {
fetchFullContent(article);
}
} catch { /* silent */ }
}
async function fetchFullContent(article: Article) {