Skip to content

Comments

feat: add trustpilot to review page again#2089

Open
reneaaron wants to merge 2 commits intomasterfrom
feat/trustpilot
Open

feat: add trustpilot to review page again#2089
reneaaron wants to merge 2 commits intomasterfrom
feat/trustpilot

Conversation

@reneaaron
Copy link
Contributor

@reneaaron reneaaron commented Feb 19, 2026

image

Summary by CodeRabbit

  • New Features

    • App header updated to "Review & Earn" with a new encouragement description.
    • Added informational alert explaining review earning mechanics with direct rewards contact link.
    • Added a new review opportunity ("Alby") showing a non-monetary reward "Our gratitude".
  • Style

    • Redesigned review cards with improved spacing, alignment, and consistent images.
    • Reward display now shows either a bitcoin amount or a heart + custom text.
    • Enhanced external link hover styling for clarity.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

AlbyReviews.tsx renames the data model and constant (ProductOpportunity → ReviewOpportunity, productOpportunities → reviewOpportunities), adds an Alert and updated header text, refactors card/item layout, and changes reward rendering to support numeric rewards or optional rewardText with a heart icon.

Changes

Cohort / File(s) Summary
AlbyReviews Component & data
frontend/src/screens/alby/AlbyReviews.tsx
Renamed interface and constant (ProductOpportunity → ReviewOpportunity, productOpportunities → reviewOpportunities). reward made optional and rewardText?: string added. Added alby.png import and new Icons/Alert imports. Header text changed to "Review & Earn" and an Alert block added.
UI rendering & layout
frontend/src/screens/alby/AlbyReviews.tsx
Removed CardHeader/CardDescription, use CardContent for per-item rendering with borders/spacing. Image sizing and flex behaviour adjusted (flex-shrink/min-w-0). Platform links get hover underline.
Reward display logic
frontend/src/screens/alby/AlbyReviews.tsx
Conditional reward rendering: if reward present render FormattedBitcoinAmount (reward * 1000); else if rewardText present render HeartIcon plus muted inline rewardText. Added HeartIcon and CoinsIcon imports; preserved ExternalLinkIcon.
Data changes
frontend/src/screens/alby/AlbyReviews.tsx
reviewOpportunities array updated with a new "Alby" entry using rewardText: "Our gratitude" and platform: Trustpilot.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in to tidy titles and cheer,
Coins or kind words — every reviewer dear.
Cards refreshed, hearts and icons gleam,
A little refactor, a brighter scheme.
Hooray for reviews — nibble on this dream ✨

🚥 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 accurately describes the main change: adding Trustpilot as a review platform option to the Review & Earn page.

✏️ 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 feat/trustpilot

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
frontend/src/screens/alby/AlbyReviews.tsx (2)

124-133: Minor: prefer !== undefined over truthy check for numeric reward

opportunity.reward ? is falsy for 0. While no current entry has reward: 0, a future entry with a zero-reward would incorrectly fall through to the gratitude branch. Additionally, if neither reward nor rewardText is set, the gratitude span renders with a lone HeartIcon and no text.

♻️ Suggested fix
-                  {opportunity.reward ? (
+                  {opportunity.reward !== undefined ? (
                     <FormattedBitcoinAmount
                       amount={opportunity.reward * 1000}
                     />
                   ) : (
                     <span className="text-muted-foreground text-sm flex items-center gap-1">
                       <HeartIcon className="w-4 h-4" />
-                      {opportunity.rewardText}
+                      {opportunity.rewardText ?? ""}
                     </span>
                   )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/alby/AlbyReviews.tsx` around lines 124 - 133, The
component currently uses a truthy check `opportunity.reward ?` which treats 0 as
falsy and would show the gratitude branch; change the conditional to an explicit
undefined check (e.g., `opportunity.reward !== undefined`) so zero rewards
render via FormattedBitcoinAmount (reference: opportunity.reward and
FormattedBitcoinAmount). Also handle the case where neither reward nor
rewardText is set by conditionally rendering the gratitude span only when
`opportunity.rewardText` is truthy (reference: rewardText and HeartIcon) to
avoid showing a lone HeartIcon.

124-133: Optional: prefer !== undefined over truthy check for numeric reward

opportunity.reward ? is falsy for reward: 0. If a future free/zero-reward entry is added, it would incorrectly render the gratitude branch. Additionally, if neither reward nor rewardText is defined, the span renders with only a HeartIcon and no text.

♻️ Suggested fix
-                  {opportunity.reward ? (
+                  {opportunity.reward !== undefined ? (
                     <FormattedBitcoinAmount
                       amount={opportunity.reward * 1000}
                     />
                   ) : (
                     <span className="text-muted-foreground text-sm flex items-center gap-1">
                       <HeartIcon className="w-4 h-4" />
-                      {opportunity.rewardText}
+                      {opportunity.rewardText ?? ""}
                     </span>
                   )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/alby/AlbyReviews.tsx` around lines 124 - 133, The
current truthy check on opportunity.reward hides valid zero values and can
render an empty icon if rewardText is also missing; change the conditional to
check explicitly for presence (e.g., opportunity.reward !== undefined or
opportunity.reward != null) so 0 is treated as a valid reward and continue to
render FormattedBitcoinAmount (amount={opportunity.reward * 1000}); for the
fallback branch, only render the HeartIcon + rewardText span when
opportunity.rewardText is defined (otherwise render null or a suitable default
message) so you never output an icon with no text—update the JSX around
FormattedBitcoinAmount, opportunity.reward, and opportunity.rewardText
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/screens/alby/AlbyReviews.tsx`:
- Around line 123-133: The gratitude span inside the container with className
"text-right" is using a plain "flex" which creates a new formatting context and
causes the HeartIcon + opportunity.rewardText (the gratitude text) to appear
left-aligned; update the gratitude span so it preserves right alignment by using
an inline-flex or adding justify-end (e.g., change the span's classes to include
"inline-flex items-center justify-end gap-1") so the HeartIcon and
opportunity.rewardText remain right-aligned alongside the FormattedBitcoinAmount
when opportunity.reward is falsy.
- Around line 123-133: The gratitude span inside the right-aligned container is
using a flex layout which ignores the parent's text-align; update the span
rendered in the false branch (currently: <span className="text-muted-foreground
text-sm flex items-center gap-1"> showing HeartIcon and opportunity.rewardText)
to right-align its contents by adding a horizontal justification class (e.g.
change to "flex justify-end items-center ...") or switch to "inline-flex
justify-end items-center ..." so the HeartIcon + opportunity.rewardText align
flush right like FormattedBitcoinAmount.

---

Nitpick comments:
In `@frontend/src/screens/alby/AlbyReviews.tsx`:
- Around line 124-133: The component currently uses a truthy check
`opportunity.reward ?` which treats 0 as falsy and would show the gratitude
branch; change the conditional to an explicit undefined check (e.g.,
`opportunity.reward !== undefined`) so zero rewards render via
FormattedBitcoinAmount (reference: opportunity.reward and
FormattedBitcoinAmount). Also handle the case where neither reward nor
rewardText is set by conditionally rendering the gratitude span only when
`opportunity.rewardText` is truthy (reference: rewardText and HeartIcon) to
avoid showing a lone HeartIcon.
- Around line 124-133: The current truthy check on opportunity.reward hides
valid zero values and can render an empty icon if rewardText is also missing;
change the conditional to check explicitly for presence (e.g.,
opportunity.reward !== undefined or opportunity.reward != null) so 0 is treated
as a valid reward and continue to render FormattedBitcoinAmount
(amount={opportunity.reward * 1000}); for the fallback branch, only render the
HeartIcon + rewardText span when opportunity.rewardText is defined (otherwise
render null or a suitable default message) so you never output an icon with no
text—update the JSX around FormattedBitcoinAmount, opportunity.reward, and
opportunity.rewardText accordingly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/src/screens/alby/AlbyReviews.tsx (1)

80-80: inline class on AlertDescription is unnecessary and mismatches the component's <div> semantics.

AlertDescription renders a <div>; its inline text content (including the ExternalLink) already flows naturally. Forcing display: inline on the wrapper can interfere with the Alert's [&>svg~*]:pl-7 indentation rule and is semantically odd. Removing the class keeps layout intact.

♻️ Proposed fix
-            <AlertDescription className="inline">
+            <AlertDescription>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/alby/AlbyReviews.tsx` at line 80, Remove the unnecessary
className="inline" from the AlertDescription component in AlbyReviews (the
AlertDescription wrapper that contains the ExternalLink) because
AlertDescription renders a div and forcing inline breaks the Alert's sibling SVG
indentation rule ([&>svg~*]:pl-7); simply delete the inline class on
AlertDescription and verify the Alert's spacing and layout remain correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@frontend/src/screens/alby/AlbyReviews.tsx`:
- Around line 124-133: No change required: the rendering correctly distinguishes
opportunity.reward (handles 0) and opportunity.rewardText, so keep the ternary
using "opportunity.reward !== undefined" with the FormattedBitcoinAmount
component (amount={opportunity.reward * 1000}) and the gratitude span containing
HeartIcon with "inline-flex items-center justify-end gap-1" — no code edits
needed.

---

Nitpick comments:
In `@frontend/src/screens/alby/AlbyReviews.tsx`:
- Line 80: Remove the unnecessary className="inline" from the AlertDescription
component in AlbyReviews (the AlertDescription wrapper that contains the
ExternalLink) because AlertDescription renders a div and forcing inline breaks
the Alert's sibling SVG indentation rule ([&>svg~*]:pl-7); simply delete the
inline class on AlertDescription and verify the Alert's spacing and layout
remain correct.

@reneaaron reneaaron requested a review from im-adithya February 23, 2026 14:46
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