Skip to content

Use Preview image in my votes tab#1876

Merged
prxt6529 merged 3 commits intomainfrom
my-votes-preview-image
Feb 3, 2026
Merged

Use Preview image in my votes tab#1876
prxt6529 merged 3 commits intomainfrom
my-votes-preview-image

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Feb 3, 2026

Summary by CodeRabbit

  • Tests

    • Improved test maintainability with standardized mocks, consistent import/formatting, updated DOM/query usage, and clearer test render structures for vote/preview scenarios.
  • Refactor

    • Improved wave media preview: more reliable preview image handling, simplified media rendering, and disabled interactive media behavior for a more consistent preview experience.

Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Replaces DropListItemContentMedia with MediaDisplay in MyStreamWaveMyVote, adds a previewImageUrl derived from drop metadata via useMemo, updates imports, and adjusts the associated test file with reordered imports, alias-based mocks, and standardized string/selector formatting.

Changes

Cohort / File(s) Summary
Test File Updates
__tests__/components/brain/my-stream/votes/MyStreamWaveMyVote.test.tsx
Reordered imports to alias paths; replaced/mock-implemented modules (MediaDisplay, MyStreamWaveMyVoteVotes, MyStreamWaveMyVoteInput, UserCICAndLevel, SingleWaveDropPosition); standardized double quotes; switched window.getSelection -> globalThis.getSelection; adjusted selectors and JSX formatting.
Component Media Rendering
components/brain/my-stream/votes/MyStreamWaveMyVote.tsx
Replaced DropListItemContentMedia with MediaDisplay; added previewImageUrl via useMemo using getDropPreviewImageUrl(drop.metadata); imported helper and useMemo; passed previewImageUrl and disableMediaInteraction={true} to MediaDisplay and removed isCompetitionDrop.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #1872: Modifies the same MyStreamWaveMyVote component to change drop media rendering and MediaDisplay usage.
  • #1639: Updates MyStreamWaveMyVote component layout and media rendering behavior.

Suggested reviewers

  • ragnep
  • simo6529

Poem

🐰 I swapped the art for a brighter view,
A preview born from metadata true,
Tests trimmed neat with quotes aligned,
Mocks hopping in, all well-defined,
Tiny paws, a tidy cue.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing DropListItemContentMedia with MediaDisplay using a preview image in the my votes tab component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 my-votes-preview-image

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.

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 3, 2026

@prxt6529 prxt6529 merged commit 2f46ab3 into main Feb 3, 2026
7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Feb 23, 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