-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support markdown in tooltip content via TooltipMarkdown
#3083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded@steven-tey has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 12 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (107)
WalkthroughThe PR refactors tooltip content rendering across multiple UI components from JSX elements to Markdown strings. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
apps/web/ui/analytics/bar-list.tsx(2 hunks)apps/web/ui/domains/register-domain-form.tsx(1 hunks)apps/web/ui/links/disabled-link-tooltip.tsx(1 hunks)apps/web/ui/partners/confirm-payouts-sheet.tsx(1 hunks)apps/web/ui/partners/external-payouts-indicator.tsx(2 hunks)packages/tailwind-config/tailwind.config.ts(1 hunks)packages/ui/package.json(1 hunks)packages/ui/src/tooltip.tsx(4 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2857
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-help-and-support.tsx:95-121
Timestamp: 2025-09-17T17:40:35.470Z
Learning: In the Dub UI Switch component, providing a truthy `disabledTooltip` prop automatically disables the switch and prevents user interaction, so an explicit `disabled` prop is not needed when using `disabledTooltip`.
📚 Learning: 2025-09-18T16:33:17.719Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2858
File: apps/web/ui/partners/partner-application-tabs.tsx:1-1
Timestamp: 2025-09-18T16:33:17.719Z
Learning: When a React component in Next.js App Router uses non-serializable props (like setState functions), adding "use client" directive can cause serialization warnings. If the component is only imported by Client Components, it's better to omit the "use client" directive to avoid these warnings while still getting client-side execution through promotion.
Applied to files:
apps/web/ui/analytics/bar-list.tsxpackages/ui/src/tooltip.tsx
📚 Learning: 2025-08-25T21:03:24.285Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2736
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx:1-1
Timestamp: 2025-08-25T21:03:24.285Z
Learning: In Next.js App Router, Server Components that use hooks can work without "use client" directive if they are only imported by Client Components, as they get "promoted" to run on the client side within the Client Component boundary.
Applied to files:
apps/web/ui/analytics/bar-list.tsxpackages/ui/src/tooltip.tsx
📚 Learning: 2025-05-29T04:45:18.504Z
Learnt from: devkiran
Repo: dubinc/dub PR: 2448
File: packages/email/src/templates/partner-program-summary.tsx:0-0
Timestamp: 2025-05-29T04:45:18.504Z
Learning: In the PartnerProgramSummary email template (packages/email/src/templates/partner-program-summary.tsx), the stat titles are hardcoded constants ("Clicks", "Leads", "Sales", "Earnings") that will always match the ICONS object keys after toLowerCase() conversion, so icon lookup failures are not possible.
Applied to files:
apps/web/ui/partners/confirm-payouts-sheet.tsxapps/web/ui/partners/external-payouts-indicator.tsx
📚 Learning: 2025-10-08T21:33:23.553Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2936
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx:28-34
Timestamp: 2025-10-08T21:33:23.553Z
Learning: In the dub/ui Button component, when the `disabledTooltip` prop is set to a non-undefined value (e.g., a string), the button is automatically disabled. Therefore, it's not necessary to also add the same condition to the `disabled` prop—setting `disabledTooltip={permissionsError || undefined}` is sufficient to disable the button when there's a permissions error.
Applied to files:
apps/web/ui/partners/confirm-payouts-sheet.tsxapps/web/ui/links/disabled-link-tooltip.tsxapps/web/ui/partners/external-payouts-indicator.tsx
📚 Learning: 2025-09-17T17:40:35.470Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2857
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-help-and-support.tsx:95-121
Timestamp: 2025-09-17T17:40:35.470Z
Learning: In the Dub UI Switch component, providing a truthy `disabledTooltip` prop automatically disables the switch and prevents user interaction, so an explicit `disabled` prop is not needed when using `disabledTooltip`.
Applied to files:
apps/web/ui/links/disabled-link-tooltip.tsx
📚 Learning: 2025-09-17T17:40:35.470Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2857
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-help-and-support.tsx:95-121
Timestamp: 2025-09-17T17:40:35.470Z
Learning: In the Dub UI Switch component, providing a truthy `disabledTooltip` prop automatically disables the switch and prevents user interaction, so an explicit `disabled` prop is not needed when using `disabledTooltip`. The component computes `switchDisabled = disabledTooltip ? true : disabled || loading` and passes this to the underlying Radix Switch primitive.
Applied to files:
apps/web/ui/links/disabled-link-tooltip.tsx
📚 Learning: 2025-09-24T15:47:40.293Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/about-you-form.tsx:152-157
Timestamp: 2025-09-24T15:47:40.293Z
Learning: The Button component from dub/ui automatically adds type="button" when an onClick prop is passed, preventing accidental form submissions without requiring explicit type specification. The implementation uses: type={onClick ? "button" : type}
Applied to files:
apps/web/ui/partners/external-payouts-indicator.tsx
📚 Learning: 2025-09-24T15:47:40.293Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/about-you-form.tsx:152-157
Timestamp: 2025-09-24T15:47:40.293Z
Learning: The Button component from dub/ui automatically adds type="button" when an onClick prop is passed, preventing accidental form submissions without requiring explicit type specification.
Applied to files:
apps/web/ui/partners/external-payouts-indicator.tsx
📚 Learning: 2025-09-24T15:47:40.293Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/about-you-form.tsx:152-157
Timestamp: 2025-09-24T15:47:40.293Z
Learning: The Button component from dub/ui automatically sets type="button" when an onClick prop is passed and defaults to type="submit" otherwise, using the logic: type={props.onClick ? "button" : "submit"}. This prevents accidental form submissions when buttons are used for modal triggers or other non-form actions.
Applied to files:
apps/web/ui/partners/external-payouts-indicator.tsx
📚 Learning: 2025-10-15T01:05:43.266Z
Learnt from: steven-tey
Repo: dubinc/dub PR: 2958
File: apps/web/app/app.dub.co/(dashboard)/[slug]/settings/members/page-client.tsx:432-457
Timestamp: 2025-10-15T01:05:43.266Z
Learning: In apps/web/app/app.dub.co/(dashboard)/[slug]/settings/members/page-client.tsx, defer refactoring the custom MenuItem component (lines 432-457) to use the shared dub/ui MenuItem component to a future PR, as requested by steven-tey.
Applied to files:
packages/ui/src/tooltip.tsx
📚 Learning: 2025-09-24T16:10:37.349Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/ui/partners/partner-about.tsx:11-11
Timestamp: 2025-09-24T16:10:37.349Z
Learning: In the Dub codebase, the team prefers to import Icon as a runtime value from "dub/ui" and uses Icon as both a type and variable name in component props, even when this creates shadowing. This is their established pattern and should not be suggested for refactoring.
Applied to files:
packages/ui/src/tooltip.tsx
🧬 Code graph analysis (1)
apps/web/ui/links/disabled-link-tooltip.tsx (1)
packages/ui/src/tooltip.tsx (1)
Tooltip(59-110)
⏰ 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
🔇 Additional comments (11)
packages/tailwind-config/tailwind.config.ts (1)
24-25: LGTM!The typography rules remove default quotation marks from inline code elements, ensuring clean rendering of markdown code blocks in tooltips.
apps/web/ui/links/disabled-link-tooltip.tsx (1)
5-5: LGTM!The tooltip content has been successfully migrated to a markdown string format with properly formatted inline links.
apps/web/ui/domains/register-domain-form.tsx (1)
367-367: LGTM!The tooltip title has been simplified to a plain string with markdown-style inline code formatting. The backticks around
.linkwill render as inline code via the TooltipMarkdown component.apps/web/ui/analytics/bar-list.tsx (1)
221-227: LGTM!The migration to markdown-based tooltip content is correct. The markdown link format
[${title}](${title})creates a clickable link where both the display text and URL are the same, which is appropriate for displaying URLs. ThestopPropagationprevents the click event from bubbling to the parent row handler.apps/web/ui/partners/external-payouts-indicator.tsx (2)
1-1: LGTM!Removing the
Buttonimport is correct as the tooltip content no longer renders a Button component.
13-13: LGTM!The tooltip content has been successfully migrated to a markdown string with inline code formatting (backticks) and multiple embedded links. The dynamic slug interpolation works correctly within the template literal.
apps/web/ui/partners/confirm-payouts-sheet.tsx (1)
438-438: LGTM!The tooltip content has been successfully migrated to a markdown string format, consistent with the pattern used throughout this PR.
packages/ui/src/tooltip.tsx (4)
20-46: Well-implemented markdown rendering for tooltips.The
TooltipMarkdowncomponent properly configuresReactMarkdownwith:
- Custom link handling that opens in new tabs with security attributes
- Styled inline code elements
- Appropriate prose typography classes
The implementation is secure as ReactMarkdown doesn't execute scripts by default, and all markdown content comes from trusted developer-defined strings.
97-100: LGTM!String content is now rendered through
TooltipMarkdown, enabling markdown formatting while preserving backward compatibility for function and ReactNode content.
127-127: LGTM!The
TooltipContenttitle is now rendered viaTooltipMarkdown, enabling markdown formatting in tooltip titles.
119-119: Breaking change verified: AllTooltipContentusages properly updated.The
titleprop type has been correctly narrowed fromReactNodetostringin the component definition. All 10+ usages across the codebase have been updated to pass string values (template literals, variables, or string-returning functions likeexceededLimitError). No JSX elements are being passed where they would violate the new type constraint.
Summary by CodeRabbit
New Features
Style