check passes with Phase 0's audit numbers unchanged and one more test. The plan now says it is built, the rebrand's brand-assets phase points to it, and the index entry says what is still waiting on a mac, a phone and Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
258 lines
18 KiB
Markdown
258 lines
18 KiB
Markdown
# The sphinx icon on iOS, desktop and in the app
|
||
|
||
Giza's icon is the desert sphinx: one path in sand, `#D2AB5E`, whose cutouts show
|
||
whatever is behind it. Android has it already (`a4f54ad4`, *Update icon.*, on `giza`). This plan
|
||
puts the same artwork on the three places that still show something else:
|
||
|
||
- **iOS**, whose `AppIcon.appiconset` holds a pixel-art orange rock on white from before the fork,
|
||
in two files named `Icon-App-1024(1).png` and `Icon-App-1024 1.png`, and an empty tinted slot;
|
||
- **desktop**, which has no icon at all — `nativeDistributions` names none and `Main.kt`'s
|
||
`Window` passes none, so the installers, the dock and the title bar show Java's;
|
||
- **`compose-multiplatform.xml`**, the in-app logo, which is still the previous brand's black
|
||
mark on `#FF3A1A` and is drawn in the middle of every QR code the app shows (`QRCodeView`).
|
||
|
||
It was written as a plan against `390d4bc3` and is **built**, one commit per phase, on
|
||
`claude/giza-icon-ios-update-b2e5b4`. What is left is what this Linux machine cannot show: an
|
||
Xcode build and the three iOS appearances on a phone, a `.dmg` and an `.msi`, and a camera reading
|
||
a QR code with the new logo in it — the [status](#status) table says which phase each belongs to.
|
||
It finishes Phase 5 of [giza-rebrand.md](./giza-rebrand.md) for the platforms that phase left on
|
||
the old assets.
|
||
|
||
## What there is to work from
|
||
|
||
The designer delivered five files. Only two are needed:
|
||
|
||
| file | what it is | used for |
|
||
|---|---|---|
|
||
| `Desert Sphinx App Icon - Transparent Cutouts.svg` | the sand path alone, `fill-rule="evenodd"`, transparent everywhere else | **the master.** Every output below is rendered from it |
|
||
| `iOS Desert Sphinx App Icon 1024.png` | the same path at 1:1 on `#080A09`, opaque RGB, 1024 px | the reference for the iOS composition; not committed |
|
||
| `Two-Color Desert Sphinx App Icon.svg` | the path on a `#080A09` rect | not needed — the master plus a background colour is the same picture |
|
||
| `Two-Color … - Transparent.svg` | sand and `#080A09` interior, transparent outside | not needed |
|
||
| `Blackj … Transparent Cutouts.svg` | the master's path filled `#000000` | not needed — Android's monochrome layer already is this |
|
||
|
||
The path in the master is byte-for-byte the path in Android's `ic_launcher_foreground.xml` once
|
||
its spaces become commas. That is the property this plan keeps: **one path, one sand, one
|
||
background, every platform.** A later redraw is then one file and one script run.
|
||
|
||
Facts about the artwork that the compositions below depend on, measured from the path (the last
|
||
one was found while building Phase 1, and corrects what the first draft of this plan said):
|
||
|
||
- its bounding box in the 1024 viewport is x 122–901, y 89–939: 779 × 850, centred on (512, 514);
|
||
- it is taller than it is wide, so height is the dimension that hits a mask first;
|
||
- Android draws it at 0.5793 of the viewport (`translate 218.13, 215.38`), so it is 492 px tall
|
||
in 1024 — inside the adaptive icon's 66 dp safe circle;
|
||
- it has no holes in the geometric sense. Its thirteen sub-paths all wind the same way and none
|
||
lies inside another: the disc is one outline that runs in and out around the cutouts rather
|
||
than a circle with shapes subtracted. So the fill rule does not matter -- ImageMagick renders it
|
||
identically under `evenodd` and `nonzero` -- and the master's `fill-rule="evenodd"` is kept only
|
||
because it costs nothing and is what the designer wrote. A later redraw that *does* nest its
|
||
holes would depend on it, which is one reason Phase 2's test samples a cutout.
|
||
|
||
## Decisions
|
||
|
||
Each has a recommendation, and the phases are written to it.
|
||
|
||
| | question | recommended | alternative |
|
||
|---|---|---|---|
|
||
| **I1** | The background: Android's `#000000` or the designer's `#080A09`? | **`#000000`**, Android's. The two are 8/255 apart and indistinguishable on a home screen; what is visible is iOS and Android disagreeing in a screenshot of both. The designer's value is recorded here in case a later brief wants it back — it is one constant in the script | `#080A09` everywhere, which means re-running Android's foreground too |
|
||
| **I2** | iOS composition: the designer's 1:1 (art 83 % of the height) or Android's 0.579? | **1:1**, as the designer composed the iOS file. The iOS mask is a squircle, not a circle, and nothing in the art comes nearer its edge than the beard's tip, 85 px above the bottom; the flares by the corners clear the corner curve by more than 180 px | Android's scale, which leaves a small sphinx in a lot of black on a 60 pt icon |
|
||
| **I3** | macOS shape | **Apple's Big Sur grid**: an 824 px black rounded square (radius 185) centred in a transparent 1024 canvas, the art inside it. A full-bleed square sits in the dock as the only square icon there | full bleed |
|
||
| **I4** | Rename `compose-multiplatform.xml`? | **No.** It is the name asked for, and one call site imports it. A rename to `giza_logo` is a two-line change any time later | rename now |
|
||
|
||
## Phase 0 — baseline and the master
|
||
|
||
1. **Bring Android in.** This branch was cut at `390d4bc3`; `a4f54ad4` is on `giza` after it.
|
||
Merge `giza` so the Android icon is in the tree the other platforms are matched against.
|
||
2. **Commit the master** as `docs/brand/giza-sphinx.svg` — the *Transparent Cutouts* file,
|
||
unchanged. `docs/brand/` is outside `composeApp` and `iosApp`, so neither the build nor the
|
||
brand audit reads it; it is the source the generator reads.
|
||
3. **Pin the sameness.** Normalise the master's `d` (spaces to commas) and compare it with the
|
||
`pathData` in `ic_launcher_foreground.xml` and `ic_launcher_monochrome.xml`. Equal is the
|
||
expected result; if they differ, stop and ask which is current before going on.
|
||
4. **Baseline.** Record `./gradlew :composeApp:m3Audit` and the `jvmTest` run/failed/skipped
|
||
counts, so Phase 5 can say nothing moved.
|
||
|
||
**Done when** the master is committed, its path equals Android's, and the baseline is written down
|
||
in this document's status table.
|
||
|
||
## Phase 1 — one generator for every output
|
||
|
||
`docs/scripts/app-icons.py`: Python 3 standard library plus ImageMagick's `convert` (present on
|
||
this Linux machine as 6.9.12; `brew install imagemagick` on a mac). ImageMagick's own SVG
|
||
renderer draws the master correctly — a 256 px probe rendered every cutout.
|
||
No cairosvg, Pillow or Inkscape, none of which is installed here.
|
||
|
||
It reads `docs/brand/giza-sphinx.svg`, takes two constants — `SAND = "#D2AB5E"`,
|
||
`BACKGROUND = "#000000"` (I1) — and writes:
|
||
|
||
| output | composition | format |
|
||
|---|---|---|
|
||
| `iosApp/…/AppIcon.appiconset/AppIcon-light.png` | art 1:1 on `BACKGROUND`, full bleed (I2) | 1024², **RGB, no alpha** |
|
||
| `…/AppIcon-dark.png` | art 1:1 in sand on transparent | 1024², RGBA |
|
||
| `…/AppIcon-tinted.png` | art 1:1 in white on `BACKGROUND` | 1024², grayscale |
|
||
| `composeApp/desktop-icons/giza.icns` | Big Sur plate (I3): 824² rounded square, radius 185, centred; art scaled to 0.68 and centred on the plate | ICNS, PNG payloads |
|
||
| `composeApp/desktop-icons/giza.ico` | the same plate, but filling the canvas (radius 12 %), art at 0.80 | ICO, 16 20 24 32 40 48 64 256 |
|
||
| `composeApp/desktop-icons/giza.png` | as the `.ico` | 512², RGBA |
|
||
| `composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml` | `BACKGROUND` square, art 1:1 (Phase 2) | vector XML |
|
||
|
||
Three things in it are not obvious:
|
||
|
||
- **The light icon must have no alpha channel at all**, not merely an opaque one: App Store
|
||
Connect rejects a 1024 marketing icon with alpha. Flatten with `-alpha remove -alpha off` and
|
||
assert `identify -format %[channels]` says `srgb`.
|
||
- **ICNS is written by the script**, because `iconutil` exists only on macOS and ImageMagick 6
|
||
cannot write it. The format is a `icns` header and length followed by chunks of four-byte type,
|
||
four-byte big-endian length and a PNG: `ic07` 128, `ic08` 256, `ic09` 512, `ic10` 1024,
|
||
`ic11` 32, `ic12` 64, `ic13` 256, `ic14` 512 — about forty lines of `struct.pack`.
|
||
- **The vector XML is generated, not hand-edited**, from the same `d`, so it cannot drift from
|
||
the PNGs. Compose's vector parser takes SVG path syntax as Android's does.
|
||
|
||
The 0.68 and 0.80 are starting values: the script prints a contact sheet
|
||
(`scratch/app-icons-sheet.png`, not committed) of every output at every size, and the values are
|
||
settled by looking at it. At 16 and 20 px the stripes will close up; that is acceptable for a
|
||
taskbar glyph, and if it is not, the fix is a simpler path for the two smallest ICO entries, not
|
||
a different scale.
|
||
|
||
**Done when** one run of the script, from a clean tree, writes every file in the table and a second
|
||
run changes none of them.
|
||
|
||
## Phase 2 — `compose-multiplatform.xml`
|
||
|
||
The drawable becomes:
|
||
|
||
```xml
|
||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||
android:width="512dp" android:height="512dp"
|
||
android:viewportWidth="1024" android:viewportHeight="1024">
|
||
<path android:fillColor="#000000" android:pathData="M0,0h1024v1024h-1024z"/>
|
||
<path android:fillColor="#D2AB5E" android:fillType="evenOdd"
|
||
android:pathData="M461,859L460,894…Z"/>
|
||
</vector>
|
||
```
|
||
|
||
— the same shape as the file it replaces (a full background square, then the mark), with the old
|
||
`#FF3A1A` and black swapped for black and sand. That keeps `QRCodeView` unchanged: its logo
|
||
painter already fills the rect it is given and `QRCodeBackgroundPainter`'s `bluePill` behind it
|
||
is covered, exactly as it is today. The logo's share of the code (`size = 0.3f`, natural padding)
|
||
does not change, so neither does what the code's error correction has to absorb.
|
||
|
||
The colours are literals in a resource, not in Kotlin, so the m3 colour budget does not see them,
|
||
and they are the brand's own values rather than a role standing in for one — the same position
|
||
as Android's launcher XML.
|
||
|
||
**A test, because a wrong logo fails silently.** `AppLogoDrawableJvmTest` in `jvmTest` composes
|
||
`Image(painterResource(Res.drawable.compose_multiplatform))` at 256 px with
|
||
`runDesktopComposeUiTest`, captures it, and asserts four pixels against ImageMagick's 256 px
|
||
render of the master: sand in the face and in the disc, black in a cutout inside the disc (the
|
||
band between the left lappet's stripes) and black in the corner. A drawable regenerated from a
|
||
different master, a dropped background, or a future master whose nested holes lose their fill
|
||
rule each moves one of them.
|
||
|
||
**Done when** the QR codes in the app show the sphinx on black, a phone camera still reads one in
|
||
light and in dark theme, and the test passes.
|
||
|
||
## Phase 3 — iOS
|
||
|
||
1. **Replace the files.** Delete `Icon-App-1024(1).png` and `Icon-App-1024 1.png`; add the three
|
||
from Phase 1. The new names say which appearance each is for, which the old ones did not.
|
||
2. **`Contents.json`**:
|
||
|
||
```json
|
||
{
|
||
"images" : [
|
||
{ "filename" : "AppIcon-light.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" },
|
||
{ "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ],
|
||
"filename" : "AppIcon-dark.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" },
|
||
{ "appearances" : [ { "appearance" : "luminosity", "value" : "tinted" } ],
|
||
"filename" : "AppIcon-tinted.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" }
|
||
],
|
||
"info" : { "author" : "xcode", "version" : 1 }
|
||
}
|
||
```
|
||
|
||
`ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon` is already set in both configurations of
|
||
`project.pbxproj`; nothing there changes.
|
||
3. **Why each appearance is what it is.**
|
||
- *Light* is the designer's iOS composition, opaque.
|
||
- *Dark* is the art on transparency because iOS 18 and later draw their own dark gradient
|
||
behind a dark icon; an opaque black one would be a black square on it.
|
||
- *Tinted* is grayscale because the system tints by luminance: white art gives the full tint,
|
||
black gives none. Filling the slot rather than leaving it empty stops iOS deriving a tinted
|
||
icon from the light one, which would tint the background and lose the mark.
|
||
|
||
**Done when** an iOS build installs with the sphinx on the home screen in light, dark and tinted
|
||
(Settings › Home Screen › Customise), in Spotlight and in the app switcher, and an archive
|
||
validates in Xcode's Organizer without an icon warning. This needs a mac; nothing in this phase
|
||
can be checked here beyond the PNGs' channels and sizes.
|
||
|
||
## Phase 4 — desktop
|
||
|
||
1. **Installers.** In `composeApp/build.gradle.kts`, inside `nativeDistributions`:
|
||
|
||
```kotlin
|
||
macOS {
|
||
iconFile.set(project.file("desktop-icons/giza.icns"))
|
||
}
|
||
windows {
|
||
iconFile.set(project.file("desktop-icons/giza.ico"))
|
||
upgradeUuid = "43e5b023-66d9-4c8c-ad31-efe28a96286b" // unchanged; see its comment
|
||
}
|
||
linux {
|
||
packageName = "giza"
|
||
iconFile.set(project.file("desktop-icons/giza.png"))
|
||
}
|
||
```
|
||
|
||
The existing `windows` and `linux` blocks gain one line each; the `upgradeUuid` comment stays
|
||
where it is.
|
||
2. **The window.** `Main.kt`'s `Window` takes
|
||
`icon = painterResource(Res.drawable.compose_multiplatform)`. That is the title bar and taskbar
|
||
on Windows and on X11. It is the same drawable as the QR logo, which is the point: one in-app
|
||
mark. A vector painter is rasterised by Compose at each size the platform asks for.
|
||
3. **What the window icon does not reach**, so nobody spends an afternoon on it: the macOS dock
|
||
takes its icon from the bundle's `.icns`, so `./gradlew run` on a mac still shows Java's there
|
||
(`java.awt.Taskbar.iconImage` would fix that for development runs and is not worth adding).
|
||
GNOME on Wayland ignores window icons and matches the window to a `.desktop` file, which only
|
||
an installed `.deb` has.
|
||
|
||
**Done when** the `.deb` installs with the sphinx in the application grid and dock, `./gradlew run`
|
||
shows it in the title bar on Windows or X11, and a `.dmg` built on a mac shows it in Finder, the
|
||
dock and ⌘-Tab. `packageDeb` can be checked on this machine; the `.dmg` and `.msi` need theirs.
|
||
|
||
## Phase 5 — checks and the record
|
||
|
||
1. `./gradlew check` — which runs `m3-audit`, `brand-audit`, `wallet-audit` and the Magpie lock
|
||
audit — passes with the Phase 0 numbers unchanged. The only Kotlin touched is one argument in
|
||
`Main.kt` and one test.
|
||
2. `./gradlew :composeApp:jvmTest` passes with one more test than Phase 0's count.
|
||
3. `./gradlew :composeApp:compileDebugKotlinAndroid` — Android is untouched, but the drawable is
|
||
in `commonMain` and Android compiles it too.
|
||
4. Add this document to `docs/README.md`, and add one line under Phase 5 of
|
||
`giza-rebrand.md` pointing here as the place the icon was finished.
|
||
5. Fill in the status table below, phase by phase, saying for each device check whether it was
|
||
done or what it is waiting for.
|
||
|
||
## Not in this plan
|
||
|
||
- **Icon Composer (`.icon`) for iOS 26's Liquid Glass.** Asset-catalogue icons still ship on iOS
|
||
26, and the system applies its own glass treatment to them. A layered `.icon` would give the
|
||
system the sand and the black separately; it needs Xcode 26 and a mac, and is its own change.
|
||
- **macOS 26's squircle enclosure.** macOS 26 sets icons it does not recognise as conforming on a
|
||
grey squircle. The Big Sur plate (I3) is the shape it expects, but whether a jpackage `.icns`
|
||
without an asset catalogue escapes the enclosure is something only a mac on 26 can say. If it
|
||
does not, the remedy is an asset catalogue in the bundle, which jpackage does not build.
|
||
- **`AccentColor`.** It is empty (the system blue) and tints only SwiftUI chrome, of which the app
|
||
has none outside `ContentView`. Setting it to sand is a one-line change for whoever wants it.
|
||
- **The Play Store icon and Android's mipmaps** — done in `a4f54ad4`.
|
||
|
||
## Status
|
||
|
||
| phase | state |
|
||
|---|---|
|
||
| 0 | done. `giza` merged in (`a4f54ad4`, Android's icon). The master is `docs/brand/giza-sphinx.svg`, the designer's *Transparent Cutouts* file unchanged; its path equals the `pathData` of both `ic_launcher_foreground.xml` and `ic_launcher_monochrome.xml`, 1,567 characters each. Baseline at `e00d0f80`: `jvmTest` 1,407 run, 0 failed, 0 skipped; `m3Audit` all budgets met, adaptive APIs 12 (floor 12), navigation components 2 (floor 2). Measuring the path also showed its thirteen sub-paths are disjoint, so the fill rule is not load-bearing; the facts above say so |
|
||
| 1 | done. `docs/scripts/app-icons.py`, with `--only ios|desktop|xml`, `--root` (to write somewhere other than the tree) and `--sheet`. Run twice into two scratch roots it wrote byte-identical files. The light icon is RGB with no alpha, the dark RGBA, the tinted grayscale; the `.ico` holds eight entries, 256 as PNG; the `.icns` parses as eight PNG chunks, `ic07`–`ic14`, with the sizes the table names. The contact sheet left 0.68 and 0.80 as they were: the stripes stay apart down to 32 px and merge, as expected, at 16 |
|
||
| 2 | built. `compose-multiplatform.xml` is generated (`--only xml`): a black square and the sand mark, with a comment naming the script and the master. `AppLogoDrawableJvmTest` passes, and fails at line 54 when the previous drawable is put back. **Not yet checked:** a phone camera reading a QR code with the new logo, in light and dark theme — the logo covers the same share of the code as before |
|
||
| 3 | built. The two old PNGs are gone; `AppIcon-light.png` (RGB, no alpha), `AppIcon-dark.png` (RGBA) and `AppIcon-tinted.png` (grayscale), each 1024², are generated (`--only ios`) and named in `Contents.json`. Nothing in `project.pbxproj` named the old files. **Not yet checked, for want of a mac:** an Xcode build, the home screen in light, dark and tinted, and Organizer's validation of an archive |
|
||
| 4 | built. `composeApp/desktop-icons/giza.{icns,ico,png}` are generated (`--only desktop`) and named by `macOS`, `windows` and `linux` under `nativeDistributions`; `Main.kt`'s `Window` takes the in-app logo as its icon. `packageDeb` succeeds on Linux, and the `.deb` carries `opt/giza/lib/Giza.png` byte-identical to `giza.png`, with `giza-Giza.desktop` pointing `Icon=` at it. **Not yet checked:** the package installed and seen in a launcher (it needs root), the window icon on Windows or X11, and a `.dmg` or `.msi`, which need their own machines |
|
||
| 5 | done on Linux. `./gradlew check` passes — `m3Audit` all budgets met with adaptive APIs 12 and navigation components 2 (the Phase 0 numbers), `brandAudit` 0, `walletAudit` 0, the Magpie lock 0 problems. `jvmTest` 1,408 run, 0 failed, 0 skipped: Phase 0's 1,407 and `AppLogoDrawableJvmTest`. `compileDebugKotlinAndroid` succeeds. Still to be seen on devices: Phase 2's QR scan, Phase 3 on a mac and a phone, Phase 4's installed `.deb`, `.dmg` and `.msi` |
|