From c34ade0e552d3d520f061e27bcc3bf56b373a35a Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sun, 16 Aug 2026 02:43:39 +0800 Subject: [PATCH] fix(assets): serve the chevron this repo draws, not the stock one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `assets/icons/chevrons-up-down.svg` is drawn to the weight every other glyph in that directory uses — `stroke-width="2.1"`, all twenty of them — but it was the one path missing from `agent_icon`, so it fell through to `gpui_component_assets` and the tab strip drew the stock 2.0 chevron beside neighbours a hair heavier. Nothing failed, which is why nothing said so. `every_git_icon_resolves` could not catch it: it walks three paths written out by hand, and its own comment names this exact risk — "an SVG on disk that nobody added to the match above silently renders as nothing". A list cannot notice the file it was never told about. So the new test reads `assets/icons` instead and requires every `.svg` in it to come back from `agent_icon`. Confirmed it fails without the arm this commit adds, naming the file. Found by checking shipped data rather than code — the same pass that turned up the newline descriptions in `assets/completions`. --- src/ui/assets.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ui/assets.rs b/src/ui/assets.rs index e42038e2..c8b4014e 100644 --- a/src/ui/assets.rs +++ b/src/ui/assets.rs @@ -47,6 +47,9 @@ fn agent_icon(path: &str) -> Option<&'static [u8]> { "icons/machine-local.svg" => include_bytes!("../../assets/icons/machine-local.svg"), "icons/machine-remote.svg" => include_bytes!("../../assets/icons/machine-remote.svg"), "icons/refresh.svg" => include_bytes!("../../assets/icons/refresh.svg"), + "icons/chevrons-up-down.svg" => { + include_bytes!("../../assets/icons/chevrons-up-down.svg") + } "icons/agents/claude.svg" => include_bytes!("../../assets/icons/agents/claude.svg"), "icons/agents/codex.svg" => include_bytes!("../../assets/icons/agents/codex.svg"), "icons/agents/gemini.svg" => include_bytes!("../../assets/icons/agents/gemini.svg"), @@ -98,6 +101,33 @@ mod tests { } } + /// Reads the directory rather than a list, because a list is what let + /// `chevrons-up-down.svg` sit here unserved: it was drawn to this repo's + /// weight like every other glyph in `assets/icons`, and being absent from + /// the match it fell through to the stock one, a hair lighter than its + /// neighbours in the same row. Nothing failed, so nothing said so. + #[test] + fn every_icon_this_repo_ships_is_the_one_that_draws() { + let dir = concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons"); + let mut checked = 0; + for entry in std::fs::read_dir(dir).expect("assets/icons is readable") { + let entry = entry.expect("a readable directory entry"); + let name = entry.file_name(); + let name = name.to_string_lossy(); + if !name.ends_with(".svg") { + continue; + } + let path = format!("icons/{name}"); + assert!( + agent_icon(&path).is_some(), + "assets/icons/{name} ships but nothing serves it, so the stock \ + glyph draws in its place" + ); + checked += 1; + } + assert!(checked > 15, "only {checked} icons were checked"); + } + #[test] fn every_git_icon_resolves() { // An SVG on disk that nobody added to the match above silently renders