feat(collector): show hoster icons with tooltips

Render known hosters with their existing provider icons in collector package and file rows while retaining the full hoster name as a tooltip. Fall back to the compact text label if an icon cannot be loaded.
This commit is contained in:
Sucukdeluxe
2026-08-22 02:54:14 +02:00
parent b9a4f97681
commit b03f6ee1bc
4 changed files with 37 additions and 2 deletions
+23
View File
@@ -127,6 +127,29 @@ describe("CollectorView", () => {
expect(html).not.toContain(">Lokal<");
});
it("renders known hosters as icons with their full name as tooltip", () => {
const ddownloadPackages: CollectorPackage[] = [{
id: "package-ddownload",
name: "Archive",
addedAt: 3000,
links: [{
id: "link-ddownload",
url: "https://ddownload.com/ntwscdw62gyb",
fileName: "Archive.part01.rar",
fileSizeBytes: 526_385_152,
hoster: "ddownload",
availability: "online",
status: "ready",
addedAt: 3000
}]
}];
const html = renderToStaticMarkup(<CollectorContent actions={createActions()} model={buildCollectorWorkspaceViewModel(ddownloadPackages, "all", "", false, [], [], "", true)} />);
expect(html).toContain('class="collector-hoster-label" title="DDownload"');
expect(html).toContain('class="collector-hoster-icon" data-hoster="ddownload" src="./provider-icons/ddownload.ico"');
expect(html).not.toContain('title="DDownload">DD<');
});
it("renders collapsed packages without child rows", () => {
const html = renderToStaticMarkup(<CollectorContent actions={createActions()} model={buildCollectorWorkspaceViewModel(packages, "all", "", false, [], ["package-sbs"], "", false)} />);
expect(html).toContain("aria-label=\"SBS14HD ausklappen\"");