From 2b1b476d62c6e1997ebc3755a1fc1bab991b82e0 Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Tue, 5 Nov 2024 20:01:02 +0100 Subject: [PATCH 1/4] Fix DownloadDetails scroll issue --- .../ui/src/pages/Downloads/Details.tsx | 59 ++++++++++++------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/src/tribler/ui/src/pages/Downloads/Details.tsx b/src/tribler/ui/src/pages/Downloads/Details.tsx index 7f4c156262..e30b42c083 100644 --- a/src/tribler/ui/src/pages/Downloads/Details.tsx +++ b/src/tribler/ui/src/pages/Downloads/Details.tsx @@ -11,12 +11,14 @@ import Trackers from "./Trackers"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Download } from "@/models/download.model"; import Pieces from "./Pieces"; -import { useEffect, useState } from "react"; +import { useEffect, useLayoutEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; export default function DownloadDetails({ selectedDownloads }: { selectedDownloads: Download[] }) { const [download, setDownload] = useState(); + const tabsRef = useRef(null); + const [contentStyle, setContentStyle] = useState<{ height?: string }>({}); useEffect(() => { setDownload((selectedDownloads.length == 1) ? selectedDownloads[0] : undefined); @@ -24,20 +26,31 @@ export default function DownloadDetails({ selectedDownloads }: { selectedDownloa const { t } = useTranslation(); + + useLayoutEffect(() => { + if (tabsRef.current && contentStyle?.height !== (tabsRef.current.offsetHeight - 40 + "px")) { + setContentStyle({ + // The 40px (CSS class h-10) is to compensate for the height of the TabsList + height: tabsRef.current.offsetHeight - 40 + "px", + }) + } + }); + if (!download) return null; return ( - - - - {t('Details')} - {t('Files')} - {t('Trackers')} - {t('Peers')} - - -
+ + + {t('Details')} + {t('Files')} + {t('Trackers')} + {t('Peers')} + + + + +
{t('Progress')}
@@ -80,17 +93,23 @@ export default function DownloadDetails({ selectedDownloads }: { selectedDownloa
{download?.availability}
-
- + + + + - - + + + + - - + + + + - -
- + + + ) } From 27df29dbdc55d8ff8731567c0b7e5a0c43fadb24 Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Tue, 5 Nov 2024 20:00:42 +0100 Subject: [PATCH 2/4] Fix SimpleTable header colour issue --- src/tribler/ui/src/components/ui/simple-table.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tribler/ui/src/components/ui/simple-table.tsx b/src/tribler/ui/src/components/ui/simple-table.tsx index 826e388a1f..8589526119 100644 --- a/src/tribler/ui/src/components/ui/simple-table.tsx +++ b/src/tribler/ui/src/components/ui/simple-table.tsx @@ -113,9 +113,9 @@ function SimpleTable({ <>
- + {table.getHeaderGroups().map((headerGroup) => ( - + {headerGroup.headers.map((header, index) => { return ( From cb3e74e6ef598cb308641e0e372d157faf3a8215 Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Tue, 5 Nov 2024 21:44:28 +0100 Subject: [PATCH 3/4] Add border below TabsLists --- src/tribler/ui/src/pages/Debug/Asyncio/index.tsx | 2 +- src/tribler/ui/src/pages/Debug/DHT/index.tsx | 2 +- src/tribler/ui/src/pages/Debug/IPv8/index.tsx | 2 +- src/tribler/ui/src/pages/Debug/Libtorrent/index.tsx | 2 +- src/tribler/ui/src/pages/Debug/Tunnels/index.tsx | 2 +- src/tribler/ui/src/pages/Downloads/Details.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tribler/ui/src/pages/Debug/Asyncio/index.tsx b/src/tribler/ui/src/pages/Debug/Asyncio/index.tsx index 6335332fbc..7d61867d74 100644 --- a/src/tribler/ui/src/pages/Debug/Asyncio/index.tsx +++ b/src/tribler/ui/src/pages/Debug/Asyncio/index.tsx @@ -7,7 +7,7 @@ import SlowTasks from "./SlowTasks"; export default function IPv8() { return ( - + Tasks Slow tasks Health diff --git a/src/tribler/ui/src/pages/Debug/DHT/index.tsx b/src/tribler/ui/src/pages/Debug/DHT/index.tsx index cb2f3ff548..c4285541b6 100644 --- a/src/tribler/ui/src/pages/Debug/DHT/index.tsx +++ b/src/tribler/ui/src/pages/Debug/DHT/index.tsx @@ -11,7 +11,7 @@ import Statistics from "./Statistics" export default function DHT() { return ( - + Statistics Buckets diff --git a/src/tribler/ui/src/pages/Debug/IPv8/index.tsx b/src/tribler/ui/src/pages/Debug/IPv8/index.tsx index 6a68ab6cfc..41dab22441 100644 --- a/src/tribler/ui/src/pages/Debug/IPv8/index.tsx +++ b/src/tribler/ui/src/pages/Debug/IPv8/index.tsx @@ -6,7 +6,7 @@ import Details from "./Details"; export default function IPv8() { return ( - + Overlays Details diff --git a/src/tribler/ui/src/pages/Debug/Libtorrent/index.tsx b/src/tribler/ui/src/pages/Debug/Libtorrent/index.tsx index 4fedf847e7..fff29a719c 100644 --- a/src/tribler/ui/src/pages/Debug/Libtorrent/index.tsx +++ b/src/tribler/ui/src/pages/Debug/Libtorrent/index.tsx @@ -50,7 +50,7 @@ export default function Libtorrent() { return ( - + Settings Session
diff --git a/src/tribler/ui/src/pages/Debug/Tunnels/index.tsx b/src/tribler/ui/src/pages/Debug/Tunnels/index.tsx index b28ed37dd6..d0d2b0f84b 100644 --- a/src/tribler/ui/src/pages/Debug/Tunnels/index.tsx +++ b/src/tribler/ui/src/pages/Debug/Tunnels/index.tsx @@ -9,7 +9,7 @@ import Peers from "./Peers" export default function Tunnels() { return ( - + Circuits Relays Exit sockets diff --git a/src/tribler/ui/src/pages/Downloads/Details.tsx b/src/tribler/ui/src/pages/Downloads/Details.tsx index e30b42c083..fc3778a54e 100644 --- a/src/tribler/ui/src/pages/Downloads/Details.tsx +++ b/src/tribler/ui/src/pages/Downloads/Details.tsx @@ -41,7 +41,7 @@ export default function DownloadDetails({ selectedDownloads }: { selectedDownloa return ( - + {t('Details')} {t('Files')} {t('Trackers')} From d15047a9fd097ffb40c27005b3f7674db191c714 Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Tue, 5 Nov 2024 22:15:56 +0100 Subject: [PATCH 4/4] Change ResizableHandle color in overlays panel --- src/tribler/ui/src/pages/Debug/IPv8/Overlays.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tribler/ui/src/pages/Debug/IPv8/Overlays.tsx b/src/tribler/ui/src/pages/Debug/IPv8/Overlays.tsx index 1b85992cec..86df29eb8b 100644 --- a/src/tribler/ui/src/pages/Debug/IPv8/Overlays.tsx +++ b/src/tribler/ui/src/pages/Debug/IPv8/Overlays.tsx @@ -126,7 +126,7 @@ export default function Overlays() { maxHeight={Math.max((parentRect?.height ?? 50) - 0, 50)} /> - +