Skip to content

fix: MoverSettings move now button display#2300

Merged
limetech merged 2 commits into
masterfrom
fix/mover-settings-button-wrapper
Jul 22, 2025
Merged

fix: MoverSettings move now button display#2300
limetech merged 2 commits into
masterfrom
fix/mover-settings-button-wrapper

Conversation

@zackspear

@zackspear zackspear commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Improved the display logic for the "Move now" button and its status message, making them appear more consistently within the button group.
    • The "Move now" button is now only shown when applicable and is disabled when the mover is running, with a clear status message displayed.
    • Updated button container styling for better visual alignment.

@zackspear zackspear requested a review from ljm42 July 21, 2025 20:29
@coderabbitai

coderabbitai Bot commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

File(s) Change Summary
emhttp/plugins/dynamix/MoverSettings.page Refactored conditional logic for "Move now" button and status; moved rendering inline; updated CSS class.

Estimated code review effort

1 (~5 minutes)

Poem

A button now sits where it belongs,
With logic clear and tidy, not drawn out long.
"Mover is running," the status will show,
When files are in motion, you'll always know.
Hooray for neat code, says this rabbit with glee—
Simpler and cleaner, as code ought to be! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c8cd74 and 7507b53.

📒 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-block class simply set display: inline-block;, whereas .buttons-spaced (in emhttp/plugins/dynamix/styles/default-base.css) applies:
• display: flex;
• flex-wrap: wrap;
• gap: 1.2rem;
• resets margins on input[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-spaced CSS accordingly.

Comment thread emhttp/plugins/dynamix/MoverSettings.page
@ljm42 ljm42 added the 7.2 label Jul 21, 2025
@limetech limetech merged commit efe73b4 into master Jul 22, 2025
4 checks passed
@limetech limetech deleted the fix/mover-settings-button-wrapper branch July 22, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants