-
Notifications
You must be signed in to change notification settings - Fork 443
Add copy button to table cell values for IPs and identifiers in detail and list views #3984
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?
Conversation
Co-authored-by: joaquimrocha <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…d Pod details Co-authored-by: joaquimrocha <[email protected]>
Co-authored-by: joaquimrocha <[email protected]>
It's getting there. Can we also have a copy button in the list views (tables) when the value is of interest? |
@copilot Can you iterate after my previous message? |
…, Endpoints, EndpointSlices) Co-authored-by: joaquimrocha <[email protected]>
I've added copy buttons to the list views! The changes are in commit fd523b6. Copy buttons now appear on hover for IP addresses in:
ScreenshotsPod List View with Copy Buttons: The copy button appears when hovering over IP addresses in the list, making it easy to copy values directly from the table without opening the detail view. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
className="copy-button" | ||
component="span" | ||
sx={{ | ||
opacity: 0, |
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.
this box is always invisible and why does it have className
Overview
This PR adds a copy button feature to table cells that contain values users commonly need to copy, such as IP addresses, resource names, and other identifiers. The copy button appears on hover, providing quick access without cluttering the UI in both detail views and list views.
Problem
Users frequently need to copy values from tables (like IP addresses, resource IDs, etc.) to use in other tools or commands. Previously, users had to manually select and copy text, which can be cumbersome especially for long strings or when precision is important.
Solution
New Components
CopyLabel Component
CopyButton
component with icon styleNameValueTable Enhancement
copyValue
property toNameValueTableRow
interfacecopyValue
is provided, the value is automatically wrapped withCopyLabel
copyValue
work as beforeValues with Copy Buttons
Detail Views:
List Views:
Usage
Adding a copy button to new values is straightforward:
For NameValueTable rows:
For ResourceListView columns:
Screenshots
CopyLabel Component in Storybook
The component shows the value with a copy button that appears on hover.
NameValueTable with Copyable Values
Demonstrates how IP addresses and pod names have copy buttons while regular values don't.
Service Details Page
The Service details page now shows copy buttons for Cluster IP and External IP when hovering over those values.
Pod List View with Copy Buttons
The Pod list view shows copy buttons on hover for IP addresses in the IP column, making it easy to copy values directly from the table.
Testing
Design Decisions
Fixes the issue by providing users with a quick, reliable way to copy important values from both detail views and list views without manual text selection.
Warning
storybook.js.org
node /home/REDACTED/work/headlamp/headlamp/frontend/node_modules/.bin/storybook dev -p 6006
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Fixes #3983
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.