Skip to content

Remove Vanara; improve clipboard handling and feedback - #225

Merged
Timthreetwelve merged 2 commits into
mainfrom
Clipboard
Jul 7, 2026
Merged

Remove Vanara; improve clipboard handling and feedback#225
Timthreetwelve merged 2 commits into
mainfrom
Clipboard

Conversation

@Timthreetwelve

Copy link
Copy Markdown
Owner

Replaced Vanara clipboard code with WPF Clipboard API and retry logic. Added localized message and UI feedback for clipboard failures. Updated Readme to remove Vanara dependency.

Replaced Vanara clipboard code with WPF Clipboard API and retry logic. Added localized message and UI feedback for clipboard failures. Updated Readme to remove Vanara dependency.
Copilot AI review requested due to automatic review settings July 7, 2026 16:08

Copilot AI 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.

Pull request overview

This PR removes the Vanara-based clipboard implementation and shifts clipboard operations to the WPF Clipboard API, adding retry handling and user-facing failure messaging, plus updating documentation/dependencies accordingly.

Changes:

  • Replaced Vanara clipboard interop with WPF Clipboard.SetText plus retry logic.
  • Added a localized snackbar message for clipboard failures in the main “Copy to clipboard” command path.
  • Removed the Vanara NuGet/package documentation references.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
GetMyIP/ViewModels/NavigationViewModel.cs Adds snackbar feedback when the main copy-to-clipboard command fails.
GetMyIP/Helpers/ClipboardHelper.cs Replaces Vanara P/Invoke clipboard code with WPF Clipboard API + retry loop.
GetMyIP/Languages/Strings.en-US.xaml Adds a new localized string for clipboard failure feedback.
GetMyIP/GetMyIP.csproj Removes the Vanara package reference.
GetMyIP/Readme.txt Removes Vanara from the documented dependency list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread GetMyIP/Helpers/ClipboardHelper.cs
Comment on lines 187 to 191
else
{
_log.Error("CopyToClipboard failed.");
SnackBarMsg.ClearAndQueueMessage(GetStringResource("MsgText_CopyToClipboardFail"));
}

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.

Fixed in commit Add clipboard failure feedback to RightMouseUp in NavigationViewModel. Added an else clause to RightMouseUp that logs the failure and shows the MsgText_CopyToClipboardFail snackbar, matching the pattern used in CopyToClipboard().

@Timthreetwelve
Timthreetwelve merged commit dd49293 into main Jul 7, 2026
2 checks passed
@Timthreetwelve
Timthreetwelve deleted the Clipboard branch July 7, 2026 16:19
Copilot stopped work on behalf of Timthreetwelve due to an error July 7, 2026 16:20
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