Changed the Clipboard Get and Set logic.#4220
Conversation
WalkthroughThis update replaces direct system clipboard API calls with encapsulated helper methods for setting and getting clipboard text in chat-related and UI automation components. Additional debug logging is introduced for clipboard operations, and clipboard retrieval is refactored to include a fallback mechanism using a separate STA-thread with improved exception handling. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatbotWindow
participant GingerCore.General
User->>ChatbotWindow: Clicks "Copy" or "Copy All"
ChatbotWindow->>GingerCore.General: SetClipboardText(text)
GingerCore.General-->>ChatbotWindow: Clipboard updated
sequenceDiagram
participant UIAutomation
participant GingerCore.General
participant Clipboard (STA Thread)
UIAutomation->>GingerCore.General: GetClipboardText()
alt Clipboard text available
GingerCore.General-->>UIAutomation: Return clipboard text
else Clipboard text not available
GingerCore.General->>Clipboard (STA Thread): GetText(TextDataFormat.Text)
Clipboard (STA Thread)-->>GingerCore.General: Return clipboard text or exception
GingerCore.General-->>UIAutomation: Return clipboard text or log error
end
Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (4)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
We experienced an issue while reading the Clipboard text on Azure Cloud Hosted VDI Windows Server.
To fix this, using a fallback mechanism to read Clipboard text using a different git nugget.
Before submitting this PR, please make sure:
Summary by CodeRabbit
Refactor
Bug Fixes