APP_ICONS.md
docs/architecture/APP_ICONS.md
1# App icon capabilities and ownership23Implemented for the feature 7 milestone on 2026-10-04. The original red torii artwork remains the default. The selectable Torii design is code-native geometric artwork, with separate light and dark appearances. App color themes, including pure black and Follow system, continue using existing profile settings.45## Platform decisions67| Target | Installed icon selection | Appearance | Fallback and other surfaces |8| --- | --- | --- | --- |9| Android 26+ | Original, Torii | Light or Dark artwork | Stable activity aliases target the always-enabled MainActivity. Torii supplies adaptive foreground/background and Android 13+ monochrome layers; the launcher owns themed colors and refresh timing. No automatic light/dark switch is promised. Application-level branding and TV banner remain original. |10| iOS/iPadOS | Original, Torii, only when the running bundle supports and includes alternates | Light or Dark; Follow system on iOS 18+ | ToriiSystem includes Any/Dark/Tinted asset variations, chosen by Home Screen appearance, independently of the app theme. OS recoloring and confirmation remain system behavior. Unsupported/missing bundle assets fall back to Original. |11| Desktop | Static Original | Packaged artwork | Compose window/tray retain original branding. DMG/MSI/DEB receive the existing brand in ICNS/ICO/PNG containers. Java can change some running taskbar/dock surfaces, but that does not portably change the installed bundle/shortcut icon, so this milestone exposes no installed-icon switching. |12| Browser | Static Original | Packaged artwork | The page receives an original favicon. There is no web app manifest/installation feature in this target today. Browser-managed installed launch surfaces have no synchronous alternate-icon API comparable to the native targets; no runtime installed-web-app choice is offered. |1314The picker exposes the service's actual choices. Design and appearance are separate, and Original has no appearance override. Android does not display an unsupported Follow system option; iOS checks both OS version and alternate names in its compiled bundle metadata. Follow system previews both supplied artwork variants rather than using the app theme to guess the Home Screen's appearance. Radio groups, text labels, busy state, scrollable dialog content and reset/check-current actions provide keyboard and assistive access.1516These decisions use primary platform guidance: [Android activity aliases](https://developer.android.com/guide/topics/manifest/activity-alias-element), [PackageManager component state](https://developer.android.com/reference/android/content/pm/PackageManager), [adaptive/themed icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive), [Apple alternate icons](https://developer.apple.com/documentation/xcode/configuring-your-app-to-use-alternate-app-icons), [Apple icon appearance assets](https://developer.apple.com/documentation/xcode/configuring-your-app-icon), [Java taskbar support](https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/java/awt/Taskbar.html), and [browser-controlled manifest updates](https://www.w3.org/TR/appmanifest/).1718## Installation state and failure recovery1920`AppIconService` reads selection from the operating system. Android PackageManager persists alias enabled states, and iOS persists `alternateIconName`. There is no icon key in DbSettings, Room, browser snapshots, cloud sync or native backups. A future ProfileSession must share the process-owned service; profile creation/switching/restore must never apply a launcher choice.2122The settings ViewModel owns selection, draft, picker, busy and failure state. Draft changes do not touch the installation. Apply/reset serialize through the platform service, await completion even if the settings route closes, and read the OS state back. Failures and mismatches never show an optimistic success. A later visit/foreground resume refreshes from the OS. Unknown/inconsistent state allows reset/retry.2324Android 33+ updates all aliases in one batch with DONT_KILL_APP. Android 26–32 enables the selected alias before disabling others. A partial failure may leave duplicate launcher entries, but it cannot first remove the installation's last launcher; the UI reports the inconsistency and reset/retry normalizes the entries. The service never disables MainActivity, where existing deep-link filters, singleTop, configuration and picture-in-picture behavior remain. Its existing explicit component name remains launchable. Stable LauncherDefault/LauncherToriiLight/LauncherToriiDark names must not be removed or renamed in later upgrades.2526Moving the launcher filter from MainActivity to stable aliases introduces a launcher-caching/pinned-shortcut compatibility boundary on the first upgrade. Direct intents to MainActivity still work, but individual launchers may refresh/remove/recreate old pinned entries. Physical launcher/upgrade acceptance remains required; source checks cannot prove those OS behaviors. Future icons must add aliases and preserve old names until a tested migration exists.2728## Assets and verification2930Run `swift -module-cache-path /private/tmp/yokan-icon-cache scripts/generate-app-icons.swift` from the repository root to regenerate iOS and installer containers and the favicon on macOS. The script draws new artwork from paths in explicit sRGB and resizes the original asset for packaging. A cross-platform palette assertion checks native raster colors against the vector previews. Common Compose previews and Android foreground vectors use the same geometry, with extra Android foreground padding to keep the mark inside the adaptive safe area; colors and paths are committed alongside the raster outputs. Xcode includes Assets.xcassets in Resources and configures AppIcon plus all three alternate icon sets in both build configurations.3132Apple actool compiled the asset catalog for iOS deployment target 15, including all alternates, and emitted expected CFBundleIcons and CFBundleIcons~ipad metadata. plutil accepts the Xcode project and source plist. Native macOS image inspection accepts the generated ICNS container. Automated ViewModel tests cover cancel/apply/reset, restart reads, unsupported/system choices, failed/ignored/partial OS changes and completion after route closure. Source asset checks cover Android launch/deep-link invariants, opaque iOS artwork and matching raster/vector sRGB palettes. Their external asset files are registered as Gradle test inputs so asset-only changes rerun the checks. Rendered picker fixtures cover Android, iOS/system and static fallback in both app themes.3334Final verification passed the 924-test desktop suite (922 passed, 2 skipped), Android/browser/iOS simulator compilation, and Android release resource processing.3536Full app installation, physical launcher refresh, pinned-shortcut upgrade behavior, native iOS change confirmation, OS tint/dark transitions, installer execution and additional-profile acceptance remain device/release checks. Asset compilation or shared tests do not claim those checks passed.37