feat(readarr): render the author details view

Add AuthorDetailsUi: the author description pane plus the three author info
tabs (Books, History, and Author Search), along with the history item details,
automatic search, update and scan, and manual search confirmation popups.
LibraryUi now accepts and draws it over the authors table.

The description pane omits the Disambiguation and Type lines that the Lidarr
equivalent renders. GET /author returns neither key, so both lines would be
blank on every record. The books table drops the Type and Duration columns for
the same reason, since books have no type and no duration, and renders Files as
the book file count over the total book count.

Land create_history_event_details together with this first caller so it is not
committed as an unused function.

Extract decorate_book_row_with_style rather than inlining the row styling in
the table closure, matching decorate_author_row_with_style in the sibling
library view. Rendering to a string discards colour, so the styling branches
are only reachable by tests through a named function.
This commit is contained in:
Dark-Alex-17 committed 2026-09-03 01:41:01 -06:00
1 parent d1d5033710
commit a8d13ae5c8
37 files changed
+3118 -3

No files matched your search

+10 -1
View File
@@ -1,3 +1,4 @@
use author_details_ui::AuthorDetailsUi;
use ratatui::{
Frame,
layout::{Constraint, Rect},
@@ -20,6 +21,8 @@ use crate::{
},
};
mod author_details_ui;
#[cfg(test)]
#[path = "library_ui_tests.rs"]
mod library_ui_tests;
@@ -29,14 +32,20 @@ pub(super) struct LibraryUi;
impl DrawUi for LibraryUi {
fn accepts(route: Route) -> bool {
if let Route::Readarr(active_readarr_block, _) = route {
return LIBRARY_BLOCKS.contains(&active_readarr_block);
return AuthorDetailsUi::accepts(route) || LIBRARY_BLOCKS.contains(&active_readarr_block);
}
false
}
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
let route = app.get_current_route();
draw_library(f, app, area);
match route {
_ if AuthorDetailsUi::accepts(route) => AuthorDetailsUi::draw(f, app, area),
_ => (),
}
}
}