Skip to content

fix(ui): native tooltip on truncated copy chips - #3196

Open
SirTenzin wants to merge 1 commit into
devfrom
capy/native-tooltip-on-truncated
Open

fix(ui): native tooltip on truncated copy chips#3196
SirTenzin wants to merge 1 commit into
devfrom
capy/native-tooltip-on-truncated

Conversation

@SirTenzin

@SirTenzin SirTenzin commented Sep 1, 2026

Copy link
Copy Markdown
Member

Problem

ID chips in the customer product sheet (Sub ID, Stripe ID, etc.) truncate long values with an ellipsis, but hovering them showed nothing — the truncating span had no title, so there was no way to see the full value without copying it.

Change

  • CopyButton / MiniCopyButton (packages/ui/src/components/general/copy-button.tsx): add title={text} to the truncating label span so the browser's native tooltip shows the full value on hover.
  • CopyTextButton (copy-text-button.tsx): same title={text} on the button for parity.

The existing Radix "Copied!" tooltip is controlled (open={copied}) and unaffected.


Summary by cubic

Adds a native browser tooltip to truncated ID chips in the customer product sheet so hovering shows the full value instead of nothing.

Written for commit 8bd21ed. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated
checkout Ignored Ignored Sep 1, 2026 6:47pm UTC
landing-page Ignored Ignored Sep 1, 2026 6:47pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T18:48:34.121734Z 8bd21ed PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@capy-ai capy-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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bd21edf30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

className={cn("", props.className)}
>
<span className={cn("truncate", innerClassName)}>
<span title={text} className={cn("truncate", innerClassName)}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve caller-provided tooltip text

When a caller supplies its own title, this nested title takes precedence while the pointer is over the label. In CustomerPageDetails.tsx, the always-rendered ID button deliberately uses title="This user's id is undefined" when the ID is absent while passing text="PENDING"; after this change, hovering the label shows only “PENDING” and hides the explanatory tooltip. Use the caller-provided title when present rather than unconditionally overriding it with text.

Useful? React with 👍 / 👎.


return (
<Button
title={text}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid putting full JSON payloads in the icon tooltip

For icon-only uses, text is the clipboard payload rather than a truncated visible label. In WorkbenchJsonViewer.tsx, this component receives the complete JSON.stringify(data, null, 2) result, so merely hovering the small copy icon now opens a native tooltip containing the entire response, which can be extremely large and obscure the workbench. Limit the full-value title to instances with a truncated text child, or provide a short icon-only title such as “Copy”.

Useful? React with 👍 / 👎.

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

2 issues found across 2 files

Confidence score: 4/5

  • In packages/ui/src/components/general/copy-button.tsx, the nested title={text} can override a caller-provided tooltip, hiding guidance such as the missing-ID explanation; preserve the caller’s label tooltip when supplied.
  • In packages/ui/src/components/general/copy-text-button.tsx, using the full clipboard payload as the icon-only button’s native title can expose enormous JSON tooltips and degrade usability; use a short title such as "Copy" instead.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/ui/src/components/general/copy-button.tsx">

<violation number="1" location="packages/ui/src/components/general/copy-button.tsx:106">
P2: Preserve the caller's tooltip on the label when one is provided. Otherwise, the nested `title={text}` replaces messages such as the missing-ID explanation while hovering the label.</violation>
</file>

<file name="packages/ui/src/components/general/copy-text-button.tsx">

<violation number="1" location="packages/ui/src/components/general/copy-text-button.tsx:32">
P2: Use a short title such as `"Copy"` for this icon-only button instead of exposing the entire clipboard payload. `CopyTextButton` receives complete JSON responses, so `title={text}` can produce an enormous native tooltip over the workbench.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

className={cn("", props.className)}
>
<span className={cn("truncate", innerClassName)}>
<span title={text} className={cn("truncate", innerClassName)}>

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: Preserve the caller's tooltip on the label when one is provided. Otherwise, the nested title={text} replaces messages such as the missing-ID explanation while hovering the label.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/ui/src/components/general/copy-button.tsx, line 106:

<comment>Preserve the caller's tooltip on the label when one is provided. Otherwise, the nested `title={text}` replaces messages such as the missing-ID explanation while hovering the label.</comment>

<file context>
@@ -103,7 +103,7 @@ export const CopyButton = ({
 						className={cn("", props.className)}
 					>
-						<span className={cn("truncate", innerClassName)}>
+						<span title={text} className={cn("truncate", innerClassName)}>
 							{children ?? text}
 						</span>
</file context>
Suggested change
<span title={text} className={cn("truncate", innerClassName)}>
<span title={props.title ?? text} className={cn("truncate", innerClassName)}>


return (
<Button
title={text}

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: Use a short title such as "Copy" for this icon-only button instead of exposing the entire clipboard payload. CopyTextButton receives complete JSON responses, so title={text} can produce an enormous native tooltip over the workbench.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/ui/src/components/general/copy-text-button.tsx, line 32:

<comment>Use a short title such as `"Copy"` for this icon-only button instead of exposing the entire clipboard payload. `CopyTextButton` receives complete JSON responses, so `title={text}` can produce an enormous native tooltip over the workbench.</comment>

<file context>
@@ -29,6 +29,7 @@ export function CopyTextButton({
 
 	return (
 		<Button
+			title={text}
 			variant={variant as ButtonProps["variant"]}
 			size="icon"
</file context>
Suggested change
title={text}
title="Copy"

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.

1 participant