feat: Buchungstexte in der Offen-Liste kopierbar
body hat user-select:none mit einer Ausnahmeliste; die Buchungsliste steht als Tabelle darin, die Offen-Seite mit ihren Listenzeilen aber nicht. Damit liess sich der Empfaengertext nicht markieren – ausgerechnet dort, wo man ihn nachschlagen will, um zu erkennen, welches Franchise dahintersteckt. .named-text ist jetzt markierbar, und je Zeile steht ein Kopierknopf. Ausserdem wird der Verwendungszweck mit angezeigt, wenn er vom Empfaenger abweicht – oft steht die eigentliche Kennung dort. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+21
-1
@@ -44,6 +44,17 @@ export default function Offen() {
|
||||
}
|
||||
useEffect(() => { laden(); }, []);
|
||||
|
||||
// Der Empfaengertext ist oft genau das, was man nachschlagen will („welches
|
||||
// Franchise steckt hinter diesem Namen?"). Abtippen faellt damit weg.
|
||||
async function kopieren(text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast(t("open.copied"));
|
||||
} catch {
|
||||
toast(t("open.copyFailed"), "error");
|
||||
}
|
||||
}
|
||||
|
||||
async function zuordnen(tx, categoryId) {
|
||||
if (categoryId == null) return;
|
||||
try {
|
||||
@@ -90,9 +101,18 @@ export default function Offen() {
|
||||
<IconChip name={accountById[tx.account_id]?.icon || "wallet"}
|
||||
color={accountById[tx.account_id]?.color} />
|
||||
<div className="named-text grow">
|
||||
<div><strong>{tx.payee || tx.description || t("open.noText")}</strong></div>
|
||||
<div className="row" style={{ gap: "var(--sp-2)", alignItems: "center" }}>
|
||||
<strong>{tx.payee || tx.description || t("open.noText")}</strong>
|
||||
{(tx.payee || tx.description) && (
|
||||
<button type="button" className="btn sm ghost" title={t("open.copy")}
|
||||
onClick={() => kopieren(tx.payee || tx.description)}>
|
||||
<Icon name="copy" size={14} />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<div className="named-sub">
|
||||
{formatDate(tx.date)} · {accountById[tx.account_id]?.name || "—"}
|
||||
{tx.description && tx.payee && tx.description !== tx.payee && ` · ${tx.description}`}
|
||||
</div>
|
||||
</div>
|
||||
<Money cents={tx.amount_cents} currency={accountById[tx.account_id]?.currency}
|
||||
|
||||
Reference in New Issue
Block a user