Three things were wrong with the host-card OS icons. The Windows mark was Font Awesome 5's, which is still the Windows 8/10 flag with the perspective skew — dated next to the flat four-pane mark Microsoft has shipped since Windows 11. No icon set has the current one (Simple Icons carries no windows/microsoft slug at all), so it is drawn here: four equal squares at the authentic 11.377 + 1.246 proportion. The Decky plugin was pulling FaWindows straight from react-icons, so it now inlines the masters like the web console does, or it would have kept the old flag regardless. Bazzite, CachyOS and Nobara collapsed onto their family's mark. The host already advertises the full chain, so this is purely missing art: all three now ship a leaf mark, because "a Bazzite box" and "a Fedora box" are different machines to the person reading the card. CachyOS and Nobara come from Simple Icons; Bazzite has no icon anywhere, so its "b" is lifted out of the project's own badge (Apache-2.0, attributed). On Android every non-square mark was stretched. A VectorPainter maps the viewport onto the ImageVector's default size with independent x and y scales, so declaring a 448x512 Tux as 24x24 dp squashed it — silently, no crash, no warning. The longest viewport edge now sets the 24 dp box and the other follows the ratio, which is what Icon()'s ContentScale.Fit expects. A unit test pins the invariant; every other client was already correct. Also: scripts/gen-os-icons.sh replaces the undocumented hand-run pipeline that turns a master into the GTK symbolic SVG, the Windows PNG and the Apple template PDF. It reproduces the committed artifacts byte-identically. Verified: web and Decky typecheck, Decky bundles, Android compiles and its tests pass, PunktfunkKit builds, osinfo's tests pass. Not verified on glass, and the GTK/Windows client crates do not build on macOS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
27 lines
1.4 KiB
Swift
27 lines
1.4 KiB
Swift
// The host cards' OS marks: template vector imagesets in Resources/OsIcons.xcassets
|
|
// (generated from the repo's assets/os-icons masters by scripts/gen-os-icons.sh —
|
|
// per-mark provenance and licensing in that directory's README), resolved from the host's
|
|
// OS-identity chain via PunktfunkShared's `osIconTokens` walk. Template rendering means
|
|
// they tint with `foregroundStyle` like an SF Symbol.
|
|
|
|
import PunktfunkShared
|
|
import SwiftUI
|
|
|
|
/// The icon tokens this client ships art for: the families a chain can land on, plus the
|
|
/// gaming distros that earn their own mark because "a Bazzite box" and "a Fedora box" are
|
|
/// different machines to the person reading the card. A distro with no mark of its own
|
|
/// still degrades to its family's and finally to Tux via the chain walk.
|
|
private let osIconTokensShipped: Set<String> = [
|
|
"windows", "apple", "linux", "steam", "ubuntu", "fedora", "arch", "debian", "nixos",
|
|
"opensuse", "bazzite", "cachyos", "nobara",
|
|
]
|
|
|
|
/// The mark for an OS-identity chain (`linux/fedora/bazzite`, ...), or nil — no view at
|
|
/// all — when the host doesn't advertise one / nothing in the chain is recognized, so
|
|
/// those cards render exactly as they did before the field existed.
|
|
public func osIconImage(for chain: String?) -> Image? {
|
|
osIconTokens(chain)
|
|
.first(where: osIconTokensShipped.contains)
|
|
.map { Image("os-\($0)", bundle: .module) }
|
|
}
|