From 02e3c5aafdd671731176e22e00e492781c6b52f9 Mon Sep 17 00:00:00 2001 From: alexjet1000 Date: Mon, 3 Aug 2026 16:41:34 +0200 Subject: [PATCH 1/2] Link download results to indexer sources --- client/__tests__/GameDownloadDialog.test.tsx | 24 +++++++++++++ client/src/components/GameDownloadDialog.tsx | 36 ++++++++++++++++---- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/client/__tests__/GameDownloadDialog.test.tsx b/client/__tests__/GameDownloadDialog.test.tsx index 75f1d58fd..8cc18bceb 100644 --- a/client/__tests__/GameDownloadDialog.test.tsx +++ b/client/__tests__/GameDownloadDialog.test.tsx @@ -111,6 +111,7 @@ type TorrentItemOverrides = { seeders?: number; leechers?: number; indexerName?: string; + comments?: string; group?: string; downloadVolumeFactor?: number; uploadVolumeFactor?: number; @@ -138,6 +139,7 @@ const makeTorrentItem = (overrides: TorrentItemOverrides = {}) => ({ seeders: overrides.seeders ?? 10, leechers: overrides.leechers ?? 2, indexerName: overrides.indexerName ?? "Indexer A", + ...(overrides.comments !== undefined && { comments: overrides.comments }), ...(overrides.group !== undefined && { group: overrides.group }), ...(overrides.downloadVolumeFactor !== undefined && { downloadVolumeFactor: overrides.downloadVolumeFactor, @@ -288,6 +290,28 @@ describe("GameDownloadDialog", () => { ); }); + it.each([false, true])( + "links release titles to their indexer source when mobile is %s", + async (isMobile) => { + mockIsMobile = isMobile; + globalThis.fetch = createFetchMock({ + search: makeSearchResult([ + makeTorrentItem({ + title: "Linked Release", + comments: "https://indexer.example/releases/123", + }), + ]), + }); + + renderComponent(); + + const link = await screen.findByRole("link", { name: "Linked Release" }); + expect(link).toHaveAttribute("href", "https://indexer.example/releases/123"); + expect(link).toHaveAttribute("target", "_blank"); + expect(link).toHaveAttribute("rel", "noopener noreferrer"); + } + ); + it("identifies Usenet vs Torrent items", async () => { renderComponent(); diff --git a/client/src/components/GameDownloadDialog.tsx b/client/src/components/GameDownloadDialog.tsx index be4df013d..34e3f11cc 100644 --- a/client/src/components/GameDownloadDialog.tsx +++ b/client/src/components/GameDownloadDialog.tsx @@ -1137,9 +1137,21 @@ export default function GameDownloadDialog({ game, open, onOpenChange }: GameDow
-

- {download.title} -

+ {download.comments ? ( + event.stopPropagation()} + > + {download.title} + + ) : ( +

+ {download.title} +

+ )} {isNew && ( -

- {download.title} -

+ {download.comments ? ( + event.stopPropagation()} + > + {download.title} + + ) : ( +

+ {download.title} +

+ )} {isNew && ( Date: Sat, 8 Aug 2026 14:53:21 +0200 Subject: [PATCH 2/2] fix: keep heading semantics when linking download titles The conditional external link replaced the h4, dropping the heading role from result titles. Keep the h4 wrapper and render the link inside it in both mobile and desktop result layouts. --- client/src/components/GameDownloadDialog.tsx | 60 ++++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/client/src/components/GameDownloadDialog.tsx b/client/src/components/GameDownloadDialog.tsx index 34e3f11cc..c893460bc 100644 --- a/client/src/components/GameDownloadDialog.tsx +++ b/client/src/components/GameDownloadDialog.tsx @@ -1137,21 +1137,21 @@ export default function GameDownloadDialog({ game, open, onOpenChange }: GameDow
- {download.comments ? ( - event.stopPropagation()} - > - {download.title} - - ) : ( -

- {download.title} -

- )} +

+ {download.comments ? ( + event.stopPropagation()} + > + {download.title} + + ) : ( + {download.title} + )} +

{isNew && ( - {download.comments ? ( - event.stopPropagation()} - > - {download.title} - - ) : ( -

- {download.title} -

- )} +

+ {download.comments ? ( + event.stopPropagation()} + > + {download.title} + + ) : ( + {download.title} + )} +

{isNew && (