feat: add more default tabs (Seeding, Queued) with focused columns

This commit is contained in:
Kristofers Solo 2026-01-01 04:54:06 +02:00
parent dabb434011
commit c8b7d0ccbe
Signed by: kristoferssolo
GPG Key ID: 8687F2D3EEE6F0ED
4 changed files with 27 additions and 21 deletions

View File

@ -18,6 +18,8 @@ next_tab = "l"
switch_tab_1 = "1"
switch_tab_2 = "2"
switch_tab_3 = "3"
switch_tab_4 = "4"
switch_tab_5 = "5"
# Torrent actions
toggle_torrent = "enter"
@ -70,24 +72,20 @@ transmission_rpc = "warn"
[[tabs]]
name = "All"
columns = ["status", "leeches", "ratio", "size", "uploaded", "path", "name"]
[[tabs]]
name = "Active"
columns = [
"size",
"uploaded",
"ratio",
"leeches",
"seeds",
"status",
"eta",
"progress",
"downspeed",
"upspeed",
"name",
]
columns = ["status", "progress", "size", "ratio", "seeds", "leeches", "added", "name"]
[[tabs]]
name = "Downloading"
columns = ["size", "left", "progress", "downspeed", "eta", "path", "name"]
columns = ["progress", "size", "left", "downspeed", "eta", "seeds", "name"]
[[tabs]]
name = "Seeding"
columns = ["ratio", "uploaded", "upspeed", "leeches", "size", "added", "name"]
[[tabs]]
name = "Active"
columns = ["status", "progress", "downspeed", "upspeed", "eta", "seeds", "leeches", "name"]
[[tabs]]
name = "Queued"
columns = ["status", "queue", "size", "progress", "added", "name"]

View File

@ -10,6 +10,8 @@ pub struct KeybindsConfig {
pub switch_tab_1: String,
pub switch_tab_2: String,
pub switch_tab_3: String,
pub switch_tab_4: String,
pub switch_tab_5: String,
pub toggle_torrent: String,
pub toggle_all: String,
pub delete: String,

View File

@ -58,6 +58,8 @@ pub async fn get_action(key_event: KeyEvent, app: &mut App) -> Result<Option<Act
(Action::SwitchTab(0), &keybinds.switch_tab_1),
(Action::SwitchTab(1), &keybinds.switch_tab_2),
(Action::SwitchTab(2), &keybinds.switch_tab_3),
(Action::SwitchTab(3), &keybinds.switch_tab_4),
(Action::SwitchTab(4), &keybinds.switch_tab_5),
(Action::ToggleTorrent, &keybinds.toggle_torrent),
(Action::ToggleAll, &keybinds.toggle_all),
(Action::Delete(false), &keybinds.delete),

View File

@ -4,7 +4,7 @@ use traxor::{app::App, config::Config};
fn test_app_creation() {
let config = Config::load().unwrap();
let app = App::new(config).unwrap();
assert_eq!(app.tabs().len(), 3);
assert_eq!(app.tabs().len(), 5);
}
#[test]
@ -25,6 +25,10 @@ fn test_app_next_tab() {
app.next_tab();
assert_eq!(app.index(), 2);
app.next_tab();
assert_eq!(app.index(), 3);
app.next_tab();
assert_eq!(app.index(), 4);
app.next_tab();
assert_eq!(app.index(), 0); // Wraps around
}
@ -34,9 +38,9 @@ fn test_app_prev_tab() {
let mut app = App::new(config).unwrap();
assert_eq!(app.index(), 0);
app.prev_tab();
assert_eq!(app.index(), 2); // Wraps around
assert_eq!(app.index(), 4); // Wraps around
app.prev_tab();
assert_eq!(app.index(), 1);
assert_eq!(app.index(), 3);
}
#[test]