feat(clients): the OS marks tell gaming distros apart, and Windows looks current
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>
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
// Host OS icon: the web-console derivative of the assets/os-icons masters (Font Awesome
|
||||
// Free brands CC BY 4.0 + Simple Icons CC0 — provenance in assets/os-icons/README.md;
|
||||
// lucide deliberately ships no brand marks). Follows the curated-registry pattern of
|
||||
// api/plugins.ts: a fixed token set, resolved by walking the host's OS-identity chain.
|
||||
// Host OS icon: the web-console derivative of the assets/os-icons masters (per-mark
|
||||
// provenance and licensing in assets/os-icons/README.md; lucide deliberately ships no
|
||||
// brand marks). Follows the curated-registry pattern of api/plugins.ts: a fixed token set,
|
||||
// resolved by walking the host's OS-identity chain. Path data is transcribed from the
|
||||
// masters — `bash scripts/gen-os-icons.sh <token>` prints it ready to paste.
|
||||
import { Monitor } from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
|
||||
/** One monochrome brand mark: original per-icon viewBox, drawn in currentColor. */
|
||||
const OS_ICONS: Record<string, { viewBox: string; d: string }> = {
|
||||
windows: {
|
||||
viewBox: "0 0 448 512",
|
||||
d: "M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z",
|
||||
viewBox: "0 0 24 24",
|
||||
d: "M0 0h11.377v11.377H0zm12.623 0H24v11.377H12.623zM0 12.623h11.377V24H0zm12.623 0H24V24H12.623z",
|
||||
},
|
||||
apple: {
|
||||
viewBox: "0 0 384 512",
|
||||
@@ -47,6 +48,21 @@ const OS_ICONS: Record<string, { viewBox: string; d: string }> = {
|
||||
viewBox: "0 0 640 512",
|
||||
d: "M471.08 102.66s-.3 18.3-.3 20.3c-9.1-3-74.4-24.1-135.7-26.3-51.9-1.8-122.8-4.3-223 57.3-19.4 12.4-73.9 46.1-99.6 109.7C7 277-.12 307 7 335.06a111 111 0 0 0 16.5 35.7c17.4 25 46.6 41.6 78.1 44.4 44.4 3.9 78.1-16 90-53.3 8.2-25.8 0-63.6-31.5-82.9-25.6-15.7-53.3-12.1-69.2-1.6-13.9 9.2-21.8 23.5-21.6 39.2.3 27.8 24.3 42.6 41.5 42.6a49 49 0 0 0 15.8-2.7c6.5-1.8 13.3-6.5 13.3-14.9 0-12.1-11.6-14.8-16.8-13.9-2.9.5-4.5 2-11.8 2.4-2-.2-12-3.1-12-14V316c.2-12.3 13.2-18 25.5-16.9 32.3 2.8 47.7 40.7 28.5 65.7-18.3 23.7-76.6 23.2-99.7-20.4-26-49.2 12.7-111.2 87-98.4 33.2 5.7 83.6 35.5 102.4 104.3h45.9c-5.7-17.6-8.9-68.3 42.7-68.3 56.7 0 63.9 39.9 79.8 68.3H460c-12.8-18.3-21.7-38.7-18.9-55.8 5.6-33.8 39.7-18.4 82.4-17.4 66.5.4 102.1-27 103.1-28 3.7-3.1 6.5-15.8 7-17.7 1.3-5.1-3.2-2.4-3.2-2.4-8.7 5.2-30.5 15.2-50.9 15.6-25.3.5-76.2-25.4-81.6-28.2-.3-.4.1 1.2-11-25.5 88.4 58.3 118.3 40.5 145.2 21.7.8-.6 4.3-2.9 3.6-5.7-13.8-48.1-22.4-62.7-34.5-69.6-37-21.6-125-34.7-129.2-35.3.1-.1-.9-.3-.9.7zm60.4 72.8a37.54 37.54 0 0 1 38.9-36.3c33.4 1.2 48.8 42.3 24.4 65.2-24.2 22.7-64.4 4.6-63.3-28.9zm38.6-25.3a26.27 26.27 0 1 0 25.4 27.2 26.19 26.19 0 0 0-25.4-27.2zm4.3 28.8c-15.4 0-15.4-15.6 0-15.6s15.4 15.64 0 15.64z",
|
||||
},
|
||||
// The gaming distros get their own mark rather than their family's: "a Bazzite box" and
|
||||
// "a Fedora box" are different machines to the person reading the card, and these three
|
||||
// are what this project's hosts actually run.
|
||||
bazzite: {
|
||||
viewBox: "0 0 24 24",
|
||||
d: "M7.178 0h3.589v7.178h7.524c3.153 0 5.709 2.556 5.709 5.709 0 6.138-4.976 11.113-11.113 11.113-3.153 0-5.709-2.556-5.709-5.709V10.766H0v-3.589h7.178zm3.589 10.766v7.524c0 1.171.949 2.12 2.12 2.12 4.156 0 7.524-3.369 7.524-7.524 0-1.171-.949-2.12-2.12-2.12z",
|
||||
},
|
||||
cachyos: {
|
||||
viewBox: "0 0 24 24",
|
||||
d: "M5.301 2.646 0 11.771l5.541 9.583h11.486l2.904-5.017H8.102l-2.56-4.429L8.067 7.54h6.063l2.83-4.893ZM20.058 4.12a.748.748 0 0 0 0 1.496.748.748 0 0 0 0-1.496m-1.983 4.303a1.45 1.45 0 0 0 0 2.9 1.45 1.45 0 0 0 0-2.9m4.02 3.98a1.904 1.904 0 0 0 0 3.809 1.904 1.904 0 0 0 0-3.81",
|
||||
},
|
||||
nobara: {
|
||||
viewBox: "0 0 24 24",
|
||||
d: "M23.808 11.808v8.281a3.542 3.542 0 0 1-3.542 3.527h-.46a3.543 3.543 0 0 1-3.083-3.513v-7.282l3.543-1.013-3.66-1.045a4.724 4.724 0 0 0-9.33 1.045v2.362a2.362 2.362 0 0 0 2.362 2.362 3.543 3.543 0 0 1 3.543 3.542V24a3.539 3.539 0 0 0-3.542-3.542 3.537 3.537 0 0 0-3.063 1.76 3.54 3.54 0 0 1-2.382 1.398h-.46A3.542 3.542 0 0 1 .192 20.09V3.543a3.542 3.542 0 0 1 6.323-2.194A11.756 11.756 0 0 1 12 0c6.521 0 11.808 5.287 11.808 11.808zm-9.446 0A2.359 2.359 0 0 1 12 14.17a2.362 2.362 0 1 1 2.362-2.362z",
|
||||
},
|
||||
};
|
||||
|
||||
/** `macos` renders the apple mark, `steamos` the steam mark — same aliases as every client. */
|
||||
|
||||
@@ -33,6 +33,18 @@ export const WindowsHost: Story = {
|
||||
},
|
||||
};
|
||||
|
||||
/** A gaming distro wears its OWN mark, not its family's: `cachyos` is resolved before the
|
||||
* `arch` it descends from, which is the whole point of shipping art for the leaf. */
|
||||
export const CachyOsHost: Story = {
|
||||
args: {
|
||||
host: {
|
||||
data: { ...hostInfo, os: "linux/arch/cachyos", os_name: "CachyOS Linux" },
|
||||
isLoading: false,
|
||||
error: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/** An unrecognized distro chain walks up to its family mark — here neither `chimera` nor
|
||||
* `frontier` have art, so the icon degrades all the way to generic Tux. */
|
||||
export const UnknownDistro: Story = {
|
||||
|
||||
Reference in New Issue
Block a user