Conversation
WalkthroughA single file modification that imports Vaadin's Version class and augments the demo component with a runtime CSS class name containing the major Vaadin version during router layout content display. No public API changes or control flow alterations beyond the new class name injection. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java (1)
215-215: Prefer setting the version class on the layout root once.At Line 215 the class is added to each routed
demo, which limits selectors to demo content and skips shared shell elements (tabs/footer). Consider adding it once toTabbedDemoinstead.♻️ Proposed refactor
@@ public TabbedDemo() { - setSizeFull(); + addClassName("demos-v" + Version.getMajorVersion()); + setSizeFull(); @@ public void showRouterLayoutContent(HasElement content) { - demo.addClassName("demos-v" + Version.getMajorVersion());🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java` at line 215, Currently each routed demo calls demo.addClassName("demos-v" + Version.getMajorVersion()) which applies the version CSS class only to demo content; move the responsibility to the layout root by adding this class once in the TabbedDemo constructor (or initialization path) instead of per-demo, and remove the demo.addClassName call from wherever demos are created; update code that references demo.addClassName to use TabbedDemo (the root component) so shared shell elements (tabs/footer) receive the version class.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java`:
- Line 215: Currently each routed demo calls demo.addClassName("demos-v" +
Version.getMajorVersion()) which applies the version CSS class only to demo
content; move the responsibility to the layout root by adding this class once in
the TabbedDemo constructor (or initialization path) instead of per-demo, and
remove the demo.addClassName call from wherever demos are created; update code
that references demo.addClassName to use TabbedDemo (the root component) so
shared shell elements (tabs/footer) receive the version class.



Add a CSS classname derived from Vaadin version (
demos-v24,demos-v25) for version-specific adjustments in add-ons demos.Summary by CodeRabbit