From d27372d92308e40d2d7b696ef52f6c35e7d63906 Mon Sep 17 00:00:00 2001 From: Federico del Mazo Date: Sat, 6 Sep 2025 22:43:02 -0300 Subject: [PATCH 1/2] Add "Select All" button to top bar --- src/components/Icon/CheckAllIcon.svelte | 12 ++++++++++++ src/components/Icon/Icon.svelte | 2 ++ src/components/TopBar/TopBar.svelte | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 src/components/Icon/CheckAllIcon.svelte diff --git a/src/components/Icon/CheckAllIcon.svelte b/src/components/Icon/CheckAllIcon.svelte new file mode 100644 index 0000000..4375b0b --- /dev/null +++ b/src/components/Icon/CheckAllIcon.svelte @@ -0,0 +1,12 @@ + + + + + + diff --git a/src/components/Icon/Icon.svelte b/src/components/Icon/Icon.svelte index 3471ddd..19a521c 100644 --- a/src/components/Icon/Icon.svelte +++ b/src/components/Icon/Icon.svelte @@ -2,6 +2,7 @@ import Active from './Active.svelte'; import Add from './Add.svelte'; import All from './All.svelte'; + import CheckAllIcon from './CheckAllIcon.svelte'; import CheckboxCheckmark from './CheckboxCheckmark.svelte'; import Checkmark from './Checkmark.svelte'; import Chevron from './Chevron.svelte'; @@ -36,6 +37,7 @@ Active, Add, All, + CheckAllIcon, CheckboxCheckmark, Checkmark, Chevron, diff --git a/src/components/TopBar/TopBar.svelte b/src/components/TopBar/TopBar.svelte index f838ba9..31ac1f0 100644 --- a/src/components/TopBar/TopBar.svelte +++ b/src/components/TopBar/TopBar.svelte @@ -23,6 +23,10 @@ panel.toggle(); }; + const handleSelectAll = () => { + selectedTorrents.set($torrents.map((t) => t.id)); + }; + const handleStart = () => { torrents.start($selectedTorrents); }; @@ -46,6 +50,9 @@ +
From 4d99f5e7aeb9eeb77f1cbe52809f15041f403da3 Mon Sep 17 00:00:00 2001 From: Federico del Mazo Date: Sat, 6 Sep 2025 23:33:59 -0300 Subject: [PATCH 2/2] Make "Select All" button work for filtered list --- src/components/TopBar/TopBar.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TopBar/TopBar.svelte b/src/components/TopBar/TopBar.svelte index 31ac1f0..245460c 100644 --- a/src/components/TopBar/TopBar.svelte +++ b/src/components/TopBar/TopBar.svelte @@ -4,6 +4,8 @@ import { Add, Remove } from '~components/Modal'; import { torrents, modals, selectedTorrents, panel } from '~helpers/stores'; + const sortedTorrents = torrents.sorted; + onMount(() => { const url = new URL(window.location.href); const magnet = url.searchParams.get('addtorrent'); @@ -24,7 +26,7 @@ }; const handleSelectAll = () => { - selectedTorrents.set($torrents.map((t) => t.id)); + selectedTorrents.set($sortedTorrents.map((t) => t.id)); }; const handleStart = () => {