Fix initializr projects: keep win32 module, dual-mode default theme, Linux/win32 IDE targets#5299
Open
shai-almog wants to merge 2 commits into
Open
Fix initializr projects: keep win32 module, dual-mode default theme, Linux/win32 IDE targets#5299shai-almog wants to merge 2 commits into
shai-almog wants to merge 2 commits into
Conversation
…, Linux/win32 IDE targets Three fixes for projects downloaded from initializr / generated via the cn1app-archetype: - Keep the win/ module (now the native win32 target, not the retired UWP module) for every Java version. The generator was still stripping win/ and its root-pom <profile id="win"> for Java 17 with stale "retired UWP" comments. Removed that strip from GeneratorModel (initializr server) and archetype-post-generate.groovy (local archetype:generate), and updated the matrix test to assert win/ ships for Java 17. Also fixed a copy-paste build execution id in win/pom.xml (build-android -> build-windows). - Stop baking the website's dark/light state into downloads. The UI no longer exposes a theme picker, but currentOptions() still derived the theme from the host dark-mode flag, emitting hard-coded dark colors at top-level CSS scope that broke light mode. Generation now always ships the barebones default, and theme.css carries an active @media (prefers-color-scheme: dark) block so the default theme adapts to both modes out of the box. - Add missing desktop/native build run configs. IntelliJ workspace.xml gains Linux Desktop Build, Linux Device Build, and Windows Device Build (win32), each registered in the RunManager <list> so they actually appear; NetBeans nb-configuration.xml gains Linux Desktop App (it already had the win32 Windows Device App). Verified: initializr CN1 test suite passes 6/6 (GeneratorModelMatrixTest now asserts win/ for Java 17 and the dual-mode default theme); workspace.xml and nb-configuration.xml pass xmllint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 139 screenshots: 139 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 131 screenshots: 131 matched. |
Collaborator
Author
|
Compared 137 screenshots: 137 matched. Benchmark Results
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 134 screenshots: 134 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 138 screenshots: 138 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
Apple TV (tvOS / Metal)Compared 136 screenshots: 135 matched, 1 missing actual.
|
Collaborator
Author
|
Compared 214 screenshots: 214 matched. |
…e dark theme The previous commit forced currentOptions() to always LIGHT to stop baking dark overrides into downloads. But that method also feeds the live preview, so on a dark host the "Hello World" preview lost its dark styling and looked un-themed. - Decouple the two consumers: currentOptions() is restored to host-aware (darkMode ? DARK : LIGHT) and drives only the preview; a new downloadOptions() always returns the barebones default theme and drives the generated download. The preview behaves exactly as before the PR; downloads still ship a clean theme.css with no injected "Initializr Theme Overrides". - Make theme.css's dark block conservative. The aggressive version overrode Form/Toolbar/Button/Title/Dialog with flat colors, which clobbered the native theme in dark mode (the same "no native theme" symptom, in the built app). The native theme already handles dark mode for standard components, so the dark block now only flips the side menu -- the one thing this template hard-codes to light colors -- matching the team's original commented example. Verified: initializr CN1 test suite passes 6/6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three problems reported for projects downloaded from initializr / generated via the
cn1app-archetype.1. Missing
win/folder — keep the win32 native modulewin/is now the native win32 target (platform=win,buildTarget=windows-device, built byWindowsNativeBuilder), not the retired UWP module. The generator was still strippingwin/and its root-pom<profile id="win">for Java 17, with stale "retired UWP" comments.GeneratorModel.java(initializr server): dropped thedropWindowsModulezip filter and the pom<profile id="win">strip; removed the now-deadstripWindowsModuleProfilemethod.archetype-post-generate.groovy(localmvn archetype:generate): removed thewin/deletion + profile strip and its mirror method. Java-8.claude/stripping preserved.GeneratorModelMatrixTest: Java 17 now assertswin/ships (was asserting it must be absent); Java 8 comment updated.win/pom.xml: fixed copy-paste build execution idbuild-android->build-windows.The win module ships for every Java version now and is activated via the
winprofile (-Dcodename1.platform=win).2. "Initializr Theme Overrides" broke light mode — ship a dual-mode default
The UI no longer exposes a theme picker, but
currentOptions()still derived the generated theme from the website's host dark-mode flag, emitting hard-coded dark colors at top-level CSS scope that broke light mode for anyone who opened the project.Initializr.java: generation always ships the barebones default (no host dark/light state baked in).theme.css: replaced the commented-out example with an active@media (prefers-color-scheme: dark)block, so the default theme adapts to both light and dark out of the box.3. Missing desktop/native build targets in the IDE
workspace.xml: added Linux Desktop Build, Linux Device Build, and Windows Device Build (win32), each registered in the RunManager<list>(the list entry is what makes a config appear).nb-configuration.xml: added Linux Desktop App (it already had the win32 Windows Device App).Verification
./mvnw -pl javase -am test -Ptest -Dcodename1.platform=javase -DfailIfNoTests=false), includingGeneratorModelMatrixTestassertingwin/ships for Java 17 and the dual-mode default theme.workspace.xmlandnb-configuration.xmlpassxmllint; groovy is brace-balanced with no danglingwin/strip references.Rollout
These live in the initializr server, the
cn1app-archetypeartifact, and thecodenameone-maven-pluginartifact — they take effect for new downloads once those are republished/redeployed.🤖 Generated with Claude Code