Skip to content

Conversation

@javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented Jan 27, 2026

See https://github.com/vaadin/flow/blob/eb7860193f87a55328c08110d5ff0f453c6158a1/flow-server/src/main/java/com/vaadin/flow/component/page/Page.java#L88-L94

Summary by CodeRabbit

  • Refactor
    • Streamlined theme management by consolidating attribute initialization logic into a unified processing block. Previously duplicate code branches for different rendering contexts are now consolidated into a single mechanism. Theme and color scheme settings are applied consistently across all contexts, improving code quality, maintainability, and consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Walkthrough

The applyThemeAttribute method in TabbedDemo is refactored to consolidate iframe and non-iframe branches. Instead of setting theme attributes inline in each branch, both now initialize a documentElement variable and execute a unified script block to apply theme and colorScheme attributes, reducing code duplication.

Changes

Cohort / File(s) Summary
TabbedDemo theme attribute refactoring
src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java
Refactored applyThemeAttribute method to consolidate iframe and non-iframe logic paths. Both branches now initialize a local documentElement variable and append a common script block for setting theme and colorScheme attributes, replacing previous inline attribute setting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • mlopezFC
  • paodb
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 pull request title 'fix: update color-scheme when switching themes' directly matches the main objective and primary change in the changeset, which consolidates theme-setting logic and ensures color-scheme is updated when themes are switched.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@javier-godoy javier-godoy marked this pull request as ready for review January 27, 2026 15:17
@paodb paodb merged commit e8a6618 into master Jan 27, 2026
3 checks passed
@paodb paodb deleted the color-scheme branch January 27, 2026 16:58
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.

3 participants