feat(collector): rebuild link preview as package workspace

Inspect pasted links, text files and DLC containers before queue insertion and resolve supported hoster metadata without starting downloads. Group multipart files into expandable packages with size, status, availability, timestamps, filtering and stable selection. Add selected or complete transfer to Downloads while retaining entries on failed or partial handoff. Keep collector toolbar spacing consistent and show the full 1Fichier identity with its provider icon in Downloads.
This commit is contained in:
Sucukdeluxe
2026-08-22 02:22:42 +02:00
parent 5f391a35d6
commit 40428a69b4
27 changed files with 1265 additions and 1229 deletions
+4 -4
View File
@@ -30,7 +30,7 @@
"interactions": [
{ "type": "click", "role": "button", "name": "Links hinzufügen" },
{ "type": "fill", "role": "textbox", "name": "Links", "value": "https://example.test/a\nhttps://example.test/b" },
{ "type": "click", "role": "button", "name": "Übernehmen" }
{ "type": "click", "role": "button", "name": "Analysieren" }
],
"assertions": [
{ "type": "active-view", "value": "collector" },
@@ -228,7 +228,7 @@
"interactions": [
{ "type": "click", "role": "button", "name": "Links hinzufügen" },
{ "type": "fill", "role": "textbox", "name": "Links", "value": "https://example.test/a\nhttps://example.test/b" },
{ "type": "click", "role": "button", "name": "Übernehmen" }
{ "type": "click", "role": "button", "name": "Analysieren" }
],
"assertions": [
{ "type": "active-view", "value": "collector" },
@@ -284,7 +284,7 @@
"interactions": [
{ "type": "click", "role": "button", "name": "Links hinzufügen" },
{ "type": "fill", "role": "textbox", "name": "Links", "value": "https://example.test/a\nhttps://example.test/b" },
{ "type": "click", "role": "button", "name": "Übernehmen" }
{ "type": "click", "role": "button", "name": "Analysieren" }
],
"assertions": [
{ "type": "active-view", "value": "collector" },
@@ -300,7 +300,7 @@
"interactions": [
{ "type": "click", "role": "button", "name": "Links hinzufügen" },
{ "type": "fill", "role": "textbox", "name": "Links", "value": "https://example.test/a\nhttps://example.test/b" },
{ "type": "click", "role": "button", "name": "Übernehmen" }
{ "type": "click", "role": "button", "name": "Analysieren" }
],
"assertions": [
{ "type": "active-view", "value": "collector" },
+31 -5
View File
@@ -9,18 +9,42 @@ import type {
import { parseDebridLinkApiKeys } from "../../src/shared/debrid-link-keys";
import { getMegaDebridAccountId } from "../../src/shared/mega-debrid-accounts";
import { createRendererState } from "../../src/main/renderer-state";
import type { CollectorInspectionResult } from "../../src/shared/collector";
export const VISUAL_SCENARIOS = ["empty", "dense", "update"] as const;
export type VisualScenario = (typeof VISUAL_SCENARIOS)[number];
export interface VisualFixture {
snapshot: UiSnapshot;
export interface VisualFixture {
snapshot: UiSnapshot;
collector: CollectorInspectionResult;
history: HistoryEntry[];
update: UpdateCheckResult;
traceConfig: SupportTraceConfig;
remoteDiagnostics: RemoteDiagnosticsInfo;
}
}
function createCollectorInspection(): CollectorInspectionResult {
return {
invalidCount: 0,
duplicateCount: 0,
packages: [{
id: "visual-collector-package-sbs14hd",
name: "SBS14HD",
addedAt: VISUAL_NOW_MS,
links: Array.from({ length: 16 }, (_unused, index) => ({
id: `visual-collector-link-${index + 1}`,
url: `https://1fichier.com/?visual${String(index + 1).padStart(2, "0")}`,
fileName: `SBS14HD.part${String(index + 1).padStart(2, "0")}.rar`,
fileSizeBytes: index === 15 ? 373_517_856 : 471_859_200,
hoster: "1fichier",
availability: "online" as const,
status: "ready" as const,
addedAt: VISUAL_NOW_MS
}))
}]
};
}
export interface VisualClockTarget {
setInterval: (handler: TimerHandler, timeout?: number, ...arguments_: unknown[]) => number;
@@ -633,7 +657,8 @@ function createRemoteDiagnostics(): RemoteDiagnosticsInfo {
export function createVisualFixture(scenario: VisualScenario): VisualFixture {
if (scenario === "empty") {
return {
snapshot: createEmptySnapshot(),
snapshot: createEmptySnapshot(),
collector: createCollectorInspection(),
history: [],
update: createUpdate(false),
traceConfig: createTraceConfig(),
@@ -642,7 +667,8 @@ export function createVisualFixture(scenario: VisualScenario): VisualFixture {
}
return {
snapshot: createDenseSnapshot(),
snapshot: createDenseSnapshot(),
collector: createCollectorInspection(),
history: createDenseHistory(),
update: createUpdate(scenario === "update"),
traceConfig: createTraceConfig(),
+2
View File
@@ -59,6 +59,8 @@ export function createVisualElectronApi(
deleteAccount: async () => ({ accountId: null, settings: clone(fixture.snapshot.settings), accounts: clone(fixture.snapshot.accounts) }),
addLinks: async () => ({ addedPackages: 0, addedLinks: 0, invalidCount: 0 }),
addContainers: async () => ({ addedPackages: 0, addedLinks: 0 }),
inspectCollectorText: async () => clone(fixture.collector),
inspectCollectorContainers: async () => clone(fixture.collector),
getStartConflicts: async () => [],
resolveStartConflict: async (_packageId, policy) => ({
skipped: policy === "skip",