Skip to content

Show a thumbnail on payout notifications#3341

Merged
feruzm merged 1 commit into
developmentfrom
feature/payout-notification-thumbnails
Jul 13, 2026
Merged

Show a thumbnail on payout notifications#3341
feruzm merged 1 commit into
developmentfrom
feature/payout-notification-thumbnails

Conversation

@feruzm

@feruzm feruzm commented Jul 13, 2026

Copy link
Copy Markdown
Member

Problem

payouts ("your post paid out") carries img_url and the api has always sent it, but the type was missing from the image mapper, so those rows render text-only.

It is live and not rare: roughly 1,500 rows a day, about half of them with an image.

Why it was missed

I derived the original type list from the sdk types, and there is no ApiPayoutNotification type at all — even though the api emits payouts and the row already renders. An incomplete source produced an incomplete list.

Verified against the backend instead this time: endpoints.py has an ACTIVITY_TYPE_PAYOUT branch that serializes img_url, convert_source_row_payouts populates it via get_post(), and the live table confirms the rows carry real image urls.

Change

Adds payouts to IMAGE_TYPES (the img_url group). Still gated on "Show Images", like the other notification thumbnails. Votes remain the only image-carrying type left text-only, as agreed: highest-volume, and every thumbnail would repeat the user's own post.

The matching web change is ecency/vision-next#1144.

Tests

650 pass; lint and typecheck clean.

Summary by CodeRabbit

  • Bug Fixes
    • Payout notifications now display their provided image in 96×96 thumbnails.
    • Added coverage to ensure payout notification images are handled consistently.

payouts carries img_url (the post that paid out) and the api has always sent it,
but the type was missing from the image mapper. It is live and not rare: roughly
1,500 rows a day, about half of them with an image.

It was missed because the sdk has no ApiPayoutNotification type at all, so the
type list was derived from an incomplete source.
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR enables thumbnails for payout notifications.

  • Adds payouts to the notification types that read img_url.
  • Extends the image URL mapping test to cover payout notifications.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
src/utils/notificationImage.ts Adds payouts to the direct notification image mapping while keeping the existing null and type guards.
src/utils/notificationImage.test.ts Adds payout coverage to the existing img_url notification image test case.

Reviews (1): Last reviewed commit: "Show a thumbnail on payout notifications" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 19df88bd-736c-4bfa-b3a4-0ac625addbad

📥 Commits

Reviewing files that changed from the base of the PR and between c6a2a44 and c7646af.

📒 Files selected for processing (2)
  • src/utils/notificationImage.test.ts
  • src/utils/notificationImage.ts

📝 Walkthrough

Walkthrough

The notification image utility now recognizes payouts notifications as image-bearing types, and its parameterized tests verify thumbnail URL proxying for that type.

Changes

Notification thumbnail handling

Layer / File(s) Summary
Support payouts thumbnail URLs
src/utils/notificationImage.ts, src/utils/notificationImage.test.ts
payouts is added to the image type list, with coverage confirming the provided img_url is proxied at 96x96.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Poem

A bunny saw payouts hop in the queue,
Now thumbnails bloom with a brighter hue.
At ninety-six squares, the images gleam,
Tests guard the path like a carrot-filled dream. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: enabling thumbnails for payout notifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/payout-notification-thumbnails

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

@feruzm feruzm merged commit d7e594c into development Jul 13, 2026
9 checks passed
@feruzm feruzm deleted the feature/payout-notification-thumbnails branch July 13, 2026 13:38
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.

1 participant