-
Notifications
You must be signed in to change notification settings - Fork 11.7k
refactor: use Button component instead of plain button in CopyButton #25489
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
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| <> | ||
| {variant === "fab" ? ( | ||
| <> | ||
| <Icon name={StartIcon} className="hidden h-4 w-4 stroke-[1.5px] md:inline-flex" /> |
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.
without shrink-0, ... the icon shrinks.
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.
No issues found across 2 files
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.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/features/insights/hooks/useInsightsColumns.tsx">
<violation number="1" location="packages/features/insights/hooks/useInsightsColumns.tsx:354">
P2: Without the previous w-full constraint the Button expands to the full label/URL width, so long booking URLs are no longer truncated and the column layout breaks.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| <Button | ||
| color="minimal" | ||
| size="sm" | ||
| className="overflow-hidden" |
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.
P2: Without the previous w-full constraint the Button expands to the full label/URL width, so long booking URLs are no longer truncated and the column layout breaks.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/insights/hooks/useInsightsColumns.tsx, line 354:
<comment>Without the previous w-full constraint the Button expands to the full label/URL width, so long booking URLs are no longer truncated and the column layout breaks.</comment>
<file context>
@@ -349,24 +348,16 @@ function CopyButton({ label, value }: { label: string; value: string }) {
+ <Button
+ color="minimal"
+ size="sm"
+ className="overflow-hidden"
+ tooltip={value}
+ EndIcon={isCopied ? "check" : "clipboard"}
</file context>
| className="overflow-hidden" | |
| className="w-full overflow-hidden" |
What does this PR do?
Improves the
CopyButtoncomponent inpackages/features/insights/hooks/useInsightsColumns.tsxby replacing the plain<button>element with the<Button>component from@calcom/ui/components/button.Changes:
<button>with<Button color="minimal" size="sm">for consistent stylingtitleattribute totooltipprop for better UXEndIconprop instead of manually rendering<Icon>componentIconimportDemo
Before
Screenshot.2025-12-01.at.11.37.10.mp4
After
Screenshot.2025-12-01.at.11.35.09.mp4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Requested by: @eunjae-lee (eunjae@cal.com)
Link to Devin run: https://app.devin.ai/sessions/c806c43296a14eeea22ff0bfcdc3d5b2
Summary by cubic
Refactored CopyButton to use the shared Button component for consistent styling and a cleaner UX in Insights. Aligns with Linear 1764584191 by standardizing the copy action UI.
Written for commit fafb132. Summary will update automatically on new commits.