Updated UI to have contextual help with tables so the UI doesn't feel so crowded

This commit is contained in:
2023-08-08 10:50:05 -06:00
parent 8120debe81
commit 05b8f85dfb
8 changed files with 97 additions and 30 deletions
+8 -17
View File
@@ -72,13 +72,10 @@ impl App {
pub async fn on_tick(&mut self, is_first_render: bool) {
if self.tick_count % self.tick_until_poll == 0 || self.is_routing || self.should_refresh {
match self.get_current_route() {
Route::Radarr(active_radarr_block) => {
self
.radarr_on_tick(active_radarr_block.clone(), is_first_render)
.await;
}
_ => (),
if let Route::Radarr(active_radarr_block) = self.get_current_route() {
self
.radarr_on_tick(active_radarr_block.clone(), is_first_render)
.await;
}
self.is_routing = false;
@@ -108,14 +105,6 @@ impl App {
pub fn get_current_route(&self) -> &Route {
self.navigation_stack.last().unwrap_or(&DEFAULT_ROUTE)
}
pub fn get_previous_route(&self) -> &Route {
if self.navigation_stack.len() > 1 {
&self.navigation_stack[self.navigation_stack.len() - 2]
} else {
self.get_current_route()
}
}
}
impl Default for App {
@@ -128,13 +117,15 @@ impl Default for App {
TabRoute {
title: "Radarr".to_owned(),
route: ActiveRadarrBlock::Movies.into(),
help: "<↑↓> scroll | ←→ change tab | <tab> change servarr | <?> help | <q> quit "
help: "<↑↓> scroll | ←→ change tab | <tab> change servarr | <?> help | <q> quit "
.to_owned(),
contextual_help: None,
},
TabRoute {
title: "Sonarr".to_owned(),
route: Route::Sonarr,
help: "<tab> change servarr | <?> help | <q> quit ".to_owned(),
help: "<tab> change servarr | <?> help | <q> quit ".to_owned(),
contextual_help: None,
},
]),
client: Client::new(),
+21 -11
View File
@@ -118,51 +118,60 @@ impl Default for RadarrData {
TabRoute {
title: "Library".to_owned(),
route: ActiveRadarrBlock::Movies.into(),
help: "<a> add | <s> search | <f> filter | <enter> details | <esc> cancel filter | <del> delete "
.to_owned(),
help: String::default(),
contextual_help: Some("<a> add | <s> search | <f> filter | <enter> details | <esc> cancel filter | <del> delete"
.to_owned()),
},
TabRoute {
title: "Downloads".to_owned(),
route: ActiveRadarrBlock::Downloads.into(),
help: "<del> delete ".to_owned(),
help: String::default(),
contextual_help: Some("<del> delete".to_owned()),
},
TabRoute {
title: "Collections".to_owned(),
route: ActiveRadarrBlock::Collections.into(),
help: "<s> search | <f> filter | <enter> details | <esc> cancel filter "
.to_owned(),
help: String::default(),
contextual_help: Some("<s> search | <f> filter | <enter> details | <esc> cancel filter"
.to_owned()),
},
]),
movie_info_tabs: TabState::new(vec![
TabRoute {
title: "Details".to_owned(),
route: ActiveRadarrBlock::MovieDetails.into(),
help: "<r> refresh | <s> auto search | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: None
},
TabRoute {
title: "History".to_owned(),
route: ActiveRadarrBlock::MovieHistory.into(),
help: "<r> refresh | <s> auto search | <↑↓> scroll | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: None
},
TabRoute {
title: "File".to_owned(),
route: ActiveRadarrBlock::FileInfo.into(),
help: "<r> refresh | <s> auto search | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: None,
},
TabRoute {
title: "Cast".to_owned(),
route: ActiveRadarrBlock::Cast.into(),
help: "<r> refresh | <s> auto search | <↑↓> scroll | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: None,
},
TabRoute {
title: "Crew".to_owned(),
route: ActiveRadarrBlock::Crew.into(),
help: "<r> refresh | <s> auto search | <↑↓> scroll | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: None,
},
TabRoute {
title: "Manual Search".to_owned(),
route: ActiveRadarrBlock::ManualSearch.into(),
help: "<r> refresh | <s> auto search | <↑↓> scroll | <enter> details | ←→ change tab | <esc> close ".to_owned(),
help: "<r> refresh | <s> auto search | <esc> close".to_owned(),
contextual_help: Some("<enter> details | <o> sort".to_owned())
}
]),
}
@@ -189,6 +198,7 @@ pub enum ActiveRadarrBlock {
FilterCollections,
FilterMovies,
ManualSearch,
ManualSearchConfirmPrompt,
Movies,
MovieDetails,
MovieHistory,