From 8badfb0da9e741c1bb571dcde9fd99bda4f6a88e Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 6 Aug 2026 17:45:56 +0800 Subject: [PATCH] fix(download): keep torrent size visible --- src/components/cards/DownloadingCard.vue | 11 ++++++++++- .../cards/__tests__/DownloadingCard.spec.ts | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/cards/DownloadingCard.vue b/src/components/cards/DownloadingCard.vue index 7e9bc81a..55629fc5 100644 --- a/src/components/cards/DownloadingCard.vue +++ b/src/components/cards/DownloadingCard.vue @@ -187,7 +187,7 @@ async function deleteDownload() { {{ sourceSiteText }} - + {{ sizeText }} @@ -328,9 +328,18 @@ async function deleteDownload() { } .downloading-card__chips :deep(.v-chip) { + min-inline-size: 0; max-inline-size: calc(50% - 0.2rem); } +.downloading-card__chips :deep(.v-chip:not(.downloading-card__size-chip)) { + flex: 1 1 auto; +} + +.downloading-card__chips :deep(.downloading-card__size-chip) { + flex: 0 0 auto; +} + .downloading-card__chips :deep(.v-chip__content) { overflow: hidden; text-overflow: ellipsis; diff --git a/src/components/cards/__tests__/DownloadingCard.spec.ts b/src/components/cards/__tests__/DownloadingCard.spec.ts index 5f270e18..832b6839 100644 --- a/src/components/cards/__tests__/DownloadingCard.spec.ts +++ b/src/components/cards/__tests__/DownloadingCard.spec.ts @@ -140,10 +140,12 @@ describe('DownloadingCard display and pause state', () => { expect(container.querySelectorAll('.downloading-card__chips .v-chip')).toHaveLength(1) }) - it('prefers explicit site names and safely reduces tracker URLs to hostnames', async () => { + it('keeps torrent size visible while resolving explicit site names and tracker hostnames', async () => { const { container, rerender } = await renderCard(downloading({ site_name: ' M-Team ' })) expect(container.querySelector('.downloading-card__chips')).toHaveTextContent('M-Team') + expect(container.querySelector('.downloading-card__chips')).toHaveTextContent('1.00 KB') + expect(container.querySelectorAll('.downloading-card__chips .v-chip')).toHaveLength(3) await rerender({ downloaderName: 'qb-main',