Skip to content

Make the engine platform-agnostic (after the CLI full-agnostic phase, cli#471) #902

Closed

Description

@apotema

Sequencing: do this after the CLI full-agnostic phase (labelle-cli#471) is done.

Goal: labelle-engine carries no platform-specific code; platform behaviour lives in the platform packages (labelle-android, labelle-ios, labelle-web) and the backends. Same principle as the CLI core, and as the iOS scaffolding removal already in progress.

Known Android code (engine main, 2026-09-28):

  1. src/android.zig (~800 lines): Android immersive mode. JNI calls through the ANativeActivity (reached via labelle-core's backend-agnostic seam) hide the system bars, hook onWindowFocusChanged/onContentRectChanged, and fall back to the legacy decor-view API below API 30. It's wired from src/root.zig:41 and driven by the assembler's .android.immersive_mode key. → Move to labelle-android next to its runtime services (intent env, debuggable, relayout, AAudio, video), and have the engine or assembler call it through the plugin, not engine code.
  2. src/preview_shm.zig:58: an is_android_abi branch in the editor-preview shared-memory code. → Make it target-generic, or move it behind the same seam.
  3. src/storage/default.zig:54: an Android check for the default save-storage location. → Make it target-generic, or let the platform package supply the data directory.

To do when this starts:

  • Run a full sweep for other platform-, backend- or store-specific code in the engine (src, build.zig, tests, CI) and list it.
  • Consider an agnostic guard for the engine like the CLI's agnostic_guard_test.zig, with a shrink-only allowlist.
  • Keep behaviour identical on Android. Flying Platform uses immersive mode, so the change needs on-device acceptance on the SM-T505.

https://claude.ai/code/session_01R2K5sJDL5Msn1uRTkybiDP

Activity

  1. apotema commented on Oct 1, 2026

    @apotema
    ContributorAuthor

    Released as labelle-engine v4.0.0, which carries no platform code.

    Left on the allowlist (40 files): web/emscripten and editor-preview OS code, plus comment-only backend mentions. They can shrink in later tickets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions