From c390fcba4796f52aabdf4a7a84c31a02f26676ea Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Fri, 27 Feb 2026 18:40:38 +0100 Subject: [PATCH] Properly fix mobile torrent table with conditional rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous fix still rendered all 4 columns in DOM (just hidden with CSS), causing horizontal overflow. Now actually renders only 2 columns on mobile. Implementation: 1. Added reactive window width tracking with resize listener 2. Computed isMobile property (windowWidth <= 768px) 3. Computed visibleColumns: ['name', 'add'] on mobile, all 4 on desktop 4. Conditional v-if rendering for seed/size columns 5. Conditional v-if for metadata display in torrent-info cell Template changes: - Header: v-for="column in visibleColumns" (not all columns) - Seed column: v-if="!isMobile" (not rendered on mobile) - Size column: v-if="!isMobile" (not rendered on mobile) - Metadata: v-if="isMobile" (only shown on mobile) CSS cleanup: - Removed .desktop-only class rules (no longer needed) - Removed display: none media queries (handled by v-if) - Removed header nth-child hiding (handled by visibleColumns) Result: Mobile (≤768px): - Only 2 elements rendered: name + add - No horizontal scroll required - Metadata shown inline under title - Colspan correctly set to 2 for expanded rows Desktop (>768px): - All 4 elements rendered: name + seed + size + add - Full table layout - Colspan correctly set to 4 for expanded rows This is the correct solution - don't render unnecessary DOM elements. --- src/components/torrent/TorrentTable.vue | 55 ++++++++++++------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/src/components/torrent/TorrentTable.vue b/src/components/torrent/TorrentTable.vue index 1c91c2d..bfba3a4 100644 --- a/src/components/torrent/TorrentTable.vue +++ b/src/components/torrent/TorrentTable.vue @@ -3,7 +3,7 @@
{{ torrent.name }}
-
+
{{ torrent.size }} {{ torrent.seed }} seeders
{{ torrent.seed }} @@ -60,7 +62,7 @@