Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(desktop): use approved Vibey cloud icons in the macOS tray (#2711)

Max2ab0dfe12f6c
diff --git a/desktop/src-tauri/icons/tray/serving.png b/desktop/src-tauri/icons/tray/serving.png
new file mode 100644
index 000000000..9a5469767
Binary files /dev/null and b/desktop/src-tauri/icons/tray/serving.png differ
diff --git a/desktop/src-tauri/icons/tray/[email protected] b/desktop/src-tauri/icons/tray/[email protected]
new file mode 100644
index 000000000..a78c04dfa
Binary files /dev/null and b/desktop/src-tauri/icons/tray/[email protected] differ
diff --git a/desktop/src-tauri/icons/tray/starting.png b/desktop/src-tauri/icons/tray/starting.png
new file mode 100644
index 000000000..cbfda8303
Binary files /dev/null and b/desktop/src-tauri/icons/tray/starting.png differ
diff --git a/desktop/src-tauri/icons/tray/[email protected] b/desktop/src-tauri/icons/tray/[email protected]
new file mode 100644
index 000000000..daa3d1887
Binary files /dev/null and b/desktop/src-tauri/icons/tray/[email protected] differ
diff --git a/desktop/src-tauri/icons/tray/stopped.png b/desktop/src-tauri/icons/tray/stopped.png
new file mode 100644
index 000000000..d3f53b9c9
Binary files /dev/null and b/desktop/src-tauri/icons/tray/stopped.png differ
diff --git a/desktop/src-tauri/icons/tray/[email protected] b/desktop/src-tauri/icons/tray/[email protected]
new file mode 100644
index 000000000..0e0ae81da
Binary files /dev/null and b/desktop/src-tauri/icons/tray/[email protected] differ
diff --git a/desktop/src-tauri/icons/tray/unreachable.png b/desktop/src-tauri/icons/tray/unreachable.png
new file mode 100644
index 000000000..fd49b274f
Binary files /dev/null and b/desktop/src-tauri/icons/tray/unreachable.png differ
diff --git a/desktop/src-tauri/icons/tray/[email protected] b/desktop/src-tauri/icons/tray/[email protected]
new file mode 100644
index 000000000..7dcfa8070
Binary files /dev/null and b/desktop/src-tauri/icons/tray/[email protected] differ
diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs
index 91ec84fc1..fbaf6d715 100644
--- a/desktop/src-tauri/src/lib.rs
+++ b/desktop/src-tauri/src/lib.rs
@@ -350,6 +350,19 @@ impl TrayRuntimeState {
}
}
+ #[cfg(target_os = "macos")]
+ fn icon(&self) -> tauri::image::Image<'static> {
+ // tray-icon displays these 36px images at 18pt, preserving Retina detail.
+ // Keep the approved V1 pixels: template rendering uses their alpha mask.
+ match self {
+ Self::Starting | Self::Stopping => tauri::include_image!("icons/tray/[email protected]"),
+ Self::Serving(_) => tauri::include_image!("icons/tray/[email protected]"),
+ Self::Unreachable => tauri::include_image!("icons/tray/[email protected]"),
+ Self::Stopped => tauri::include_image!("icons/tray/[email protected]"),
+ }
+ }
+
+ #[cfg(not(target_os = "macos"))]
fn icon(&self) -> tauri::image::Image<'static> {
let color = match self {
Self::Starting | Self::Stopping => [210, 135, 10, 255],
@@ -494,6 +507,7 @@ fn install_native_tray(app: &AppHandle) -> tauri::Result<()> {
app.set_menu(application_menu)?;
TrayIconBuilder::with_id(TRAY_ID)
.icon(TrayRuntimeState::Starting.icon())
+ .icon_as_template(cfg!(target_os = "macos"))
.tooltip(&catalog.starting)
.menu(&tray)
.build(app)?;
@@ -633,7 +647,9 @@ fn refresh_native_controls(app: &AppHandle, requested: Option<TrayRuntimeState>)
}
if let Some(tray) = handle.tray_by_id(TRAY_ID) {
tray.set_tooltip(Some(&label))?;
- tray.set_icon(Some(state.icon()))?;
+ // Plain set_icon resets the template flag on macOS. Update both
+ // atomically so each status keeps native contrast without flicker.
+ tray.set_icon_with_as_template(Some(state.icon()), cfg!(target_os = "macos"))?;
}
Ok(())
};
@@ -2465,12 +2481,57 @@ mod tests {
TrayRuntimeState::from_status(&BootstrapStatus::rejected(BootstrapNoticeCode::ReadyTimeout, true)),
TrayRuntimeState::Unreachable
);
- assert_ne!(
- TrayRuntimeState::Unreachable.icon().rgba(),
- TrayRuntimeState::Stopped.icon().rgba()
+ let states = [
+ TrayRuntimeState::Serving(origin),
+ TrayRuntimeState::Starting,
+ TrayRuntimeState::Unreachable,
+ TrayRuntimeState::Stopped,
+ ];
+ for (index, state) in states.iter().enumerate() {
+ for other in &states[index + 1..] {
+ assert_ne!(state.icon().rgba(), other.icon().rgba(), "{state:?} vs {other:?}");
+ }
+ }
+ assert_eq!(
+ TrayRuntimeState::Starting.icon().rgba(),
+ TrayRuntimeState::Stopping.icon().rgba()
);
}
+ #[cfg(target_os = "macos")]
+ #[test]
+ fn tray_templates_have_transparent_monochrome_pixels_at_both_export_sizes() {
+ // Protect the shipped image boundary: opaque canvases or colored pixels
+ // break native template appearance even if the state mapping is correct.
+ let origin = LoopbackOrigin::parse("http://127.0.0.1:6123").expect("test listener");
+ let images = [
+ (18, tauri::include_image!("icons/tray/serving.png")),
+ (18, tauri::include_image!("icons/tray/starting.png")),
+ (18, tauri::include_image!("icons/tray/unreachable.png")),
+ (18, tauri::include_image!("icons/tray/stopped.png")),
+ (36, TrayRuntimeState::Serving(origin).icon()),
+ (36, TrayRuntimeState::Starting.icon()),
+ (36, TrayRuntimeState::Unreachable.icon()),
+ (36, TrayRuntimeState::Stopped.icon()),
+ ];
+ for (size, image) in images {
+ assert_eq!((image.width(), image.height()), (size, size));
+ assert_eq!(image.rgba().len(), (size * size * 4) as usize);
+ let pixels = image.rgba().as_chunks::<4>().0;
+ assert!(pixels.iter().all(|pixel| pixel[..3] == [0, 0, 0]));
+ assert!(pixels.iter().any(|pixel| pixel[3] > 0), "visible silhouette");
+ assert!(pixels.iter().any(|pixel| pixel[3] == 0), "transparent background");
+ assert!(
+ pixels.iter().enumerate().all(|(index, pixel)| {
+ let x = index as u32 % size;
+ let y = index as u32 / size;
+ (x > 0 && x < size - 1 && y > 0 && y < size - 1) || pixel[3] == 0
+ }),
+ "the silhouette must fit inside the canvas"
+ );
+ }
+ }
+
#[test]
fn readiness_recovers_only_after_consecutive_failures() {
let mut loss = ReadinessLoss::default();
diff --git a/docs/plans/2026-10-16-vibey-tray-icon.md b/docs/plans/2026-10-16-vibey-tray-icon.md
new file mode 100644
index 000000000..cd68b4bcf
--- /dev/null
+++ b/docs/plans/2026-10-16-vibey-tray-icon.md
@@ -0,0 +1,50 @@
+# Vibey macOS tray icon
+
+## Change contract
+
+Use the first preview approved by Max on 2026-10-16, without redrawing its
+silhouette, eyes, or status marks. The second preview was rejected.
+
+- Serving: solid cloud with transparent eyes.
+- Starting and stopping: the same cloud with three transparent dots.
+- Unreachable: the same cloud with a transparent exclamation mark.
+- Stopped: the original outline cloud.
+
+The macOS status item is a monochrome template at creation and after every
+status refresh. Menu text, lifecycle behavior, desktop pet, Dock/application
+icons, and non-macOS tray rendering keep their existing behavior.
+
+## Assets and rendering
+
+`desktop/src-tauri/icons/tray/` contains the approved 18px and 36px PNGs,
+encoded as RGBA for Tauri with identical decoded pixels.
+Tauri embeds the 36px images at compile time; the pinned tray implementation
+sets their logical height to 18pt. macOS therefore has full Retina detail and
+scales the same image on 1x screens. The 18px exports preserve the approved
+1x artwork for inspection. There is no new runtime decoder or dependency.
+
+Use `set_icon_with_as_template` for refreshes: the pinned macOS implementation
+of plain `set_icon` resets the template flag.
+
+## Validation
+
+- Compare all eight decoded RGBA buffers byte-for-byte with the approved preview.
+- Extend the existing tray test boundary to validate dimensions, monochrome
+ alpha, distinct status silhouettes, and the shared starting/stopping image.
+- Build the desktop bootstrap UI; run formatting, focused Rust tests and lint.
+- Exercise native template creation and refresh in an isolated tray-only
+ preview if the local desktop permits capture. It must not start a Runtime,
+ register product plugins, or modify the installed Avibe application.
+- Require exact-head Codex review, no unresolved threads and passing CI.
+ Do not request a review through a comment, merge, or release.
+
+## Local evidence
+
+All eight decoded RGBA buffers match the selected V1 preview exactly. Desktop
+bootstrap and Workbench UI builds, Rust formatting, and all-target/all-feature
+workspace Clippy passed. The focused tray tests passed.
+A temporary tray-only Tauri program displayed all four images in the real macOS
+menu bar. After `set_icon_with_as_template`, every native image reported
+`isTemplate() == true` and an 18x18pt size. A cropped menu-bar screenshot was
+captured; the probe was then stopped and removed from the worktree. This proves
+native image rendering and replacement, not the full packaged Runtime lifecycle.