-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix partner comment editing + Markdown rendering #3118
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.
|
WalkthroughThe PR replaces Linkify-based comment rendering with ReactMarkdown (supporting GitHub-flavored markdown) and updates MessageInput's default value handling to properly initialize the RichTextProvider with the provided default value. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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: 0
🧹 Nitpick comments (1)
apps/web/ui/partners/partner-comments.tsx (1)
358-387: Solid markdown implementation with proper security.The ReactMarkdown configuration is well-designed:
- Restrictive
allowedElementswhitelist prevents XSS attacks- Custom anchor component correctly applies
target="_blank"withrel="noopener noreferrer nofollow"for securityPROSE_STYLES.condensedprovides appropriate spacing for comment contextremarkGfmenables useful GitHub-flavored featuresOne optional enhancement to consider: you might want to add
unwrapDisallowedprop to strip disallowed elements rather than keeping them as text, though the current behavior may be intentional.<ReactMarkdown className={cn( "text-content-subtle font-medium", "prose prose-sm break-words", PROSE_STYLES.condensed, "prose-a:font-medium prose-a:underline-offset-4", )} + unwrapDisallowed allowedElements={[ "p", "a", "code", "strong", "em", "ul", "ol", "li", ]}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/ui/partners/partner-comments.tsx(2 hunks)apps/web/ui/shared/message-input.tsx(3 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx:180-189
Timestamp: 2025-09-24T15:50:16.414Z
Learning: TWilson023 prefers to keep security vulnerability fixes separate from refactoring PRs when the vulnerable code is existing and was only moved/relocated rather than newly introduced.
📚 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:
apps/web/ui/partners/partner-comments.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:
apps/web/ui/partners/partner-comments.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/partner-comments.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/partner-comments.tsx
🧬 Code graph analysis (1)
apps/web/ui/partners/partner-comments.tsx (1)
packages/ui/src/rich-text-area/rich-text-provider.tsx (1)
PROSE_STYLES(20-24)
⏰ 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 (2)
apps/web/ui/partners/partner-comments.tsx (1)
17-17: LGTM! Clean markdown rendering setup.The imports are well-organized: PROSE_STYLES for consistent styling, ReactMarkdown for rendering, and remark-gfm for GitHub-flavored markdown support.
Also applies to: 25-26
apps/web/ui/shared/message-input.tsx (1)
18-18: No issues found—refactor is sound.The verification confirms that
RichTextProvidercorrectly handles theinitialValueprop:
- The prop type is
initialValue?: any;(optional), explicitly allowingundefined- The component passes the value directly to the editor's
contentfield, which standard editor libraries handle gracefully- The design intentionally preserves the distinction between "no value" (undefined) and "empty value" ("")
The changes at lines 18, 34, and 61 are correct and properly implement optional defaultValue handling.
Summary by CodeRabbit
Release Notes
New Features
Improvements