Skip to content

Initializr: fix white box behind generate-button icon; shift button clear of Crisp launcher#5302

Merged
shai-almog merged 1 commit into
masterfrom
fix-initializr-generate-button-icon-and-crisp
Jun 28, 2026
Merged

Initializr: fix white box behind generate-button icon; shift button clear of Crisp launcher#5302
shai-almog merged 1 commit into
masterfrom
fix-initializr-generate-button-icon-and-crisp

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Problem

Two issues on the start.codenameone.com Initializr "Generate Project" button:

  1. White box behind the download icon. The icon was set before the InitializrPrimaryButton UIID was applied. FontImage.create() bakes the component's current background into the glyph image (FontImage.java:7643-7644, painted at :7781), so it captured the default Button style's opaque white background and drew a white box behind the glyph.
  2. Button obscured by the Crisp chat launcher. The button sits at the bottom-right of the iframe; Crisp's bubble floats over the bottom-right of the host page, directly on top of it.

Fix

Icon — derive the icon after setUIID(...) so it captures the lime primary-button background. This matches the existing order used for the hero pill dot (Initializr.java:251-252); the generate button was the lone anomaly. The icon box now blends into the button instead of showing white.

Crisp shift — reuse the existing website↔iframe native bridge (which already polls dark-mode every 900ms):

  • WebsiteThemeNative.chatLauncherClearance() — new method returning the horizontal clearance (CSS px) the Crisp launcher needs, 0 when hidden. The JS impl reports 96 when a visible .crisp-client exists in the parent document (the launcher's standard footprint), 0 when it is hidden or consent was declined. The javase/android impls return 0.
  • Initializr.applyChatLauncherClearance() — applies that as a right margin on the button so it slides left, clear of the bubble. The JS port works in CSS pixels (overridePixelRatio = 1), so the reported value maps 1:1. It only relayouts on change, and applyDarkMode resets the cache so a theme refresh re-applies the margin.

Verification

  • Compiled the full common source tree + the javase impl (against the fresh interface) + the android impl with JDK 8 against the 8.0-SNAPSHOT core — no errors.
  • node --check passes on the JS native.
  • callback.complete(<number>) int-return convention confirmed against the existing StatusBarTapDiagnosticNative.js:10 precedent.

Note: I did not run the full ParparVM JS site build (heavy). The 96px clearance is a bounded constant sized to Crisp's default launcher; happy to tune it after an in-browser build if desired.

🤖 Generated with Claude Code

…lear of Crisp launcher

The "Generate Project" button set its download icon before applying the
InitializrPrimaryButton UIID. FontImage.create bakes the component's current
background into the glyph image, so the icon captured the default Button
style's opaque white background and painted a white box behind the glyph.
Derive the icon after setUIID so it captures the lime primary-button
background (matching the pill-dot order elsewhere in the file).

The button also sat under the host page's Crisp chat launcher (bottom-right).
Extend the existing website theme-sync native bridge with
chatLauncherClearance(): the JS impl reports the launcher footprint in CSS
pixels when a visible .crisp-client is present (0 when hidden/declined), and
the initializr poll adds that as a right margin so the button slides left,
clear of the bubble. The JS port works in CSS pixels, so the value maps 1:1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog shai-almog merged commit fc9f57d into master Jun 28, 2026
10 checks passed
@shai-almog shai-almog deleted the fix-initializr-generate-button-icon-and-crisp branch June 28, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant