Build System#
Conditional compilation via BUILD_MODE env var and runtime AppFunc feature flags.
Modes#
| Mode | Target | Default provider | Network probe on startup |
|---|---|---|---|
web-remote |
Static host (GitHub Pages) | localStorage |
Blocked |
web-local |
Dev / self-hosted (localhost) | remote |
Allowed |
gui-desktop |
Linux/macOS/Windows desktop | remote (app:// fallback) |
Allowed |
gui-mobile |
Android / tablet WebView | remote (app:// fallback) |
Allowed |
Feature flags (AppFunc bitmask)#
Each mode enables a different set of features:
AllowProbe— permits outgoinglocalhostprobe on startupDefaultToRemote— provider init triesremotebeforelocalStorageMobileCss— bundlesmobile.cssToolbarMobile— renders sidebar/meta toggle buttonsSidebarGestures— lazy-loads swipe/drag handlersMetaPanelCompact— compact meta panel layoutDevOverlay— dev-only diagnosticsLivePreview— shows live preview link in sidebar
Files#
editor/lib/interpolate.ts— injects__BUILD_MODE__into<html data-build-mode="...">editor/build.ts— setsBUILD_MODEenv (defaultweb-local)editor/src/lib/build-mode.ts— runtimeBuildModeenum +hasFunc(AppFunc)lookupeditor/src/styles/mobile.css— mobile-only overrides (conditionally imported)
Rollout#
- Build mode flag + interpolation (done)
- Gate provider init / probe / toolbar / CSS (done)
- Add GitHub Actions matrix for
build-mode - Wire APK build step to use
BUILD_MODE=gui-mobile