diff options
| author | Igor Soarez <igor@soarez.org> | 2026-10-27 15:27:14 +0200 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-27 15:27:14 +0200 |
| commit | 9eddef09c769b315f4eabef6eaf4bb58e70d0966 (patch) | |
| tree | c550811ebde6c1b4e2ea7c561a587a15f570fa6a /menubar/main.swift | |
| parent | a7e065cd4f39abda178af58127ead1ab502e0f3b (diff) | |
menu, panel, search: a peach ! in a column of its own; low dimmed more
the ! was the color of the name, read as part of it, and pushed high
names two characters out of line. it is now peach (herdr's palette, no
status uses it) in a fixed-width column every row has, so names line up.
a low agent's name is dimmed to 0.5 (0.7 was hard to see).
Diffstat (limited to 'menubar/main.swift')
| -rw-r--r-- | menubar/main.swift | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/menubar/main.swift b/menubar/main.swift index 135c099..2230817 100644 --- a/menubar/main.swift +++ b/menubar/main.swift @@ -424,6 +424,18 @@ if arguments.contains("--selftest") { if rowTitle(high).string != "✓ ! Fix it" || rowTitlePrefix(high) != "✓ ! " { failures.append("title: a high agent is marked: \(rowTitle(high).string)") } + let markColor = rowTitle(high).attribute(.foregroundColor, at: rowTitlePrefix(high).utf16.count - 2, + effectiveRange: nil) as? NSColor + if markColor != herdrPeach { failures.append("title: the ! is peach") } + let normal = Row(paneId: "%2", agent: "pi", name: "Fix it", status: .done, session: "s", window: "w", since: 1) + if rowTitle(normal).string != "✓ Fix it" || rowTitlePrefix(normal).count != rowTitlePrefix(high).count { + failures.append("title: names line up with or without the mark: '\(rowTitle(normal).string)'") + } + let low = Row(paneId: "%3", agent: "pi", name: "Fix it", status: .done, session: "s", window: "w", since: 1, + importance: .low) + let lowColor = rowTitle(low).attribute(.foregroundColor, at: rowTitlePrefix(low).utf16.count, + effectiveRange: nil) as? NSColor + if lowColor?.alphaComponent != lowImportanceAlpha { failures.append("title: a low agent's name is dimmed") } failures.forEach { print("FAIL \($0)") } print(failures.isEmpty ? "selftest ok" : "selftest: \(failures.count) failed") exit(failures.isEmpty ? 0 : 1) |
