Add PostHog Feedback button to workspace header and align Share styling#374
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 10 seconds. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new "Feedback" button with a message icon is added to the workspace header's action row. The "Share" button styling is updated with the Share2 icon and minor class adjustments. Comments around the "New" button are clarified. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Greptile SummaryAdds a PostHog-triggered Feedback button (using Confidence Score: 5/5Safe to merge — only UI additions with no logic changes or regressions. The single P2 finding (no onClick fallback for when PostHog is unavailable) is a UX hardening suggestion and does not affect correctness or existing functionality. All other changes are clean and intentional. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Add PostHog Feedback button and align Sh..." | Re-trigger Greptile |
| <Button | ||
| variant="ghost" | ||
| size="sm" | ||
| className="h-8 px-2 text-muted-foreground hover:text-foreground font-normal" | ||
| data-attr="feedback-button" | ||
| > | ||
| <MessageSquareText className="h-4 w-4" /> | ||
| Feedback | ||
| </Button> |
There was a problem hiding this comment.
Silent no-op when PostHog is blocked
The button has no onClick handler — interaction is entirely delegated to PostHog's CSS-selector listener. If PostHog fails to load (ad blockers, network issues), users will see a clickable button that silently does nothing. Consider adding a minimal fallback or, at least, a tooltip that hints at the purpose so users aren't confused.
| <Button | |
| variant="ghost" | |
| size="sm" | |
| className="h-8 px-2 text-muted-foreground hover:text-foreground font-normal" | |
| data-attr="feedback-button" | |
| > | |
| <MessageSquareText className="h-4 w-4" /> | |
| Feedback | |
| </Button> | |
| <Button | |
| variant="ghost" | |
| size="sm" | |
| className="h-8 px-2 text-muted-foreground hover:text-foreground font-normal" | |
| data-attr="feedback-button" | |
| onClick={() => { | |
| // PostHog survey attaches via [data-attr="feedback-button"]; | |
| // this is a no-op fallback if PostHog is unavailable. | |
| }} | |
| > |
Alternatively, wire up the PostHog JS API (posthog.capture or posthog.getActiveMatchingSurveys) so the survey can be triggered programmatically as a fallback.
Extract shared bordered toolbar tokens for Search and New so they stay visually consistent. Style Feedback and Share as minimal text buttons (borderless, color-only hover) with lighter padding. Keep controls in a single gap-2 row: avatars, Feedback, Share, Search, New, then chat. Made-with: Cursor
This PR adds a Feedback button to the workspace header that triggers a PostHog survey via CSS selector targeting
[data-attr="feedback-button"], and aligns the Share button styling by adding theShare2icon and removing the unnecessaryrelativeclass. No custom dialog is needed — PostHog handles the survey UI automatically when the element is clicked.MessageSquareTexticon import, inserted Feedback button withdata-attr="feedback-button"between CollaboratorAvatars and Share, and updated Share button to includeShare2icon while removing therelativeclassName.Summary by CodeRabbit
New Features
Style