fix(accounts): simplify identity copy tooltips
Show only the copy action in populated username and email cell tooltips instead of repeating values already visible in the table. Preserve explicit accessible button labels and add German and English regression coverage.
This commit is contained in:
@@ -184,7 +184,7 @@ const pairs = [
|
||||
["· API-Quota konnte nicht geladen werden", "· API quota could not be loaded"], ["Name kopiert", "Name copied"], ["Link kopiert", "Link copied"],
|
||||
["Download-Ziel", "Download destination"], ["Support-Logs:", "Support logs:"], ["Session-Logs", "Session logs"], ["Paket-Logs", "Package logs"], ["Support-Bundle:", "Support bundle:"], ["Warnungen:", "Warnings:"],
|
||||
["Web-Login", "Web login"], ["API-Token", "API token"], ["erfolgreich", "successful"], ["Unbekannt", "Unknown"], ["Abgebrochen", "Cancelled"], ["Passwort", "Password"],
|
||||
["Sicherung", "Backup"], ["Session-Log", "Session log"], ["Remote-Support", "Remote support"], ["Kopieren", "Copy"], ["Verbindungscode", "Connection code"], ["deaktiviert", "disabled"]
|
||||
["Sicherung", "Backup"], ["Session-Log", "Session log"], ["Remote-Support", "Remote support"], ["Kopieren", "Copy"], ["Klicken zum Kopieren", "Click to copy"], ["Verbindungscode", "Connection code"], ["deaktiviert", "disabled"]
|
||||
] as const;
|
||||
|
||||
const deToEn = new Map<string, string>(pairs);
|
||||
|
||||
@@ -142,7 +142,7 @@ function renderAccountIdentityCell({
|
||||
}): ReactElement {
|
||||
const copyable = value.trim() !== "" && value !== "—";
|
||||
return (
|
||||
<span className={className} role="cell" title={copyable ? `${value}\nKlicken zum Kopieren` : value}>
|
||||
<span className={className} role="cell" title={copyable ? "Klicken zum Kopieren" : value}>
|
||||
{copyable ? (
|
||||
<button
|
||||
aria-label={`${label} kopieren`}
|
||||
|
||||
@@ -70,6 +70,7 @@ describe("renderer localization", () => {
|
||||
.toBe("Do you really want to remove the empty collection Tab 2?");
|
||||
expect(translateUiText("Link kopieren", "en")).toBe("Copy Link");
|
||||
expect(translateUiText("example.test Klicken zum Kopieren", "en")).toBe("Click to copy example.test");
|
||||
expect(translateUiText("Klicken zum Kopieren", "en")).toBe("Click to copy");
|
||||
expect(translateUiText("Geschwindigkeit verschieben", "en")).toBe("Move Speed");
|
||||
expect(translateUiText("Geschwindigkeit nach links verschieben", "en")).toBe("Move Speed left");
|
||||
expect(translateUiText("Move Speed right", "de")).toBe("Geschwindigkeit nach rechts verschieben");
|
||||
|
||||
@@ -834,6 +834,8 @@ describe("account workspace", () => {
|
||||
})
|
||||
});
|
||||
const buttons = findElements(tree, (element) => String(element.props.className || "").includes("settings-account-copy-button"));
|
||||
const copyableCells = findElements(tree, (element) => ["settings-account-username", "settings-account-email"].includes(String(element.props.className || "")))
|
||||
.filter((element) => element.props.title === "Klicken zum Kopieren");
|
||||
const username = buttons.find((button) => button.props["aria-label"] === "Benutzername kopieren");
|
||||
const email = buttons.find((button) => button.props["aria-label"] === "E-Mail kopieren");
|
||||
let stopped = 0;
|
||||
@@ -843,6 +845,7 @@ describe("account workspace", () => {
|
||||
username?.props.onDoubleClick({ stopPropagation: () => { stopped += 1; } });
|
||||
|
||||
expect(buttons.some((button) => button.props.children === "—")).toBe(false);
|
||||
expect(copyableCells).toHaveLength(buttons.length);
|
||||
expect(copies).toEqual([
|
||||
"Benutzername:stored-user",
|
||||
"E-Mail:verified@example.test"
|
||||
|
||||
Reference in New Issue
Block a user