diff --git a/crates/weft-appd/src/ipc.rs b/crates/weft-appd/src/ipc.rs index 377261c..50f8852 100644 --- a/crates/weft-appd/src/ipc.rs +++ b/crates/weft-appd/src/ipc.rs @@ -21,6 +21,7 @@ pub struct SessionInfo { pub struct AppInfo { pub app_id: String, pub name: String, + pub version: String, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -142,11 +143,13 @@ mod tests { let info = super::AppInfo { app_id: "com.example.app".into(), name: "Example App".into(), + version: "1.2.3".into(), }; let bytes = rmp_serde::to_vec(&info).unwrap(); let decoded: super::AppInfo = rmp_serde::from_slice(&bytes).unwrap(); assert_eq!(decoded.app_id, "com.example.app"); assert_eq!(decoded.name, "Example App"); + assert_eq!(decoded.version, "1.2.3"); } #[test] @@ -163,6 +166,7 @@ mod tests { apps: vec![super::AppInfo { app_id: "com.example.app".into(), name: "Example App".into(), + version: "0.9.0".into(), }], }; let bytes = rmp_serde::to_vec(&resp).unwrap(); @@ -172,6 +176,7 @@ mod tests { assert_eq!(apps.len(), 1); assert_eq!(apps[0].app_id, "com.example.app"); assert_eq!(apps[0].name, "Example App"); + assert_eq!(apps[0].version, "0.9.0"); } _ => panic!("wrong variant"), } diff --git a/crates/weft-appd/src/main.rs b/crates/weft-appd/src/main.rs index c9e54ec..c4be56e 100644 --- a/crates/weft-appd/src/main.rs +++ b/crates/weft-appd/src/main.rs @@ -292,6 +292,7 @@ fn app_store_roots() -> Vec { struct WappPackage { id: String, name: String, + version: String, } #[derive(serde::Deserialize)] @@ -318,6 +319,7 @@ fn scan_installed_apps() -> Vec { apps.push(AppInfo { app_id: m.package.id, name: m.package.name, + version: m.package.version, }); } } @@ -615,6 +617,7 @@ mod tests { assert_eq!(apps.len(), 1); assert_eq!(apps[0].app_id, "com.example.scanner"); assert_eq!(apps[0].name, "Scanner"); + assert_eq!(apps[0].version, "1.0.0"); unsafe { match prior { diff --git a/infra/shell/system-ui.html b/infra/shell/system-ui.html index d601faa..8bb65fb 100644 --- a/infra/shell/system-ui.html +++ b/infra/shell/system-ui.html @@ -319,7 +319,7 @@ apps.forEach(function (app) { var icon = document.createElement('weft-app-icon'); icon.dataset.appId = app.app_id; - icon.title = app.app_id; + icon.title = app.app_id + (app.version ? ' v' + app.version : ''); icon.innerHTML = '