-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
X native articles (blogs) appear as empty tweets in xfeed. There's no way to distinguish them from regular tweets, and their content isn't displayed.
Example
Tweet URL: https://x.com/levie/status/2007958155137876183
Current behavior:
- Tweet shows author header and engagement stats
- Body is completely empty (no text content)
- Only indication is the "Links" section showing
x.com/i/article/2007...
Screenshot:

Context
X native articles use the URL format x.com/i/article/{id} and are delivered via the article field in the GraphQL response rather than legacy.full_text.
The codebase already has:
ArticleDatatype (types.ts:318-356)extractArticleText()function (client.ts:735-809)- Feature flags like
articles_preview_enabled,responsive_web_twitter_article_tweet_consumption_enabled
However, article content extraction fails silently for some articles, particularly in timeline/bookmark contexts where the fetchUserArticlePlainText fallback (only in getTweet()) doesn't run.
Current Behavior
// client.ts:1026-1029
const rawText = this.extractTweetText(result);
if (!rawText) {
return undefined; // Tweet silently dropped OR shows empty
}When extractArticleText() returns undefined:
- If
legacy.full_textis also empty/missing → tweet text is empty - User sees an empty post with no indication it's an article
Expected Behavior
- Detect articles: Add
isArticle?: booleantoTweetDatatype - Display article indicator: Show "📰 Article" or similar in PostCard when content is article-based
- Graceful fallback: If article text extraction fails, show:
- Article title (if available)
- "View article" prompt with link
- Not just an empty tweet body
- Timeline support: Apply the same fallback logic used in
getTweet()to timeline/bookmark parsing
Potential Implementation
Option A: Add article type detection + UI indicator
// TweetData type extension
interface TweetData {
// ... existing fields
isArticle?: boolean;
articleTitle?: string;
}
// In mapTweetResult():
const hasArticle = !!result?.article;
if (hasArticle && !rawText) {
// Fallback: show title or placeholder
text = this.extractArticleTitle(result) ?? "[Article - tap to view]";
}
// In PostCard.tsx:
{post.isArticle && (
<text fg={colors.info}>📰 Article</text>
)}Option B: Fetch article content for timeline posts
Apply the same fetchUserArticlePlainText fallback used in getTweet() to parseTweetsFromInstructions() for posts with articles.
Files to Modify
src/api/types.ts- AddisArticle,articleTitletoTweetDatasrc/api/client.ts- Improve article detection and fallback inmapTweetResult()src/components/PostCard.tsx- Add article indicator UIsrc/components/PostDetail.tsx- Show article link/content appropriately
Acceptance Criteria
- Articles are visually distinguished from regular tweets
- Article title is displayed when available
- Empty article tweets show informative placeholder (not empty body)
- Article link (
x.com/i/article/...) is actionable - Works in timeline, bookmarks, and single tweet views
- Debug flag
XFEED_DEBUG_ARTICLE=1continues to work - All tests passing (
bun run test)
🤖 Generated with Claude Code