Simplify app card badges, remove colored status borders
Remove status-ok/status-attention colored border classes from cards. Drop the verbose Wayland badge from cards (detail view handles it). Merge extract_and_run into the OK FUSE statuses since it works.
This commit is contained in:
@@ -86,10 +86,8 @@ pub fn build_app_card(record: &AppImageRecord) -> gtk::FlowBoxChild {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Single most important badge (priority: Update > FUSE issue > Wayland issue)
|
// Single most important badge (priority: Update > FUSE issue)
|
||||||
let badge = build_priority_badge(record);
|
if let Some(badge) = build_priority_badge(record) {
|
||||||
let has_badge = badge.is_some();
|
|
||||||
if let Some(badge) = badge {
|
|
||||||
let badge_box = gtk::Box::builder()
|
let badge_box = gtk::Box::builder()
|
||||||
.orientation(gtk::Orientation::Horizontal)
|
.orientation(gtk::Orientation::Horizontal)
|
||||||
.halign(gtk::Align::Center)
|
.halign(gtk::Align::Center)
|
||||||
@@ -99,13 +97,6 @@ pub fn build_app_card(record: &AppImageRecord) -> gtk::FlowBoxChild {
|
|||||||
card.append(&badge_box);
|
card.append(&badge_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status border: green for healthy, amber for attention needed
|
|
||||||
if record.integrated && !has_badge {
|
|
||||||
card.add_css_class("status-ok");
|
|
||||||
} else if has_badge {
|
|
||||||
card.add_css_class("status-attention");
|
|
||||||
}
|
|
||||||
|
|
||||||
let child = gtk::FlowBoxChild::builder()
|
let child = gtk::FlowBoxChild::builder()
|
||||||
.child(&card)
|
.child(&card)
|
||||||
.build();
|
.build();
|
||||||
@@ -119,32 +110,28 @@ pub fn build_app_card(record: &AppImageRecord) -> gtk::FlowBoxChild {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Return the single most important badge for a record.
|
/// Return the single most important badge for a record.
|
||||||
/// Priority: Analyzing > Update available > FUSE issue > Wayland issue.
|
/// Priority: Analyzing > Update available > FUSE issue > Portable.
|
||||||
|
/// Wayland details are left to the detail view.
|
||||||
pub fn build_priority_badge(record: &AppImageRecord) -> Option<gtk::Label> {
|
pub fn build_priority_badge(record: &AppImageRecord) -> Option<gtk::Label> {
|
||||||
// 0. Analysis in progress (highest priority)
|
// 0. Analysis in progress
|
||||||
if record.app_name.is_none() && record.analysis_status.as_deref() != Some("complete") {
|
if record.app_name.is_none() && record.analysis_status.as_deref() != Some("complete") {
|
||||||
return Some(widgets::status_badge("Analyzing...", "info"));
|
return Some(widgets::status_badge("Analyzing...", "info"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. Update available (highest priority)
|
// 1. Update available
|
||||||
if let (Some(ref latest), Some(ref current)) = (&record.latest_version, &record.app_version) {
|
if let (Some(ref latest), Some(ref current)) = (&record.latest_version, &record.app_version) {
|
||||||
if crate::core::updater::version_is_newer(latest, current) {
|
if crate::core::updater::version_is_newer(latest, current) {
|
||||||
return Some(widgets::status_badge("Update", "info"));
|
return Some(widgets::status_badge("Update", "info"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. FUSE issue
|
// 2. FUSE issue (cannot launch)
|
||||||
// The database stores AppImageFuseStatus values (per-app), not FuseStatus (system).
|
|
||||||
// Check both: per-app statuses like "native_fuse"/"static_runtime" are fine,
|
|
||||||
// "extract_and_run" is slow but works, "cannot_launch" is a real problem.
|
|
||||||
// System statuses like "fully_functional" are also fine.
|
|
||||||
if let Some(ref fs) = record.fuse_status {
|
if let Some(ref fs) = record.fuse_status {
|
||||||
let is_ok = matches!(
|
let is_ok = matches!(
|
||||||
fs.as_str(),
|
fs.as_str(),
|
||||||
"native_fuse" | "static_runtime" | "fully_functional"
|
"native_fuse" | "static_runtime" | "fully_functional" | "extract_and_run"
|
||||||
);
|
);
|
||||||
let is_slow = fs.as_str() == "extract_and_run";
|
if !is_ok {
|
||||||
if !is_ok && !is_slow {
|
|
||||||
return Some(widgets::status_badge("Needs setup", "warning"));
|
return Some(widgets::status_badge("Needs setup", "warning"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,14 +141,6 @@ pub fn build_priority_badge(record: &AppImageRecord) -> Option<gtk::Label> {
|
|||||||
return Some(widgets::status_badge("Portable", "info"));
|
return Some(widgets::status_badge("Portable", "info"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Wayland issue (not Native or Unknown)
|
|
||||||
if let Some(ref ws) = record.wayland_status {
|
|
||||||
let status = WaylandStatus::from_str(ws);
|
|
||||||
if status != WaylandStatus::Unknown && status != WaylandStatus::Native {
|
|
||||||
return Some(widgets::status_badge("May look blurry", "neutral"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user