fix: MoverSettings move now button display#2300
Conversation
WalkthroughThe code refactors the logic for displaying the "Move now" button and its status message in the Mover Settings page. It introduces precomputed PHP variables to centralize conditional rendering, moves the button and status into the main button container, and updates the container's CSS class for layout consistency. Changes
Estimated code review effort1 (~5 minutes) Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
emhttp/plugins/dynamix/MoverSettings.page(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: zackspear
PR: unraid/webgui#2258
File: emhttp/plugins/dynamix/DashStats.page:0-0
Timestamp: 2025-06-21T00:10:40.789Z
Learning: In the Unraid webgui codebase (emhttp/plugins/dynamix), replacing `<i>` elements with `<button>` elements for accessibility would require extensive CSS refactoring due to legacy CSS having direct button styles that would conflict with icon-based toggles.
Learnt from: SimonFair
PR: unraid/webgui#1992
File: emhttp/plugins/dynamix/include/CPUset.php:0-0
Timestamp: 2025-02-01T15:12:16.914Z
Learning: In the unRAID WebGUI, button text should be wrapped in _() for translation support and htmlspecialchars() for security, with a preference for using ternary operators for simple conditional text assignments.
emhttp/plugins/dynamix/MoverSettings.page (3)
Learnt from: zackspear
PR: #2258
File: emhttp/plugins/dynamix/DashStats.page:0-0
Timestamp: 2025-06-21T00:10:40.789Z
Learning: In the Unraid webgui codebase (emhttp/plugins/dynamix), replacing <i> elements with <button> elements for accessibility would require extensive CSS refactoring due to legacy CSS having direct button styles that would conflict with icon-based toggles.
Learnt from: SimonFair
PR: #1992
File: emhttp/plugins/dynamix/include/CPUset.php:0-0
Timestamp: 2025-02-01T15:12:16.914Z
Learning: In the unRAID WebGUI, button text should be wrapped in _() for translation support and htmlspecialchars() for security, with a preference for using ternary operators for simple conditional text assignments.
Learnt from: zackspear
PR: #2230
File: emhttp/plugins/dynamix/include/Templates.php:63-74
Timestamp: 2025-06-03T21:27:15.912Z
Learning: In the Unraid WebGUI codebase (emhttp/plugins/dynamix/include/Templates.php), there are known duplicate ID issues in checkbox templates across multiple template instances that the maintainers are aware of but have chosen not to address due to the effort required for legacy code improvements.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
emhttp/plugins/dynamix/MoverSettings.page (2)
30-32: LGTM! Good refactoring for improved readability.The precomputed boolean variables centralize the conditional logic and make the template more maintainable. The variable names are descriptive and the logic correctly combines the existing conditions.
125-125: Confirm flex-based spacing meets design expectations.The
.inline-blockclass simply setdisplay: inline-block;, whereas.buttons-spaced(inemhttp/plugins/dynamix/styles/default-base.css) applies:
• display: flex;
• flex-wrap: wrap;
• gap: 1.2rem;
• resets margins oninput[type="button"], etc.Please verify that the new flex layout, wrapping behavior, and 1.2 rem gap produce the intended button spacing across all breakpoints. If this introduces excessive space or unwanted wrapping, adjust the
.buttons-spacedCSS accordingly.
Summary by CodeRabbit