Task manager: show an app icon on each window's pill
CI / test (push) Failing after 18s

Each pill now starts with the app's icon: the same coloured tile with a
letter that the dock draws for that app id, so an app looks the same in
both. The app id comes from windows.all (the task-bar rows carry only
titles); windows without one fall back to a title-keyed tile. Pills
narrower than 72px show just the centred icon.

The tile drawing moves into lib/dock (app_icon, app_glyph) and the dock
uses it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hm1XqzhrA4N8FyhuRa
This commit is contained in:
Claude committed 2026-11-25 18:31:41 +00:00
1 parent 46780c399b
commit 9a25d70f77
5 files changed
+105 -12

No files matched your search

+22
View File
@@ -55,3 +55,25 @@ test "render draws one tile and glyph per app, capped at max_tiles" {
assert_eq(tile_name(apps(), 1), "b!")
assert_eq(tile_name(apps(), 9), "")
}
///|
test "app glyph comes from the app id's last part, else the title" {
assert_eq(app_glyph("org.gnome.Nautilus", "Files"), "N")
assert_eq(app_glyph("foot", ""), "F")
assert_eq(app_glyph("org.chandra.", "x"), "C")
assert_eq(app_glyph("", " terminal"), "T")
assert_eq(app_glyph("", ""), "?")
}
///|
test "an app's icon is its coloured tile plus glyph" {
let ops = app_icon(20, 17, 22, "foot", "F")
assert_eq(ops.length(), 2)
match ops[0] {
FillRect(f) => {
assert_eq(f.rect.x, 9)
assert_eq(f.color.r, tile_color("foot").r)
}
_ => fail("expected a tile")
}
}