Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TWilson023
Copy link
Collaborator

@TWilson023 TWilson023 commented Sep 26, 2025

Summary by CodeRabbit

  • New Features

    • Tooltip for program reward modifiers now supports scrolling with a visible progress indicator and a subtle bottom fade for readability.
    • Maintains base reward display and “OR” dividers, preserving existing conditional displays.
  • Refactor

    • Tooltip internals reorganized for clearer content rendering and scroll handling, with no expected changes to the public behavior.

@vercel
Copy link
Contributor

vercel bot commented Sep 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Sep 26, 2025 8:50pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Walkthrough

Extracted tooltip content into an internal component, added a public props type, and integrated scroll-tracking with a bottom fade; rendering now delegates to a content component passed into InfoTooltip while preserving reward/modifier and OR-divider logic.

Changes

Cohort / File(s) Change Summary
Tooltip refactor & scroll behavior
apps/web/ui/partners/program-reward-modifiers-tooltip.tsx
Extracted ProgramRewardModifiersTooltipContent (internal) and moved rendering logic there; introduced ProgramRewardModifiersTooltipProps type and updated exported ProgramRewardModifiersTooltip signature; added useRef + useScrollProgress to track scroll, render bottom fade/progress overlay; preserved base reward, OR-divider, and modifier rendering semantics; updated imports.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant IT as InfoTooltip
  participant P as ProgramRewardModifiersTooltip
  participant C as ProgramRewardModifiersTooltipContent
  participant SP as useScrollProgress

  U->>IT: hover/focus
  IT->>P: mount content component
  P->>C: pass `reward` props
  activate C
  C->>C: render base reward, OR sections, modifiers
  C->>SP: init scroll tracking with container ref
  SP-->>C: emit scroll progress (0..1)
  C->>C: render progress overlay & bottom fade based on progress
  deactivate C
  IT-->>U: display tooltip content
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Reward modifier display #2734 — Modifies the same ProgramRewardModifiersTooltip implementation; likely directly related to tooltip/refactor and modifier rendering changes.

Suggested reviewers

  • steven-tey

Poem

I nibble at the tooltip, soft and bright,
Scrolling carrots fade into the night.
Props are tidy, content tucked within,
A hop, a refactor — let the showing begin. 🥕

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 succinctly states the primary change—making the program reward modifiers tooltip scrollable—which aligns with the addition of scroll tracking and gradient fade behavior described in the changeset.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch reward-tooltip-scroll

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd35870 and f099569.

📒 Files selected for processing (1)
  • apps/web/ui/partners/program-reward-modifiers-tooltip.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/ui/partners/program-reward-modifiers-tooltip.tsx (3)
apps/web/lib/zod/schemas/rewards.ts (2)
  • ATTRIBUTE_LABELS (84-92)
  • rewardConditionsArraySchema (131-133)
apps/web/lib/types.ts (1)
  • RewardProps (504-504)
packages/ui/src/hooks/use-scroll-progress.ts (1)
  • useScrollProgress (6-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f46eaa and fd35870.

📒 Files selected for processing (1)
  • apps/web/ui/partners/program-reward-modifiers-tooltip.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/ui/partners/program-reward-modifiers-tooltip.tsx (3)
apps/web/lib/zod/schemas/rewards.ts (2)
  • ATTRIBUTE_LABELS (84-92)
  • rewardConditionsArraySchema (131-133)
apps/web/lib/types.ts (1)
  • RewardProps (504-504)
packages/ui/src/hooks/use-scroll-progress.ts (1)
  • useScrollProgress (6-37)
🪛 Biome (2.1.2)
apps/web/ui/partners/program-reward-modifiers-tooltip.tsx

[error] 53-53: This hook is being called conditionally, but all hooks must be called in the exact same order in every component render.

Hooks should not be called after an early return.

For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level

(lint/correctness/useHookAtTopLevel)


[error] 54-54: This hook is being called conditionally, but all hooks must be called in the exact same order in every component render.

Hooks should not be called after an early return.

For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level

(lint/correctness/useHookAtTopLevel)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

@steven-tey steven-tey merged commit a43d018 into main Sep 26, 2025
8 checks passed
@steven-tey steven-tey deleted the reward-tooltip-scroll branch September 26, 2025 21:00
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.

3 participants