feat(ui): refresh branding and account identity copying
Replace every active application icon asset with the new high-resolution artwork, including transparent PNG, complete Windows ICO sizes, and the documentation screenshot. Turn populated username and email cells into non-selectable copy actions backed by validated native Electron clipboard IPC while keeping empty cells and row interactions unchanged.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveAppIconPath } from "../src/main/app-icon";
|
||||
@@ -14,4 +15,20 @@ describe("application icon path", () => {
|
||||
path.join("C:\\repo", "assets", "app_icon.ico")
|
||||
);
|
||||
});
|
||||
|
||||
it("ships a high-resolution transparent PNG and complete Windows icon sizes", () => {
|
||||
const png = fs.readFileSync(path.resolve("assets/app_icon.png"));
|
||||
expect(png.subarray(0, 8)).toEqual(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]));
|
||||
expect(png.readUInt32BE(16)).toBeGreaterThanOrEqual(1024);
|
||||
expect(png.readUInt32BE(20)).toBeGreaterThanOrEqual(1024);
|
||||
expect([4, 6]).toContain(png[25]);
|
||||
|
||||
const ico = fs.readFileSync(path.resolve("assets/app_icon.ico"));
|
||||
const frameCount = ico.readUInt16LE(4);
|
||||
const sizes = Array.from({ length: frameCount }, (_, index) => {
|
||||
const offset = 6 + index * 16;
|
||||
return ico[offset] || 256;
|
||||
});
|
||||
expect(sizes).toEqual(expect.arrayContaining([16, 32, 48, 256]));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -301,6 +301,7 @@ function workspaceActions(overrides: Partial<AccountWorkspaceActions> = {}): Acc
|
||||
onToggleEnabled: () => {},
|
||||
onEdit: () => {},
|
||||
onContextMenu: () => {},
|
||||
onCopyIdentity: () => {},
|
||||
onAdd: () => {},
|
||||
onRemoveSelected: () => {},
|
||||
onCheckAll: () => {},
|
||||
@@ -740,6 +741,31 @@ describe("account workspace", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("copies only populated username and email cells without triggering the row", () => {
|
||||
const copies: string[] = [];
|
||||
const tree = AccountWorkspace({
|
||||
model: workspaceModel(),
|
||||
actions: workspaceActions({
|
||||
onCopyIdentity: (label, value) => copies.push(`${label}:${value}`)
|
||||
})
|
||||
});
|
||||
const buttons = findElements(tree, (element) => String(element.props.className || "").includes("settings-account-copy-button"));
|
||||
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;
|
||||
|
||||
username?.props.onClick({ stopPropagation: () => { stopped += 1; } });
|
||||
email?.props.onClick({ stopPropagation: () => { stopped += 1; } });
|
||||
username?.props.onDoubleClick({ stopPropagation: () => { stopped += 1; } });
|
||||
|
||||
expect(buttons.some((button) => button.props.children === "—")).toBe(false);
|
||||
expect(copies).toEqual([
|
||||
"Benutzername:stored-user",
|
||||
"E-Mail:verified@example.test"
|
||||
]);
|
||||
expect(stopped).toBe(3);
|
||||
});
|
||||
|
||||
it("keeps overview and rules in the same workspace while only one panel is active", () => {
|
||||
const html = renderToStaticMarkup(<AccountWorkspace actions={workspaceActions()} model={workspaceModel()} />);
|
||||
expect(count(html, "class=\"settings-account-panel\"")).toBe(2);
|
||||
|
||||
@@ -139,6 +139,7 @@ export function createVisualElectronApi(
|
||||
fixture.snapshot.settings.clipboardWatch = fixture.snapshot.clipboardActive;
|
||||
return fixture.snapshot.clipboardActive;
|
||||
},
|
||||
writeClipboardText: async () => true,
|
||||
pickFolder: async () => "C:\\Visual\\Selected",
|
||||
pickContainers: async () => ["C:\\Visual\\Containers\\visual.dlc"],
|
||||
getSessionStats: async () => ({
|
||||
|
||||
Reference in New Issue
Block a user