Add advanced theme CSS editing with live preview in Initializr#4601
Open
shai-almog wants to merge 1 commit intomasterfrom
Open
Add advanced theme CSS editing with live preview in Initializr#4601shai-almog wants to merge 1 commit intomasterfrom
shai-almog wants to merge 1 commit intomasterfrom
Conversation
Cloudflare Preview
|
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.
Motivation
MutableResource+CSSThemeCompiler) to apply edits into the running preview without requiring a full regenerate.Description
customThemeCssfield and an overloaded constructor toProjectOptionsso custom CSS is carried through generation and preview viaProjectOptions.createThemeOptionsPanel) with anAdvanced Theme Modecheckbox and aTextAreaeditor for custom CSS, and threaded the advanced CSS intoProjectOptionsused for generation/preview.GeneratorModelinto a reusable entry pointbuildThemeOverrides(ProjectOptions)(and a smallbuildThemeCss()adapter) so generated zip output and live preview share the same logic and advanced CSS is appended tocommon/src/main/css/theme.csswhen present.TemplatePreviewPanelviaMutableResource+CSSThemeCompilerby compiling generated CSS into a themeHashtableand applying it to the preview form withUIManager.addThemeProps, plus restoring defaults before applying changes.validateAdvancedThemeCssGenerationtoGeneratorModelMatrixTestthat verifies advanced CSS is emitted intocommon/src/main/css/theme.cssin generated zips.Testing
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 && export PATH="$JAVA_HOME/bin:$PATH" && cd scripts/initializr && mvn -pl common -am test -DskipTests=false, but the build is blocked by environment/bootstrap steps (the CN1 bootstrap expected/root/.codenameone/CodeNameOneBuildClient.jar).-aminvocation (mvn -pl common test) failed due to missing reactor dependency when not building the dependent modules first, so a full reactor build is required to validate end-to-end.maven/UpdateCodenameOne.jarinto/root/UpdateCodenameOne.jarto bypass the downloader in this environment, which allowed Maven to progress further, but the CN1 plugin still requires/root/.codenameone/CodeNameOneBuildClient.jarand/or network access for full plugin bootstrap; as a result automated tests could not complete successfully here.Codex Task