Skip to content

Add PostHog Feedback button to workspace header and align Share styling#374

Merged
urjitc merged 2 commits into
mainfrom
capy/feedback-button-posthog
Apr 15, 2026
Merged

Add PostHog Feedback button to workspace header and align Share styling#374
urjitc merged 2 commits into
mainfrom
capy/feedback-button-posthog

Conversation

@urjitc

@urjitc urjitc commented Apr 15, 2026

Copy link
Copy Markdown
Member

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 the Share2 icon and removing the unnecessary relative class. No custom dialog is needed — PostHog handles the survey UI automatically when the element is clicked.

  • src/components/workspace-canvas/WorkspaceHeader.tsx: Added MessageSquareText icon import, inserted Feedback button with data-attr="feedback-button" between CollaboratorAvatars and Share, and updated Share button to include Share2 icon while removing the relative className.

Open in Capy ENG-50 · 5.4

Summary by CodeRabbit

  • New Features

    • Added a Feedback button to the workspace header for submitting user feedback directly.
  • Style

    • Updated the Share button with improved icon display for better visual clarity.

@urjitc urjitc added the capy Generated by capy.ai label Apr 15, 2026 — with Capy AI
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
thinkex Canceled Canceled Apr 15, 2026 11:13pm

Request Review

@github-project-automation github-project-automation Bot moved this to Backlog in Dev Board Apr 15, 2026
@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@urjitc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 10 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea98d865-538c-4489-9f1c-46b65ff5c528

📥 Commits

Reviewing files that changed from the base of the PR and between 5583720 and 6c66431.

📒 Files selected for processing (1)
  • src/components/workspace-canvas/WorkspaceHeader.tsx
📝 Walkthrough

Walkthrough

A 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

Cohort / File(s) Summary
Workspace Header UI Updates
src/components/workspace-canvas/WorkspaceHeader.tsx
Added MessageSquareText icon import and inserted a new "Feedback" ghost button with data attribute. Updated "Share" button to include Share2 icon and removed relative class. Updated comment for "New" button for clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A feedback button hops into view,
Sharing becomes easier too!
With icons so bright, both message and share,
The workspace now whispers "we listen with care!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 describes the main changes: adding a Feedback button to the workspace header and aligning Share button styling, matching the primary modifications in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch capy/feedback-button-posthog

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.

@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a PostHog-triggered Feedback button (using data-attr="feedback-button" for CSS-selector targeting) to the workspace header, and cleans up the Share button by adding the Share2 icon and removing the orphaned relative class. The changes are straightforward and well-scoped to the default-mode controls section of WorkspaceHeader.

Confidence Score: 5/5

Safe 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

Filename Overview
src/components/workspace-canvas/WorkspaceHeader.tsx Adds a PostHog-targeted Feedback button and a Share2 icon to the Share button; removes orphaned relative class from Share. Changes are minimal and scoped to the default-mode controls section.

Fix All in Cursor

Reviews (1): Last reviewed commit: "Add PostHog Feedback button and align Sh..." | Re-trigger Greptile

Comment on lines +1103 to +1111
<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
<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.

Fix in Cursor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Auto-approved: Isolated UI enhancement: adds a Feedback button and an icon to the Share button. Minimal risk to core logic or infrastructure.

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
@urjitc
urjitc merged commit 7de7b4a into main Apr 15, 2026
5 of 6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Dev Board Apr 15, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Auto-approved: This is a low-risk UI update that adds a feedback button and standardizes header button styling without impacting core business logic or data integrity.

@urjitc
urjitc deleted the capy/feedback-button-posthog branch June 29, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant