Three related TUI correctness bugs: - download_selector navigation (select_previous/next/last) computed items.len() - 1, panicking with an arithmetic underflow when the list was empty (e.g. a filter matched nothing). Index math is now in wrap-safe helpers that return no selection for an empty list. - update_search_results overwrote the filtered results view with the full unfiltered list on every ~100ms poll, so an active filter silently stopped working as new results streamed in. It now re-derives the filtered view from the current query. - The results pane rendered selection checkboxes by testing the display-row index against a selection set that stores unfiltered indices, so under an active filter the wrong rows showed as checked. It now maps the display index back through the filtered-index table. Filtering and index-mapping logic extracted into pure, unit-tested helpers.
11 lines
234 B
Rust
11 lines
234 B
Rust
#[derive(Clone, Default)]
|
|
pub struct FileDisplayData {
|
|
pub filename: String,
|
|
pub size: u64,
|
|
pub username: String,
|
|
pub speed: u32,
|
|
pub slots: u8,
|
|
pub bitrate: Option<u32>,
|
|
pub length_seconds: Option<u32>,
|
|
}
|