use crate::tui::app::App;
pub(super) fn library_hints(app: &App) -> &'static str {
use crate::tui::lib_state::View;
if app.lib.filter_editing {
return "type to search · ⏎ keep · Esc clear";
}
match (app.lib.view, app.lib.editing) {
(View::Cards, _) => "j/k move · ⏎ configure · d download · u updates · Esc back",
(View::Config, _)
if matches!(
app.lib.modal,
Some(crate::tui::lib_modal::ConfigModal::Preview { .. })
) =>
{
"j/k scroll · ⏎ apply changes · Esc back to recipes"
}
(View::Config, _)
if matches!(
app.lib.modal,
Some(crate::tui::lib_modal::ConfigModal::Add { .. })
) =>
{
"j/k move · J/K scroll help · ⏎ add · Esc cancel"
}
(View::Config, _) if app.lib.modal.is_some() => "j/k move · ⏎ select · Esc cancel",
(View::Config, true) => "⏎ commit · Esc cancel",
(View::Config, false) if !app.lib.selected_has_weights() => {
"⚠ weights not downloaded · Esc then d to download · ⏎ edit"
}
(View::Config, false) => {
"j/k move · ⏎ edit · a add · x remove · b borrow · d recipe defaults · s START · Esc back"
}
(View::List, _) if app.download.job.is_some() => {
"j/k move · ⏎ configure · d download · x stop · u updates · / search · r refresh"
}
(View::List, _) => {
"j/k move · ⏎ configure · d download · u updates · / search · r refresh · ? help"
}
}
}
pub(super) fn help_hints(app: &App) -> &'static str {
use crate::tui::help_state::{HelpSub, ReportPhase};
if app.help.sub == HelpSub::Guide {
return "⇥ cycle · 7 Report Issue · 1-7 jump · ? help · q quit";
}
if app.help.is_editing() {
return "type · Esc done editing";
}
match app.help.phase {
ReportPhase::Compose => "j/k field · ⏎ edit/toggle · s review & submit · 1-7 jump",
ReportPhase::Preview => "j/k scroll · y send · a toggle logs · Esc back",
ReportPhase::RequestingCode => "Esc cancel",
ReportPhase::WaitingAuth { .. } => "c copy code · Esc cancel",
ReportPhase::Submitting => "posting…",
ReportPhase::Done { .. } => "c copy link · Esc compose another",
ReportPhase::Failed { .. } => "s retry · Esc back",
}
}
pub(super) fn bench_hints(app: &App) -> &'static str {
use crate::tui::app::BenchSub;
use crate::tui::bench_state::View;
if app.bench_sub == BenchSub::History {
return "j/k run · PgUp/PgDn table · c card · ⇥ Suite↔History · ? help";
}
match (app.bench.view, app.bench.editing) {
(View::List, _) if app.bench.frame.is_some() => {
"j/k select · PgUp/PgDn page · ⏎ configure · v last run · ⇥ Suite↔History · ? help"
}
(View::List, _) => {
"j/k select · PgUp/PgDn page · ⏎ configure · ⇥ Suite↔History · 1-7 jump · ? help"
}
(View::Variants, _) => "j/k variant · ⏎ choose model · Esc back · ? help",
(View::Params, true) => "⏎ commit · Esc cancel",
(View::Params, false) => "j/k move · ⏎ edit · d defaults · p probe · s START · Esc back",
(View::Run, _) => "c cancel · j/k scroll · Esc back to suite",
}
}