Skip to content

Make tweets and gifs narrower#1920

Merged
simo6529 merged 4 commits intomainfrom
make-tweets-narrower
Feb 10, 2026
Merged

Make tweets and gifs narrower#1920
simo6529 merged 4 commits intomainfrom
make-tweets-narrower

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Feb 10, 2026

Summary by CodeRabbit

  • Tests

    • Added GIF handler and tweet embed validation tests.
    • Removed legacy link handler test suite.
  • New Features

    • GIF embeds now support dynamic sizing based on context (fixed-size in chat, flexible in other views).
  • Bug Fixes

    • Fixed operator precedence in notification item key calculations.
    • Improved boolean expression evaluation clarity.
  • Refactor

    • Enhanced link handler configuration to support variant-specific rendering.
    • Improved tweet embed container layout constraints on larger screens.
  • Style

    • Reordered CSS utility classes for consistency.
    • Cleaned up imports and formatting across components.

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a link preview variant system to the drop markdown rendering pipeline, enabling variant-aware GIF embed sizing. It adds comprehensive GIF handler tests, removes a large centralized test suite, and updates components throughout the application to support and utilize the new LinkPreviewVariant parameter. Additionally, various components receive formatting improvements, operator precedence fixes, and prop cleanup.

Changes

Cohort / File(s) Summary
Test Suite Updates
__tests__/components/drops/view/part/DropPartMarkdown.test.tsx, __tests__/components/drops/view/part/dropPartMarkdown/handlers/gif.test.tsx, __tests__/components/drops/view/part/dropPartMarkdown/linkHandlersRegistry.test.tsx
Added runtime assertions for tweet fallback wrapper structure and Tailwind classes; introduced comprehensive GIF handler unit tests covering variant-based rendering behavior; removed large centralized linkHandlersRegistry test file (541 lines).
Link Preview Variant System
components/drops/view/part/dropPartMarkdown/handlers/gif.tsx, components/drops/view/part/dropPartMarkdown/handlers/index.ts, components/drops/view/part/dropPartMarkdown/linkHandlers.tsx, components/waves/SmartLinkPreview.tsx
Updated GIF handler factory to accept optional linkPreviewVariant parameter; modified createLinkHandlers to propagate variant through options object; enhanced SmartLinkPreview to pass resolved variant to handler creation with updated dependency tracking.
GIF Embed Enhancements
components/drops/view/part/dropPartMarkdown/renderers.tsx
Added optional GifEmbedOptions parameter to renderGifEmbed; introduced fixedSize mode (180px height) for chat variant with rounded, object-contain styling; adjusted tweet embed container layout with full-width and lg:max-width constraints.
Component Prop Cleanup
components/drops/view/Drops.tsx, components/drops/view/DropsList.tsx, components/header/header-search/HeaderSearchModal.tsx, components/brain/my-stream/MyStreamWaveChat.tsx, components/waves/header/WaveHeaderDescription.tsx
Removed onReplyClick prop from Drop/DropsList component usages; consolidated empty lines in JSX prop definitions.
Notification Components
components/brain/notifications/NotificationItems.tsx, components/brain/notifications/NotificationsWrapper.tsx, components/brain/notifications/all-drops/NotificationAllDrops.tsx, components/brain/notifications/priority-alert/NotificationPriorityAlert.tsx, components/brain/notifications/subcomponents/NotificationWithDrop.tsx
Fixed operator precedence in nullish coalescing for keySuffix computation; restructured imports for ActiveDropState/ActiveDropAction; reordered Tailwind classes in className strings for layout consistency.
UI Components - Formatting & Layout
components/utils/select/dropdown/CommonDropdownItemsDefaultWrapper.tsx, components/waves/drops/WaveDropActionsMore.tsx, components/waves/drops/WaveDropActionsQuickReact.tsx, components/waves/drops/WaveDropActionsReply.tsx, components/waves/drops/search/WaveDropsSearchModal.tsx
Consolidated imports; reformatted component props across multiple lines; reordered Tailwind CSS utility classes; collapsed debounce hook invocation to single line.
Meme Component Updates
components/memes/drops/MemeParticipationDrop.tsx
Added isCompetitionDrop prop to DropListItemContentMedia; expanded MemeDropVoteStats props (projected, votingCreditType, ratersCount, topVoters, userContext); adjusted layout and spacing classes across vote controls and media sections.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • prevent nesting #1605: Modifies the dropPartMarkdown link handling pipeline (createLinkHandlers/createLinkRenderer and related handlers) with overlapping refactoring scope.
  • Hide link preview for internal links  #1778: Updates components/drops/view/part/dropPartMarkdown/linkHandlers.tsx with early short-circuit for hideLinkPreviews, sharing the same link-rendering control flow modifications.
  • Stabilize drop media #1908: Adds stable/fixed-frame layout classes for tweet and YouTube embeds alongside width/height constraints, complementing the GIF embed sizing enhancements.

Suggested reviewers

  • ragnep
  • prxt6529

Poem

🐰 Link handlers now variant-aware,
GIFs sized snug with chat-mode care,
Tests expanded, old ones fade,
Props and classes fresh remade,
Markdown pipelines dance anew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Make tweets and gifs narrower' directly aligns with the main changes: constraining tweet width with full width and lg:max-width classes, and adding fixedSize option to GIF rendering.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch make-tweets-narrower

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
__tests__/components/drops/view/part/dropPartMarkdown/handlers/gif.test.tsx (1)

25-34: Consider adding a test for the default (no-options) case.

createGifHandler() called without arguments should produce fixedSize: true (since undefined !== "home" is true). This is an important default behavior worth covering explicitly.

components/drops/view/part/dropPartMarkdown/renderers.tsx (1)

60-92: Minor style inconsistency between fixed and non-fixed GIF paths.

The fixed-size path uses tw-rounded-xl but the non-fixed path doesn't include rounding. Also, tw-max-w-[100%] (Line 88) is functionally equivalent to tw-max-w-full used in the fixed path (Line 76) — consider aligning them for consistency.

If this is intentional (e.g., different visual treatment for the "home" variant), disregard.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@simo6529 simo6529 merged commit 076512c into main Feb 10, 2026
7 checks passed
@simo6529 simo6529 deleted the make-tweets-narrower branch February 10, 2026 11:58
@coderabbitai coderabbitai Bot mentioned this pull request Feb 20, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants