From e5f76fe548cf7ce956b55efcae9aa0693c831280 Mon Sep 17 00:00:00 2001 From: spinline Date: Thu, 12 Feb 2026 22:18:09 +0300 Subject: [PATCH] feat: add mobile-optimized sort dropdown and hide column selector on mobile --- frontend/src/components/torrent/table.rs | 53 +++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/torrent/table.rs b/frontend/src/components/torrent/table.rs index aa5f8f0..29ba643 100644 --- a/frontend/src/components/torrent/table.rs +++ b/frontend/src/components/torrent/table.rs @@ -1,7 +1,7 @@ use leptos::prelude::*; use leptos::task::spawn_local; use std::collections::HashSet; -use icons::{ArrowUpDown, Inbox, Settings2, Play, Square, Trash2, Ellipsis}; +use icons::{ArrowUpDown, Inbox, Settings2, Play, Square, Trash2, Ellipsis, ArrowUp, ArrowDown, Check, ListFilter}; use crate::store::{get_action_messages, show_toast}; use crate::api; use shared::NotificationLevel; @@ -281,6 +281,57 @@ pub fn TorrentTable() -> impl IntoView { + // Mobile Sort Menu +
+ + + + "Sırala" + + + "Sıralama Ölçütü" + + {move || { + let current_col = sort_col.0.get(); + let current_dir = sort_dir.0.get(); + + let sort_items = vec![ + (SortColumn::Name, "İsim"), + (SortColumn::Size, "Boyut"), + (SortColumn::Progress, "İlerleme"), + (SortColumn::Status, "Durum"), + (SortColumn::DownSpeed, "DL Hızı"), + (SortColumn::UpSpeed, "UP Hızı"), + (SortColumn::ETA, "Kalan Süre"), + (SortColumn::AddedDate, "Tarih"), + ]; + + sort_items.into_iter().map(|(col, label)| { + let is_active = current_col == col; + view! { + +
+
+ {if is_active { view! { }.into_any() } else { view! {
}.into_any() }} + {label} +
+ {if is_active { + match current_dir { + SortDirection::Ascending => view! { }.into_any(), + SortDirection::Descending => view! { }.into_any(), + } + } else { view! { "" }.into_any() }} +
+ + }.into_any() + }).collect_view() + }} + + + +
+ + // Desktop Columns Menu