feat(readarr): add the add author UI

Renders the author search box, the search results table, and the
multi-step add confirmation prompt with its five dropdown popups.

The prompt's per-field highlighting is conveyed purely by style, which
render_to_string_with_app discards, so the highlight mapping is extracted
into add_author_prompt_highlights and unit tested per selection step.

Enriches the fully populated author search fixture with a second result
that is absent from the library, so both branches of the in-library
marker render in one snapshot and every table column carries a value.
This commit is contained in:
Dark-Alex-17 committed 2026-09-03 18:03:12 -06:00
1 parent 7500e2da24
commit 7d1ff86c68
24 files changed
+1682 -5

No files matched your search

+6 -1
View File
@@ -1,3 +1,4 @@
use add_author_ui::AddAuthorUi;
use author_details_ui::AuthorDetailsUi;
use ratatui::{
Frame,
@@ -25,6 +26,7 @@ use crate::{
},
};
mod add_author_ui;
mod author_details_ui;
mod book_details_ui;
mod edition_details_ui;
@@ -38,7 +40,9 @@ pub(super) struct LibraryUi;
impl DrawUi for LibraryUi {
fn accepts(route: Route) -> bool {
if let Route::Readarr(active_readarr_block, _) = route {
return AuthorDetailsUi::accepts(route) || LIBRARY_BLOCKS.contains(&active_readarr_block);
return AddAuthorUi::accepts(route)
|| AuthorDetailsUi::accepts(route)
|| LIBRARY_BLOCKS.contains(&active_readarr_block);
}
false
@@ -49,6 +53,7 @@ impl DrawUi for LibraryUi {
draw_library(f, app, area);
match route {
_ if AddAuthorUi::accepts(route) => AddAuthorUi::draw(f, app, area),
_ if AuthorDetailsUi::accepts(route) => AuthorDetailsUi::draw(f, app, area),
Route::Readarr(ActiveReadarrBlock::UpdateAllAuthorsPrompt, _) => {
let confirmation_prompt = ConfirmationPrompt::new()