Skip to content

Conversation

andreaskienle
Copy link
Contributor

@andreaskienle andreaskienle commented Sep 9, 2025

This PR fixes the issue where the UI indicated that text had been successfully copied to the clipboard when it had not.

It also refactors the clipboard functionality into a reusable hook.

@Copilot Copilot AI review requested due to automatic review settings September 9, 2025 13:36
Copilot

This comment was marked as outdated.

andreaskienle and others added 2 commits September 9, 2025 15:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 refactors clipboard functionality across the application by centralizing it into a reusable hook. The purpose is to standardize clipboard operations, error handling, and user feedback throughout the codebase.

  • Introduces a new useCopyToClipboard hook that provides consistent clipboard functionality with proper error handling and toast notifications
  • Replaces inline clipboard implementations across multiple components with the centralized hook
  • Consolidates translation keys for clipboard-related messages

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/hooks/useCopyToClipboard.ts New hook providing centralized clipboard functionality with error handling and toast notifications
src/components/Yaml/YamlViewer.tsx Refactored to use the new clipboard hook instead of inline implementation
src/components/Shared/CopyButton.tsx Updated to use the centralized hook and standardized translation keys
src/components/Dialogs/KubectlCommandInfo/KubectlTerminal.tsx Simplified clipboard implementation using the new hook
src/components/ControlPlanes/CopyKubeconfigButton.tsx Replaced manual clipboard handling with the centralized hook
public/locales/en.json Consolidated clipboard-related translation keys into common section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@andreaskienle andreaskienle changed the title Refactor and fix clipboard fix: Refactor and fix clipboard Sep 10, 2025
Copy link
Contributor

@lucasgoral lucasgoral left a comment

Choose a reason for hiding this comment

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

good job!

@lucasgoral lucasgoral merged commit b015d7c into main Sep 23, 2025
5 checks passed
@lucasgoral lucasgoral deleted the clipboard branch September 23, 2025 13:18
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