Conversation
Signed-off-by: Mario Serrano <mario@dynamiasoluciones.com>
…r tools and entityfiles versions; enhance PushTestViewModel and LongOperation for better progress handling
…ringboot and dynamiatools versions
…ility in user menu
There was a problem hiding this comment.
Pull request overview
This PR upgrades the DynamiaTools framework from version 5.4.1 to 5.4.12, introducing dark mode functionality and updating dependencies.
- Updates DynamiaTools dependency and artifact version from 5.4.1 to 5.4.12
- Adds dark mode toggle feature with new JavaScript implementation and CSS styling
- Updates Bootstrap framework and adds required JavaScript dependencies (popper.min.js, bootstrap.min.js)
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/pom.xml | Updates project version and DynamiaTools dependency to 5.4.12 |
| sources/src/main/resources/web/templates/dynamical/views/index.zul | Updates CSS/JS resource version tags and adds new JavaScript dependencies for dark mode |
| sources/src/main/resources/zk/dynamical/index-main.zul | Adds dark mode toggle UI component and aria-expanded attribute for accessibility |
| sources/src/main/resources/web/templates/dynamical/static/js/dark-mode.js | Implements dark mode toggle functionality and device detection |
| sources/src/main/resources/web/templates/dynamical/static/js/bootstrap.min.js | Adds Bootstrap v5.3.7 minified library |
| sources/src/main/resources/web/templates/dynamical/static/css/dynamical.css | Adds dark mode CSS rules, fixes modal border radius calculation, and styles dark mode toggle |
| sources/src/main/java/tools/dynamia/themes/dynamical/viewers/DynamicalCrudView.java | Removes unused imports (IconSize and ZKUtil) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| localStorage.setItem("theme", theme); | ||
| } | ||
|
|
||
| // Inicializar: leer localStorage o usar default "light" |
There was a problem hiding this comment.
Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.
| const savedTheme = localStorage.getItem("theme") || "light"; | ||
| applyTheme(savedTheme); | ||
|
|
||
| // Toggle al dar clic |
There was a problem hiding this comment.
Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.
| // Toggle al dar clic | ||
| toggleBtn.addEventListener("click", () => { | ||
| const newTheme = body.classList.contains("dark-mode") ? "light" : "dark"; | ||
| applyTheme(newTheme); | ||
| }); |
There was a problem hiding this comment.
The toggleBtn element existence should be validated before adding an event listener. If the selector doesn't match any element, this will throw an error when trying to call addEventListener on null.
| // Toggle al dar clic | |
| toggleBtn.addEventListener("click", () => { | |
| const newTheme = body.classList.contains("dark-mode") ? "light" : "dark"; | |
| applyTheme(newTheme); | |
| }); | |
| // Toggle al dar clic (solo si el elemento existe) | |
| if (toggleBtn) { | |
| toggleBtn.addEventListener("click", () => { | |
| const newTheme = body.classList.contains("dark-mode") ? "light" : "dark"; | |
| applyTheme(newTheme); | |
| }); | |
| } |
| .dark-mode-switch .light-icon{ | ||
| display: none; | ||
| } | ||
|
|
||
| .dark-mode .dark-mode-switch .light-icon{ |
There was a problem hiding this comment.
There's a missing space after the colon in the CSS selector. This should be .dark-mode-switch .light-icon { (with a space before the opening brace).
| .dark-mode-switch .light-icon{ | |
| display: none; | |
| } | |
| .dark-mode .dark-mode-switch .light-icon{ | |
| .dark-mode-switch .light-icon { | |
| display: none; | |
| } | |
| .dark-mode .dark-mode-switch .light-icon { |
| const body = document.body; | ||
| const toggleBtn = document.querySelector(toggleSelector); | ||
|
|
||
| // Función para aplicar modo según preferencia |
There was a problem hiding this comment.
Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.
No description provided.