From 6d9a2b3659ae794aae411c6a342bb3d6d0d3bd4f Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Mon, 20 Jul 2026 18:14:36 +0800 Subject: [PATCH 1/3] fix(brand): use black field for Codex tab avatar --- src/core/cli_agent.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/cli_agent.rs b/src/core/cli_agent.rs index eb6a2964..6ee76dc0 100644 --- a/src/core/cli_agent.rs +++ b/src/core/cli_agent.rs @@ -184,13 +184,13 @@ impl CLIAgent { } /// Brand accent (0xRRGGBB) for the tab chip's agent dot. Chosen for legibility - /// on both light and dark themes rather than exact brand black/white — a pure - /// black or white dot vanishes against one theme, so vendors whose mark is - /// monochrome (Codex/OpenAI, Cursor) get a recognizable mid-tone hue instead. + /// on both light and dark themes rather than exact brand black/white. A pure + /// black or white dot vanishes against one theme, so monochrome vendors get + /// a recognizable mid-tone hue instead; Codex keeps its black field. pub fn accent_rgb(self) -> u32 { match self { CLIAgent::Claude => 0xD97757, // Claude terracotta - CLIAgent::Codex => 0x10A37F, // OpenAI green (black mark reads as this) + CLIAgent::Codex => 0x000000, // Codex black field CLIAgent::Gemini => 0x4285F4, // Google blue CLIAgent::Aider => 0x14B8A6, // teal CLIAgent::Amp => 0xF34E3F, // Amp red @@ -763,6 +763,11 @@ mod tests { } } + #[test] + fn codex_avatar_uses_its_black_brand_field() { + assert_eq!(CLIAgent::Codex.accent_rgb(), 0x000000); + } + #[test] fn detects_newer_agents_by_command() { for (cmd, agent) in [ From 7eba9153e34a40ce3a1761f434416f42755d1859 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Tue, 21 Jul 2026 10:45:24 +0800 Subject: [PATCH 2/3] fix(tray): override hardcoded 18pt NSImage size to 22pt on macOS --- src/ui/tray/icon.rs | 6 +++--- src/ui/tray/native.rs | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/ui/tray/icon.rs b/src/ui/tray/icon.rs index cde24399..ae11b045 100644 --- a/src/ui/tray/icon.rs +++ b/src/ui/tray/icon.rs @@ -27,9 +27,9 @@ const GLYPH_SVG: &[u8] = include_bytes!("../../../assets/tray.svg"); #[cfg(not(target_os = "macos"))] const GLYPH_SVG: &[u8] = include_bytes!("../../../assets/app-icon.svg"); -/// Physical pixel size. macOS forces the NSImage to 18 pt in the status bar -/// regardless of pixel size (see tray-icon's macOS backend), so 36 px renders -/// crisp on retina. Windows tray slots are 16–32 px; 32 downsamples cleanly. +/// Physical pixel size. On macOS the bitmap is 36 px (retina-crisp at 18 pt); +/// native.rs then overrides the NSImage to 22 pt so the glyph fills the menu +/// bar. Windows tray slots are 16–32 px; 32 downsamples cleanly. #[cfg(target_os = "macos")] const SIZE: u32 = 36; #[cfg(not(target_os = "macos"))] diff --git a/src/ui/tray/native.rs b/src/ui/tray/native.rs index cecbd24d..b073bc6a 100644 --- a/src/ui/tray/native.rs +++ b/src/ui/tray/native.rs @@ -62,6 +62,27 @@ impl Backend { return None; } }; + + // tray-icon hardcodes the NSImage height to 18 pt; override to a + // larger size so the glyph fills more of the menu bar. The bitmap + // itself is already rendered at `icon::SIZE` px (retina-ready). + #[cfg(target_os = "macos")] + if let Some(status_item) = tray.ns_status_item() { + if let Some(mtm) = objc2::MainThreadMarker::new() { + if let Some(button) = status_item.button(mtm) { + if let Some(nsimage) = button.image() { + // 22 pt matches the macOS menu bar height; the glyph + // scales proportionally from its 96×96 viewBox. + let target_h: f64 = 22.0; + let aspect = nsimage.size().width / nsimage.size().height; + nsimage.setSize(objc2_foundation::NSSize::new( + target_h * aspect, + target_h, + )); + } + } + } + } Some(Self { tray, #[cfg(not(target_os = "macos"))] From 6a85964390d574b41cf34e687611167f863eff64 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Tue, 21 Jul 2026 12:21:57 +0800 Subject: [PATCH 3/3] style: rustfmt --- src/ui/tray/native.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ui/tray/native.rs b/src/ui/tray/native.rs index b073bc6a..4eb8b762 100644 --- a/src/ui/tray/native.rs +++ b/src/ui/tray/native.rs @@ -75,10 +75,7 @@ impl Backend { // scales proportionally from its 96×96 viewBox. let target_h: f64 = 22.0; let aspect = nsimage.size().width / nsimage.size().height; - nsimage.setSize(objc2_foundation::NSSize::new( - target_h * aspect, - target_h, - )); + nsimage.setSize(objc2_foundation::NSSize::new(target_h * aspect, target_h)); } } }