Skip to content

Keep Initializr loader visible until CN1 UI ready#4576

Merged
shai-almog merged 2 commits intomasterfrom
codex/fix-splash-screen-loading-behavior
Feb 26, 2026
Merged

Keep Initializr loader visible until CN1 UI ready#4576
shai-almog merged 2 commits intomasterfrom
codex/fix-splash-screen-loading-behavior

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Prevent the visual switch from the modern website loader to the older app icon/progress UI by keeping the single loader style active until the embedded CN1 Initializr app actually displays its first form.
  • Provide a reliable handshake so web wrapper pages know when the CN1 UI is ready and avoid premature dismissal of the overlay.

Description

  • The website loader logic in docs/website/layouts/_default/initializr.html now waits for a postMessage with type cn1-initializr-ui-ready or an 8s iframe-load fallback before hiding the overlay instead of hiding immediately on iframe.load.
  • Added a new notifyUiReady() method to the WebsiteThemeNative interface in scripts/initializr/common/src/main/java/com/codename1/initializr/WebsiteThemeNative.java.
  • Call notifyWebsiteUiReady() (which invokes the native bridge) immediately after form.show() in scripts/initializr/common/src/main/java/com/codename1/initializr/Initializr.java so the parent page receives the ready signal as soon as the CN1 form is visible.
  • Implemented the JS native bridge notifyUiReady_ in scripts/initializr/javascript/src/main/javascript/com_codename1_initializr_WebsiteThemeNative.js to postMessage() the readiness event to the parent page.

Testing

  • Attempted to compile/run the Initializr common module with Maven using mvn -f scripts/initializr/pom.xml -pl common -am -DskipTests compile, which progressed but failed during an Ant task that downloads UpdateCodenameOne.jar due to network unreachability in this environment (build failed with java.net.SocketException: Network is unreachable).
  • Also tried ./mvnw -pl common test -DskipITs and mvn -f scripts/initializr/pom.xml -pl common -DskipTests compile -o; these failed due to wrapper/network/offline plugin resolution issues in this environment, so runtime validation on a live page was not possible here.
  • Git changes were staged and committed locally (Keep Initializr loader style consistent until UI is ready).

Codex Task

@github-actions
Copy link

Cloudflare Preview

@shai-almog shai-almog merged commit 810b368 into master Feb 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant