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

Skip to content

Conversation

@TWilson023
Copy link
Collaborator

@TWilson023 TWilson023 commented Nov 17, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Partner comments now support markdown formatting with GitHub-flavored markdown features
    • Links in comments open in new tabs with improved security attributes
  • Improvements

    • Enhanced message input handling for better consistency with default value initialization

@vercel
Copy link
Contributor

vercel bot commented Nov 17, 2025

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

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Nov 17, 2025 2:54pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

The 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

Cohort / File(s) Summary
Comment Rendering Migration
apps/web/ui/partners/partner-comments.tsx
Replaces Linkify with ReactMarkdown + remark-gfm for markdown support; adds PROSE_STYLES and condensed prose styling; whitelists markdown elements (p, a, code, strong, em, ul, ol, li); customizes anchor rendering for new-tab behavior.
Message Input Refactoring
apps/web/ui/shared/message-input.tsx
Removes default value assignment from defaultValue parameter; updates state initialization to use fallback (defaultValue || ""); adds initialValue={defaultValue} prop to RichTextProvider.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Attention areas:
    • Verify markdown element whitelist in partner-comments.tsx is sufficiently permissive for expected comment content
    • Confirm RichTextProvider properly receives and initializes with initialValue prop in message-input.tsx
    • Test rendering of links and inline code in comment display to ensure markdown output matches previous Linkify behavior

Possibly related PRs

Suggested reviewers

  • steven-tey

Poem

🐰 From links once plain to markdown's grace,
The comments now have better face,
With GFM and prose so tight,
ReactMarkdown shines so bright!
Input flows with values right! ✨

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 accurately summarizes the main changes: fixing partner comment editing and implementing markdown rendering in the partner-comments.tsx file.
✨ 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 partner-comments-md

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: 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 allowedElements whitelist prevents XSS attacks
  • Custom anchor component correctly applies target="_blank" with rel="noopener noreferrer nofollow" for security
  • PROSE_STYLES.condensed provides appropriate spacing for comment context
  • remarkGfm enables useful GitHub-flavored features

One optional enhancement to consider: you might want to add unwrapDisallowed prop 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

📥 Commits

Reviewing files that changed from the base of the PR and between c768790 and c3f98f9.

📒 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 RichTextProvider correctly handles the initialValue prop:

  • The prop type is initialValue?: any; (optional), explicitly allowing undefined
  • The component passes the value directly to the editor's content field, 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.

@steven-tey steven-tey merged commit ea19829 into main Nov 17, 2025
8 of 9 checks passed
@steven-tey steven-tey deleted the partner-comments-md branch November 17, 2025 16:02
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