-
Notifications
You must be signed in to change notification settings - Fork 147
Fixes #140 #295
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
base: main
Are you sure you want to change the base?
Fixes #140 #295
Conversation
Fixed overlapping text and UI elements in creator match cards by: - Converting AudienceMatchBar to vertical stack layout - Improving label/value spacing in CreatorStats - Reducing grid columns from 4 to 2 on large screens
📝 WalkthroughWalkthroughThe changes implement a compact view mode for the collaboration hub by introducing an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 2
🤖 Fix all issues with AI agents
In `@Frontend/src/components/collaboration-hub/CreatorMatchCard.tsx`:
- Around line 44-52: AudienceMatchBar renders an inconsistent progress state for
unknown audience labels: aria-valuenow falls back to 0 but the inner bar width
falls back to 50%, confusing assistive tech and visuals. Fix AudienceMatchBar by
computing a single numeric matchValue (e.g., 100, 75, 50, or 0) from
audienceMatch (use a small map or switch) and use that value both for
aria-valuenow and for the inline style width (e.g., `${matchValue}%`); keep
using getAudienceMatchColor(audienceMatch) for color only so unknown labels show
0% width and aria-valuenow=0 consistently.
In `@Frontend/src/pages/DashboardPage.tsx`:
- Line 193: The CollaborationsPage component defaults showHeader to true which
causes its sticky header to render inside the Dashboard card; update the
embedded instance (the <CollaborationsPage compact={true} /> usage) to
explicitly pass showHeader={false} so the header is disabled in the
compact/dashboard embed and prevents layout overlap.
| const AudienceMatchBar: React.FC<{audienceMatch: string}> = ({ audienceMatch }) => ( | ||
| <div className="flex items-center gap-2 w-full justify-center mb-2"> | ||
| <span className="text-xs text-gray-500">Audience Match</span> | ||
| <span className="font-semibold text-xs text-gray-700">{audienceMatch}</span> | ||
| <div className="flex-1 h-2 rounded bg-gray-200 mx-2 min-w-[60px] max-w-[80px]" role="progressbar" aria-valuenow={audienceMatch === 'Very High' ? 100 : audienceMatch === 'High' ? 75 : audienceMatch === 'Good' ? 50 : 0} aria-valuemin={0} aria-valuemax={100}> | ||
| <div className="w-full mb-3 space-y-2"> | ||
| <div className="flex items-center justify-between"> | ||
| <span className="text-xs text-gray-500">Audience Match</span> | ||
| <span className="font-semibold text-xs text-gray-700">{audienceMatch}</span> | ||
| </div> | ||
| <div className="w-full h-2 rounded bg-gray-200" role="progressbar" aria-valuenow={audienceMatch === 'Very High' ? 100 : audienceMatch === 'High' ? 75 : audienceMatch === 'Good' ? 50 : 0} aria-valuemin={0} aria-valuemax={100}> | ||
| <div className={`h-2 rounded ${getAudienceMatchColor(audienceMatch)}`} style={{ width: audienceMatch === "Very High" ? "100%" : audienceMatch === "High" ? "75%" : "50%" }} /> | ||
| </div> |
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.
Align progress width with the ARIA value for unknown audience labels.
When audienceMatch is unrecognized, aria-valuenow becomes 0 but the bar still renders at 50%. That’s inconsistent visually and for assistive tech.
✅ Suggested fix
-const AudienceMatchBar: React.FC<{audienceMatch: string}> = ({ audienceMatch }) => (
+const AudienceMatchBar: React.FC<{audienceMatch: string}> = ({ audienceMatch }) => (
+ const percent =
+ audienceMatch === "Very High" ? 100 :
+ audienceMatch === "High" ? 75 :
+ audienceMatch === "Good" ? 50 : 0;
<div className="w-full mb-3 space-y-2">
<div className="flex items-center justify-between">
<span className="text-xs text-gray-500">Audience Match</span>
<span className="font-semibold text-xs text-gray-700">{audienceMatch}</span>
</div>
- <div className="w-full h-2 rounded bg-gray-200" role="progressbar" aria-valuenow={audienceMatch === 'Very High' ? 100 : audienceMatch === 'High' ? 75 : audienceMatch === 'Good' ? 50 : 0} aria-valuemin={0} aria-valuemax={100}>
- <div className={`h-2 rounded ${getAudienceMatchColor(audienceMatch)}`} style={{ width: audienceMatch === "Very High" ? "100%" : audienceMatch === "High" ? "75%" : "50%" }} />
+ <div className="w-full h-2 rounded bg-gray-200" role="progressbar" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}>
+ <div className={`h-2 rounded ${getAudienceMatchColor(audienceMatch)}`} style={{ width: `${percent}%` }} />
</div>
</div>
);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const AudienceMatchBar: React.FC<{audienceMatch: string}> = ({ audienceMatch }) => ( | |
| <div className="flex items-center gap-2 w-full justify-center mb-2"> | |
| <span className="text-xs text-gray-500">Audience Match</span> | |
| <span className="font-semibold text-xs text-gray-700">{audienceMatch}</span> | |
| <div className="flex-1 h-2 rounded bg-gray-200 mx-2 min-w-[60px] max-w-[80px]" role="progressbar" aria-valuenow={audienceMatch === 'Very High' ? 100 : audienceMatch === 'High' ? 75 : audienceMatch === 'Good' ? 50 : 0} aria-valuemin={0} aria-valuemax={100}> | |
| <div className="w-full mb-3 space-y-2"> | |
| <div className="flex items-center justify-between"> | |
| <span className="text-xs text-gray-500">Audience Match</span> | |
| <span className="font-semibold text-xs text-gray-700">{audienceMatch}</span> | |
| </div> | |
| <div className="w-full h-2 rounded bg-gray-200" role="progressbar" aria-valuenow={audienceMatch === 'Very High' ? 100 : audienceMatch === 'High' ? 75 : audienceMatch === 'Good' ? 50 : 0} aria-valuemin={0} aria-valuemax={100}> | |
| <div className={`h-2 rounded ${getAudienceMatchColor(audienceMatch)}`} style={{ width: audienceMatch === "Very High" ? "100%" : audienceMatch === "High" ? "75%" : "50%" }} /> | |
| </div> | |
| const AudienceMatchBar: React.FC<{audienceMatch: string}> = ({ audienceMatch }) => { | |
| const percent = | |
| audienceMatch === "Very High" ? 100 : | |
| audienceMatch === "High" ? 75 : | |
| audienceMatch === "Good" ? 50 : 0; | |
| return ( | |
| <div className="w-full mb-3 space-y-2"> | |
| <div className="flex items-center justify-between"> | |
| <span className="text-xs text-gray-500">Audience Match</span> | |
| <span className="font-semibold text-xs text-gray-700">{audienceMatch}</span> | |
| </div> | |
| <div className="w-full h-2 rounded bg-gray-200" role="progressbar" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}> | |
| <div className={`h-2 rounded ${getAudienceMatchColor(audienceMatch)}`} style={{ width: `${percent}%` }} /> | |
| </div> | |
| </div> | |
| ); | |
| }; |
🤖 Prompt for AI Agents
In `@Frontend/src/components/collaboration-hub/CreatorMatchCard.tsx` around lines
44 - 52, AudienceMatchBar renders an inconsistent progress state for unknown
audience labels: aria-valuenow falls back to 0 but the inner bar width falls
back to 50%, confusing assistive tech and visuals. Fix AudienceMatchBar by
computing a single numeric matchValue (e.g., 100, 75, 50, or 0) from
audienceMatch (use a small map or switch) and use that value both for
aria-valuenow and for the inline style width (e.g., `${matchValue}%`); keep
using getAudienceMatchColor(audienceMatch) for color only so unknown labels show
0% width and aria-valuenow=0 consistently.
Fixed overlapping text and UI elements in creator match cards by:
Closes #
📝 Description
🔧 Changes Made
📷 Screenshots or Visual Changes (if applicable)
🤝 Collaboration
Collaborated with:
@username(optional)✅ Checklist
Summary by CodeRabbit
Release Notes
New Features
Improvements