Skip to content

spyglass/junit: add copy-to-clipboard widget for test names - #832

Open
petr-muller wants to merge 1 commit into
kubernetes-sigs:mainfrom
petr-muller:clip-test-name-in-junit
Open

spyglass/junit: add copy-to-clipboard widget for test names#832
petr-muller wants to merge 1 commit into
kubernetes-sigs:mainfrom
petr-muller:clip-test-name-in-junit

Conversation

@petr-muller

Copy link
Copy Markdown
Contributor

Test names in the JUnit lens are rendered as "ClassName: Name", which is awkward to select by hand and yields a string that needs editing before it can be used as a test filter or a search term.

Add a small copy icon next to every test name that puts the bare test name on the clipboard. The name is carried in a data attribute rather than scraped from the cell, since the cell also holds the expander arrow and, for skipped tests, the skip reason. The icon only appears on row hover.

Click handling is delegated to a single listener on the container, since a run can have thousands of tests and thus thousands of copy icons. It runs in the capture phase: the row's own expand/collapse handler is bound directly to the row, which sits between the icon and the container, so a bubble-phase listener here would run after the row's handler already fired. Capturing lets us stop the click before it gets there.

Assisted by Claude Code

Test names in the JUnit lens are rendered as "ClassName: Name", which is
awkward to select by hand and yields a string that needs editing before it
can be used as a test filter or a search term.

Add a small copy icon next to every test name that puts the bare test name
on the clipboard. The name is carried in a data attribute rather than
scraped from the cell, since the cell also holds the expander arrow and,
for skipped tests, the skip reason. The icon only appears on row hover.

Click handling is delegated to a single listener on the container, since a
run can have thousands of tests and thus thousands of copy icons. It runs
in the capture phase: the row's own expand/collapse handler is bound
directly to the row, which sits between the icon and the container, so a
bubble-phase listener here would run after the row's handler already fired.
Capturing lets us stop the click before it gets there.
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the area/spyglass Issues or PRs related to prow's spyglass UI label Aug 11, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from smg247 August 11, 2026 12:10
@kubernetes-prow kubernetes-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 11, 2026
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for k8s-prow ready!

Name Link
🔨 Latest commit 54de4a5
🔍 Latest deploy log https://app.netlify.com/projects/k8s-prow/deploys/6a7b1141669db50008901d11
😎 Deploy Preview https://deploy-preview-832--k8s-prow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow kubernetes-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 11, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

@petr-muller: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-prow-unit-test-race-detector-nonblocking 54de4a5 link false /test pull-prow-unit-test-race-detector-nonblocking

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@BenTheElder BenTheElder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you share an example screenshot?

My TS is rusty but this looks OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/spyglass Issues or PRs related to prow's spyglass UI cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants