Files
sure/app/views/settings/api_keys/_key_reveal.html.erb
T
Brandon WolfandClaude Fable 5 eb928ad1fe fix(settings): give API key copy buttons success feedback (#2948)
The key-reveal partial binds clipboard#copy on a DS::Button but never
set copied-text-value, so the controller's flashLabel path bailed out
and copying gave no visible confirmation. Add the value (mirroring the
MCP copy button fix from #2314) so the button label flashes "Copied!".

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 20:34:54 +02:00

18 lines
818 B
ERB

<%# locals: (api_key:, heading:, description:, copy_label:) %>
<div class="bg-surface-inset rounded-xl p-4">
<h4 class="font-medium text-primary mb-3"><%= heading %></h4>
<p class="text-secondary text-sm mb-3"><%= description %></p>
<div class="@container bg-container rounded-lg p-3 border border-primary" data-controller="clipboard" data-clipboard-copied-text-value="<%= t(".copied") %>">
<div class="flex flex-col items-start gap-3 @lg:flex-row @lg:items-center @lg:justify-between">
<code class="font-mono text-sm text-primary break-all min-w-0" data-clipboard-target="source"><%= api_key.plain_key %></code>
<%= render DS::Button.new(
text: copy_label,
variant: "ghost",
icon: "copy",
data: { action: "clipboard#copy" }
) %>
</div>
</div>
</div>