Skip to content
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

Copy annotation text in HTML report #30749

Closed

Conversation

amankagithub
Copy link
Contributor

Feature Request : #30141

In this PR I have added changes required to make annotation text be copied in one click .

Annotation
Screenshot 2024-05-11 at 1 12 14 PM

On hover

Screenshot 2024-05-11 at 1 12 21 PM

On copy
Screenshot 2024-05-11 at 1 12 34 PM

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [firefox-page] › page/page-request-continue.spec.ts:481:3 › continue should not change multipart/form-data body

2 flaky ⚠️ [chromium-library] › library/capabilities.spec.ts:141:3 › should not crash on showDirectoryPicker
⚠️ [webkit-library] › library/screenshot.spec.ts:217:14 › element screenshot › element screenshot should work with device scale factor

27028 passed, 610 skipped
✔️✔️✔️

Merge workflow run.

display: none;
}

.test-case-annotation:hover .annotation-copy-button{
Copy link
Member

Choose a reason for hiding this comment

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

Sounds like you would need this dance for every copy button application. Would it be possible to do something like this to encapsulate these styles:

<CopyToClipboardContainer description={description}>
  <span className='annotation-copy-button'/>
</CopyToClipboardContainer>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not every copy button , just for this annotation copy button . We want to display the copy button only when we hover over the text . Could you please help me with how your approach would help in this use case ?

Copy link
Member

Choose a reason for hiding this comment

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

The CopyToClipboardContainer container would position the copy button after its children and make it visible upon hover.

return description;
}

function TestCaseAnnotationView({ annotation: { type, description } }: { annotation: TestCaseAnnotation }) {
return (
<div className='test-case-annotation'>
<span style={{ fontWeight: 'bold' }}>{type}</span>
<span style={{ fontWeight: 'bold', display: 'inline-block', marginBlock: '3px' }}>{type}</span>
Copy link
Member

Choose a reason for hiding this comment

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

display: 'inline-block' - what else would this span be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default span will be inline . I needed to add some margin to solve following problem

without-display-property.mp4
with-display-property.mp4

Copy link
Member

Choose a reason for hiding this comment

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

I was hoping it would go away with the container approach.

@dgozman
Copy link
Contributor

dgozman commented Jun 20, 2024

Closing this as stale. If you still want to pursue this change, please reopen or create a new PR and link to this one.

@dgozman dgozman closed this Jun 20, 2024
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.

None yet

3 participants