From bca330c090028b8d6f7ce0f3e3449768d7ddc780 Mon Sep 17 00:00:00 2001 From: RenzoMXD <170978465+RenzoMXD@users.noreply.github.com> Date: Thu, 21 May 2026 19:59:26 +0200 Subject: [PATCH 1/2] fix(settings): show 'Copied!' feedback on API key copy button The api_keys show/created views wired DS::Button to clipboard#copy without supplying the iconDefault/iconSuccess targets that clipboard_controller#showSuccess expects. The clipboard write succeeded but showSuccess threw on the missing target, so users saw no visual confirmation. Wrap each Copy button in iconDefault/iconSuccess spans containing a "Copy API Key" / "Copied!" pair of DS::Buttons, matching the existing pattern in mfa/new, invite_codes, and settings/profiles. The icon and label swap for ~3s after copy, then revert. Fixes #1563 --- app/views/settings/api_keys/created.html.erb | 22 +++++++--- app/views/settings/api_keys/show.html.erb | 44 ++++++++++++++----- config/locales/views/settings/api_keys/en.yml | 3 ++ 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/app/views/settings/api_keys/created.html.erb b/app/views/settings/api_keys/created.html.erb index d0c4e7bcab..0d79d3a895 100644 --- a/app/views/settings/api_keys/created.html.erb +++ b/app/views/settings/api_keys/created.html.erb @@ -24,12 +24,22 @@
<%= @api_key.plain_key %> - <%= render DS::Button.new( - text: t(".copy_key"), - variant: "ghost", - icon: "copy", - data: { action: "clipboard#copy" } - ) %> + + <%= render DS::Button.new( + text: t(".copy_key"), + variant: "ghost", + icon: "copy", + data: { action: "clipboard#copy" } + ) %> + +
diff --git a/app/views/settings/api_keys/show.html.erb b/app/views/settings/api_keys/show.html.erb index c32e87349b..d44ad5a1a0 100644 --- a/app/views/settings/api_keys/show.html.erb +++ b/app/views/settings/api_keys/show.html.erb @@ -25,12 +25,22 @@
<%= @current_api_key.plain_key %> - <%= render DS::Button.new( - text: t(".newly_created.copy_api_key"), - variant: "ghost", - icon: "copy", - data: { action: "clipboard#copy" } - ) %> + + <%= render DS::Button.new( + text: t(".newly_created.copy_api_key"), + variant: "ghost", + icon: "copy", + data: { action: "clipboard#copy" } + ) %> + +
@@ -113,12 +123,22 @@
<%= @current_api_key.plain_key %> - <%= render DS::Button.new( - text: t(".current_api_key.copy_api_key"), - variant: "ghost", - icon: "copy", - data: { action: "clipboard#copy" } - ) %> + + <%= render DS::Button.new( + text: t(".current_api_key.copy_api_key"), + variant: "ghost", + icon: "copy", + data: { action: "clipboard#copy" } + ) %> + +
diff --git a/config/locales/views/settings/api_keys/en.yml b/config/locales/views/settings/api_keys/en.yml index ebc072b88b..5b135400ea 100644 --- a/config/locales/views/settings/api_keys/en.yml +++ b/config/locales/views/settings/api_keys/en.yml @@ -38,6 +38,7 @@ en: your_api_key: "Your API Key" copy_store_securely: "Copy and store this key securely. You'll need it to authenticate your API requests." copy_api_key: "Copy API Key" + copied: "Copied!" how_to_use: "How to use your API key" continue: "Continue to API Key Settings" current_api_key: @@ -57,6 +58,7 @@ en: scope_read_only: "Read Only" scope_read_write: "Read/Write" copy_api_key: "Copy API Key" + copied: "Copied!" copy_store_securely: "Copy and store this key securely. You'll need it to authenticate your API requests." usage_instructions_title: "How to use your API key" usage_instructions: "Include your API key in the X-Api-Key header when making requests to the %{product_name} API:" @@ -112,4 +114,5 @@ en: critical_warning_3: "If you lose this key, you'll need to create a new one." usage_instructions: "Use your API key by including it in the X-Api-Key header:" copy_key: "Copy API Key" + copied: "Copied!" continue: "Continue to API Key Settings" \ No newline at end of file From 12ed06b0ff921e3019d6a63c7015161389d27b04 Mon Sep 17 00:00:00 2001 From: RenzoMXD <170978465+RenzoMXD@users.noreply.github.com> Date: Fri, 22 May 2026 05:29:08 +0200 Subject: [PATCH 2/2] Fix API key locale newline --- config/locales/views/settings/api_keys/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views/settings/api_keys/en.yml b/config/locales/views/settings/api_keys/en.yml index 5b135400ea..78b05ba84f 100644 --- a/config/locales/views/settings/api_keys/en.yml +++ b/config/locales/views/settings/api_keys/en.yml @@ -115,4 +115,4 @@ en: usage_instructions: "Use your API key by including it in the X-Api-Key header:" copy_key: "Copy API Key" copied: "Copied!" - continue: "Continue to API Key Settings" \ No newline at end of file + continue: "Continue to API Key Settings"