Implement per-distro installation flow

This commit is contained in:
stoorps 2026-03-19 21:59:18 +00:00
parent caf870d05e
commit b9b60e9b6c
Signed by: stoorps
SSH key fingerprint: SHA256:AZlPfu9hTu042EGtZElmDQoy+KvMOeShLDan/fYLoNI
21 changed files with 1109 additions and 33 deletions

View file

@ -19,16 +19,35 @@ pub fn render_dispatch_result(result: &DispatchResult) -> String {
}
}
fn render_added_app(added: &crate::AddedApp) -> String {
format!(
"tracked app: {} ({})\nsource: {} {}\nselected artifact: {} [{}]",
fn render_added_app(added: &aim_core::app::add::InstalledApp) -> String {
let scope = match added.install_scope {
aim_core::domain::app::InstallScope::User => "user",
aim_core::domain::app::InstallScope::System => "system",
};
let warning_lines = added
.warnings
.iter()
.chain(added.install_outcome.warnings.iter())
.map(|warning| format!("warning: {warning}"))
.collect::<Vec<_>>()
.join("\n");
let summary = format!(
"installing as {scope}\ninstalled app: {} ({})\nsource: {} {}\nselected artifact: {} [{}]",
added.record.display_name,
added.record.stable_id,
added.source.kind.as_str(),
added.source.locator,
added.selected_artifact.url,
added.selected_artifact.selection_reason,
)
);
if warning_lines.is_empty() {
summary
} else {
format!("{summary}\n{warning_lines}")
}
}
fn render_pending_add(plan: &AddPlan) -> String {