Skip to content

refactor: log dynamic-theme initialization#144

Merged
paodb merged 1 commit intomasterfrom
log-dynamic-theme-initializer
Feb 10, 2026
Merged

refactor: log dynamic-theme initialization#144
paodb merged 1 commit intomasterfrom
log-dynamic-theme-initializer

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented Feb 7, 2026

Log the resolved path of dynamic-theme.properties to identify and troubleshoot classpath conflicts caused by downstream dependencies.

Summary by CodeRabbit

  • New Features
    • Dynamic theme loading now supports multiple theme sources simultaneously.
    • Enhanced diagnostic logging to track theme application and sources.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 7, 2026

Walkthrough

DynamicThemeInitializer is updated to discover and apply themes from multiple META-INF/dynamic-theme.properties resources via the class loader, replacing single-resource loading. Helper methods for URL parsing and theme reading are added alongside logging to track theme application sources.

Changes

Cohort / File(s) Summary
Dynamic Theme Initialization Enhancement
src/main/java/com/flowingcode/vaadin/addons/demo/DynamicThemeInitializer.java
Refactored to iterate over multiple META-INF/dynamic-theme.properties resources instead of loading a single resource. Added helper methods readTheme(URL) for loading/parsing themes and getSourceName(URL) for extracting readable source identifiers from JAR/file URLs. Introduced logging to record theme application and source details. Added PROPERTIES_PATH constant and Logger field.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • paodb
  • mlopezFC
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main objective: adding logging to the dynamic-theme initialization process to help troubleshoot classpath conflicts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch log-dynamic-theme-initializer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 7, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@src/main/java/com/flowingcode/vaadin/addons/demo/DynamicThemeInitializer.java`:
- Around line 50-57: The readTheme method currently returns empty silently when
the "theme" property is missing or invalid; update readTheme to (1) after
loading props check if props.getProperty("theme") is null or blank and log a
warning including the URL to indicate a misconfigured dynamic-theme.properties,
and (2) when mapping to DynamicTheme via DynamicTheme.valueOf, catch
IllegalArgumentException, log an error mentioning the invalid value and the URL,
and return Optional.empty; use the class logger (e.g., LOGGER or logger) for
these messages and keep the method signature and stream handling as-is.

@javier-godoy javier-godoy marked this pull request as ready for review February 10, 2026 17:20
@paodb paodb merged commit f9d1755 into master Feb 10, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Feb 10, 2026
@paodb paodb deleted the log-dynamic-theme-initializer branch February 10, 2026 18:14
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants