Stop truncating quote-tweet text, keep media at thumbnail size
extractQuotedTweet() was capping the quoted tweet's text at 240 characters via toSummary(); it now keeps the full cleaned text, matching the outer tweet's own body which was never truncated. Dropped the matching -webkit-line-clamp: 3 on .quoted-text in TweetCard.svelte so the full text actually renders instead of being clipped after 3 lines. Media sizing (.quoted-img's 140px cap, the media grid's fixed cell heights) is unchanged — only text was meant to stay unconstrained. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014c1L8ghNBFjfiH64UMViP8
This commit is contained in:
@@ -11,7 +11,7 @@ import type { Source, TweetMediaItem, QuotedTweet } from '../../storage/db/types
|
|||||||
import type { SourceAdapter, FetchedItem } from './base.js';
|
import type { SourceAdapter, FetchedItem } from './base.js';
|
||||||
import { logger } from '../../storage/db/logs.js';
|
import { logger } from '../../storage/db/logs.js';
|
||||||
import { getSettings } from '../../storage/db/settings.js';
|
import { getSettings } from '../../storage/db/settings.js';
|
||||||
import { cleanHtml, toSummary } from '../clean.js';
|
import { cleanHtml } from '../clean.js';
|
||||||
|
|
||||||
/** fxtwitter caps a tweet at 4 attached photos/videos/gifs, in tweet display order. */
|
/** fxtwitter caps a tweet at 4 attached photos/videos/gifs, in tweet display order. */
|
||||||
const MAX_TWEET_MEDIA = 4;
|
const MAX_TWEET_MEDIA = 4;
|
||||||
@@ -136,7 +136,7 @@ function extractQuotedTweet(descriptionHtml: string): QuotedTweet | null {
|
|||||||
return {
|
return {
|
||||||
authorName: authorMatch[1].trim(),
|
authorName: authorMatch[1].trim(),
|
||||||
authorHandle: authorMatch[2].trim(),
|
authorHandle: authorMatch[2].trim(),
|
||||||
text: toSummary(cleanHtml(beforeFooter), 240),
|
text: cleanHtml(beforeFooter),
|
||||||
imageUrl: extractImageUrl(inner),
|
imageUrl: extractImageUrl(inner),
|
||||||
link: linkMatch[1]
|
link: linkMatch[1]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -253,10 +253,6 @@
|
|||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 3;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
.quoted-img {
|
.quoted-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user