Skip to content

DYN-8326 - copy to clipboard button for warning bubble #16304

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

Merged
merged 13 commits into from
Jun 24, 2025

Conversation

jasonstratton
Copy link
Contributor

@jasonstratton jasonstratton commented Jun 17, 2025

Purpose

(FILL ME IN) This section describes why this PR is here. Usually it would include a reference to the tracking task that it is part or all of the solution for.

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

Added a button to the InfoBubble to copy the text from the InfoBubble to the clipboard

Reviewers

Copilot
Aparajit
Ashish
Reddy

FYIs

Aaron

Complete implementation, but the images need to be updated
Removed extraneous dir from .gitignore
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8326

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a “copy to clipboard” button to the InfoBubble’s error, warning, and info sections, implements a corresponding command in the view model, and wires up tooltip text and image resources.

  • Introduce CopyToClipboardCommand in InfoBubbleViewModel with CopyTextToClipboard and CanCopyToClipboard logic
  • Add copy buttons with hover/normal images and tooltip in three XAML sections
  • Register new tooltip string in .resx files and include image assets in the project file

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/DynamoCoreWpf/Views/Preview/InfoBubbleView.xaml Added three copy-to-clipboard buttons in the error, warning, and info sections
src/DynamoCoreWpf/ViewModels/Preview/InfoBubbleViewModel.cs Defined CopyToClipboardCommand, copy logic, and can-execute check
src/DynamoCoreWpf/Properties/Resources.resx Added CopyToClipboardTooltip string
src/DynamoCoreWpf/Properties/Resources.en-US.resx Added locale entry for CopyToClipboardTooltip
src/DynamoCoreWpf/DynamoCoreWpf.csproj Included copy_normal.png and copy_hover.png as resources
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)

src/DynamoCoreWpf/ViewModels/Preview/InfoBubbleViewModel.cs:524

  • There are no tests covering CopyToClipboardCommand, CopyTextToClipboard, or CanCopyToClipboard. Adding unit tests for both success and failure scenarios will help ensure clipboard logic and analytics tracking remain reliable.
        private void CopyTextToClipboard(object parameter)

src/DynamoCoreWpf/Properties/Resources.en-US.resx:450

  • The new <data> element appears inserted without matching indentation and may have a mismatched closing tag. Verify the XML structure and alignment match existing entries so the resource file parses correctly.
    <data name="CopyToClipboardTooltip" xml:space="preserve">

HorizontalAlignment="Right"
VerticalAlignment="Center"
BorderThickness="0"
Command="{Binding ElementName=InfoBubbleWindowUserControl, Path=DataContext.CopyToClipboardCommand}"
Copy link
Preview

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

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

The ElementName binding refers to 'InfoBubbleWindowUserControl', but the root UserControl has no x:Name set. This will break the Command binding at runtime. Consider adding x:Name="InfoBubbleWindowUserControl" on the root or switch to a RelativeSource binding to the view model.

Copilot uses AI. Check for mistakes.

@jasonstratton
Copy link
Contributor Author

jasonstratton commented Jun 17, 2025

Looks like I need to update the description with release notes, etc when I update the images (failed PR Description check)

@jasonstratton
Copy link
Contributor Author

It did not appear that this would be conducive to unit tests, but I could probably use some guidance in that area, including where to add any tests.

I think it will be more appropriate to write an AGT test and will do so after the PR is merged.

@jasonstratton
Copy link
Contributor Author

Looks like there is an issue with declaring this as part of the API? I will need some guidance there as well.

@zeusongit
Copy link
Contributor

Looks like there is an issue with declaring this as part of the API? I will need some guidance there as well.

You will have to declare the public APIs in the log, you can use the Visual Studio suggestion to do it for you, or add it manually:
Screenshot 2025-06-17 at 11 07 27 PM

@zeusongit
Copy link
Contributor

Some minor comments, and I think you can now update the PR description

@jasonstratton jasonstratton merged commit 0ae8219 into DynamoDS:master Jun 24, 2025
27 of 28 checks passed
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.

3 participants