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" }
+ ) %>
+
+
+ <%= render DS::Button.new(
+ text: t(".copied"),
+ variant: "ghost",
+ icon: "check",
+ data: { action: "clipboard#copy" }
+ ) %>
+
<%= @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" }
+ ) %>
+
+
+ <%= render DS::Button.new(
+ text: t(".newly_created.copied"),
+ variant: "ghost",
+ icon: "check",
+ data: { action: "clipboard#copy" }
+ ) %>
+
<%= @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" }
+ ) %>
+
+
+ <%= render DS::Button.new(
+ text: t(".current_api_key.copied"),
+ variant: "ghost",
+ icon: "check",
+ data: { action: "clipboard#copy" }
+ ) %>
+