From 5b22d822030dd3b7d7ae047fab6bf83fc80f9242 Mon Sep 17 00:00:00 2001 From: Stephan Eisenbach Date: Wed, 6 May 2026 00:28:34 +0200 Subject: [PATCH 1/2] Add "copy account title" functionality --- frontend/src/sidebar/PageTitle.svelte | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/frontend/src/sidebar/PageTitle.svelte b/frontend/src/sidebar/PageTitle.svelte index 18760b28a..97edd1b58 100644 --- a/frontend/src/sidebar/PageTitle.svelte +++ b/frontend/src/sidebar/PageTitle.svelte @@ -1,10 +1,29 @@ @@ -12,6 +31,19 @@ {title} {:else} + {/if} @@ -22,4 +54,17 @@ content: "›"; opacity: 0.5; } + + .copy-account-title { + padding: 0 0.25rem; + margin-left: 0.25rem; + color: inherit; + cursor: pointer; + background: transparent; + border: 0; + } + + .copy-account-title:hover { + color: var(--link-color); + } From d11be1ba946fcee5064b2a5ac50d3421c91eb819 Mon Sep 17 00:00:00 2001 From: Stephan Eisenbach Date: Mon, 11 May 2026 13:48:26 +0200 Subject: [PATCH 2/2] Add "copy account name" button to AccountCell component --- frontend/src/tree-table/AccountCell.svelte | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/frontend/src/tree-table/AccountCell.svelte b/frontend/src/tree-table/AccountCell.svelte index bccbd2868..52de4df12 100644 --- a/frontend/src/tree-table/AccountCell.svelte +++ b/frontend/src/tree-table/AccountCell.svelte @@ -6,6 +6,7 @@ import type { AccountTreeNode } from "../charts/hierarchy.ts"; import { urlForAccount } from "../helpers.ts"; import { leaf } from "../lib/account.ts"; + import { log_error } from "../log.ts"; import AccountIndicator from "../sidebar/AccountIndicator.svelte"; import { toggle_account, toggled_accounts } from "../stores/accounts.ts"; @@ -18,6 +19,24 @@ let { account, children } = $derived(node); let is_toggled = $derived($toggled_accounts.has(account)); + let copied = $state(false); + let copied_timeout: ReturnType | undefined; + + async function copyAccount(event: MouseEvent): Promise { + event.stopPropagation(); + + try { + await navigator.clipboard.writeText(account); + copied = true; + + clearTimeout(copied_timeout); + copied_timeout = setTimeout(() => { + copied = false; + }, 1500); + } catch (error) { + log_error(error); + } + } @@ -35,6 +54,19 @@ + @@ -49,6 +81,20 @@ margin-left: 1em; } + .copy-account { + position: static; + padding: 0 0.25rem; + margin-left: 0.25rem; + color: inherit; + cursor: pointer; + background: transparent; + border: 0; + } + + .copy-account:hover { + color: var(--link-color); + } + span { display: flex; flex: 1;