fix(shared): polish X tweet preview rendering and modal media behavior#5674
fix(shared): polish X tweet preview rendering and modal media behavior#5674tomeredlich wants to merge 5 commits intomainfrom
Conversation
Refine social/X share rendering across cards and write flow by reducing duplicate preview content, handling hydration safely, and applying language-aware RTL direction with auto fallback for tweet text. Made-with: Cursor
Show tweet-first layouts for standalone X posts, hide placeholder cover media in modals, and standardize X metadata/read-action copy for clearer, consistent presentation. Made-with: Cursor
Ensure tweet media in post modals uses the same sizing rules as modal previews and broaden X preview detection for share links. This also adds regression coverage for embedded tweet media/identity rendering behavior. Made-with: Cursor
… label Update helper assertions to match current handle dedupe behavior and fixed `From x.com` label rendering so the focused social-twitter suite passes on main. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
@claude check pr |
|
Claude finished @tomeredlich's task in 2m 26s —— View job PR Review
Good overall direction — unifying the embedded tweet preview surface, adding RTL support, and hardening hydration. A few issues worth fixing before merge: Bugs1. Unreachable code in
if (isXShareLikePost(post)) { return 'View on X'; } // catches SocialTwitter too
if (isSocialTwitterPost(post)) { return 'View on X'; } // unreachable2. Duplicate import in import { cloudinaryPostImageCoverPlaceholder } from '../../lib/image';
import { isPlaceholderImage } from '../../lib/image';These should be a single import statement. 3. The old code rendered Code Quality4. Duplicated regex patterns across 3 files The title-parsing regex
The Both should be extracted to 5.
6. Handle deduplication behavior change —
7. The metadata={{
...metadata,
dateFirst: true,
bottomLabel: metadataBottomLabel, // always overrides memo's bottomLabel
}}This means 8. Hydration flash in The Minor9. Media not shown for standalone tweets in grid (
10. Type cast The double cast for | Branch |
Resolve lint_shared failures and clean up review feedback by removing unreachable read-button logic, consolidating duplicate imports, restoring case-insensitive handle deduping, extracting shared X-title/repost regex helpers, and preserving tweet titleHtml rendering in embedded previews. Made-with: Cursor
Summary
Test plan
pnpm --filter shared exec jest "src/components/cards/socialTwitter/EmbeddedTweetPreview.spec.tsx" "src/components/cards/socialTwitter/SocialTwitterGrid.spec.tsx" "src/components/cards/socialTwitter/SocialTwitterList.spec.tsx" "src/components/cards/socialTwitter/socialTwitterHelpers.spec.tsx"Made with Cursor
Preview domain
https://feat-social-twitter-preview-poli.preview.app.daily.dev