Skip to content

feat: responsive improvements rd. 3#2212

Merged
limetech merged 17 commits into
masterfrom
feat/responsive-improvements
May 30, 2025
Merged

feat: responsive improvements rd. 3#2212
limetech merged 17 commits into
masterfrom
feat/responsive-improvements

Conversation

@zackspear

@zackspear zackspear commented May 28, 2025

Copy link
Copy Markdown
Contributor
  • Removed unnecessary margin adjustments for .vshift and .hshift classes in Eth0.css and default-base.css.
  • Added a new rule to fix the margin-top for UD titles to prevent overlapping with tabs.

Summary by CodeRabbit

  • Style

    • Improved and standardized vertical spacing for title elements and status spans.
    • Removed several margin adjustments for cleaner layout.
    • Added a targeted fix to prevent title overlap with tabs in specific plugin views.
    • Updated search box spacing and sizing for better responsiveness and layout consistency.
    • Refined HTML/PHP templates for better readability, consistent button grouping, and cleaner markup structure.
    • Removed unnecessary line breaks in share edit and other pages for cleaner layout.
    • Enhanced SMB, NFS, and share settings pages with improved flexbox layouts and consistent styling.
    • Streamlined navigation button markup for user shares with modernized JavaScript.
    • Adjusted dropdown checklist components to span full container width with improved padding.
    • Removed obsolete CSS file related to share cloning layout.
  • Bug Fixes

    • Fixed title margin issues to prevent overlap with tabs in plugin interfaces.
    • Simplified Active Directory join form with improved button enable/disable logic.
  • Chores

    • Removed browser-specific detection in search functionality, replacing it with feature detection for improved compatibility.
    • Eliminated legacy text highlighting library and related browser-dependent code for streamlined search experience.
    • Added user feedback for missing plugin file selection and introduced file tree browser for plugin installation.
    • Removed deprecated file tree initialization from plugin manager page to prevent redundant UI components.

- Removed unnecessary margin adjustments for .vshift and .hshift classes in Eth0.css and default-base.css.
- Added a new rule to fix the margin-top for UD titles to prevent overlapping with tabs.
@coderabbitai

coderabbitai Bot commented May 28, 2025

Copy link
Copy Markdown
Contributor

"""

Walkthrough

The updates remove several CSS classes and rules related to vertical and horizontal spacing adjustments, particularly those affecting .vshift, .vhshift, .hshift, and .title.shift. A new override is introduced to set margin-top: 0 !important; for specific plugin title elements to address overlap issues. Browser detection logic in the GUI search page is removed and replaced with feature detection. The jQuery mark.js text highlighting library is deleted. The search box CSS is adjusted for spacing and responsiveness. The Active Directory join form PHP code is refactored to use a boolean variable for join status and a wrapper function for input values, simplifying button state logic and input handling. Minor HTML/PHP markup formatting improvements are made in DeviceInfo, ShareEdit, Share, DiskSettings, SecuritySMB, and PluginManager pages, and a whitespace adjustment is applied in a PHP layout file. The initialization of a plugin file tree UI component is moved from one page to another. The entire Share.css file is deleted. Several UI sections are restyled with flexbox and utility classes for better layout and consistency.

Changes

File(s) Change Summary
.../dynamix/sheets/Eth0.css Removed the .vshift class rule that set margin-top: 0 !important;.
.../dynamix/styles/default-base.css Removed margin adjustments for .title.shift, .status span.vhshift, .status span.vshift, and .status span.hshift. Added override for div.title.ud and div#title.ud with margin-top: 0 !important;. Removed .nav-tile.right text-align inside media query. Removed padding-top from first form inside .TableContainer variants. Added .relative class and media query styles for .clone-settings. Adjusted .shade padding and border-radius.
.../dynamix.gui.search/gui_search.page Removed all browser detection logic and related conditionals. Replaced browser-based fragment handling with feature detection. Changed navigation from location.replace() to location.assign().
.../dynamix.gui.search/javascript/jquery.mark.js Deleted entire jQuery mark.js text highlighting library, removing all related classes and plugin methods.
.../dynamix.gui.search/sheets/gui_search.css Adjusted horizontal padding and width for #guiSearchBoxSpan and #guiSearchBox. Added media query for minimum width. Modified .Theme--sidebar margins and padding for search box container.
.../dynamix/SMBActiveDirectory.page Introduced $adJoined boolean for AD join status to control "Join" and "Leave" button states. Wrapped input values with _var() function before htmlspecialchars(). Removed redundant <br> tag after first form.
.../dynamix/DeviceInfo.page Improved HTML/PHP markup formatting: converted inline spans to multi-line div/span blocks, replaced echo with short tags and null coalescing operators, wrapped buttons in spacing containers, simplified nested spans, moved warning span outside select, adjusted whitespace. No logic changes.
.../dynamix/ShareEdit.page Consolidated PHP tags at start. Replaced cloning controls markup with flexbox-based structure using filtered shares variable. Wrapped buttons in spacing spans. Added .shade containers for consistent styling. No logic changes.
.../dynamix/include/DefaultPageLayout/MainContent.php Whitespace adjustment in anonymous function inside processTitle(). No logic or behavior changes.
.../dynamix/DiskSettings.page Reformatted HTML/PHP markup for encryption key and SMART settings sections, removed trailing <br> tags, added missing closing </div>, improved checkbox input formatting. No logic changes.
.../dynamix.plugin.manager/PluginInstall.page Added console warning if no plugin file selected. Initialized file tree UI component for plugin selection with .plg filter and /boot/ root. Added CSS classes to form for styling.
.../dynamix.plugin.manager/Plugins.page Removed initialization of file tree UI component from document-ready function.
.../dynamix/SecuritySMB.page Restructured SMB security settings markup to use flexbox and utility classes (shade, buttons-spaced, relative). Simplified multiple attribute syntax. Wrapped user access sections with consistent styling and layout. No logic changes.
.../dynamix/Share.page Consolidated PHP tags. Refactored JavaScript for navigation buttons using template literals and simplified conditional DOM appending. No logic changes.
.../dynamix/include/DefaultPageLayout/MainContentTabbed.php Modified tabbed content rendering to process pages without titles but with text content, preventing tab index misalignment by conditionally incrementing index.
.../dynamix/sheets/Share.css Deleted entire CSS file containing styles for cloning and input elements layout and spacing.
.../dynamix/styles/default-dynamix.css Added width: 100% to .ui-dropdownchecklist-selector and .ui-dropdownchecklist-selector-wrapper. Added left padding to nested .ui-dropdownchecklist-text. Commented out forced width with !important due to overflow issues.

Possibly related PRs

Suggested reviewers

  • ljm42
  • elibosley

Poem

A hop and a skip, some margins erased,
Old shifts and tweaks have all been replaced.
With titles aligned and overlap gone,
The CSS garden grows tidy at dawn.
🐇✨

No more vshifts to clutter the view—
Just clean, crisp styles, and a layout anew!
"""


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 60ce3aa and 0c13055.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/SecuritySMB.page (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • emhttp/plugins/dynamix/SecuritySMB.page
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)

🪧 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: 0

🧹 Nitpick comments (1)
emhttp/plugins/dynamix/styles/default-base.css (1)

1956-1961: Approve targeted UD title override
This new rule effectively prevents the UD plugin’s titles from overlapping with the tabs, addressing the layout issue described in the PR. It aligns well with the PR objective to improve responsiveness and layout consistency.

Nit: simplify and avoid !important

  • You can drop the div type qualifier and use .title.ud / #title.ud—class and ID selectors alone are sufficiently specific.
  • If possible, boost specificity (e.g., prefix with a parent selector) instead of resorting to !important, which will make future overrides more predictable.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d59f43 and ce8dd03.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/sheets/Eth0.css (0 hunks)
  • emhttp/plugins/dynamix/styles/default-base.css (1 hunks)
💤 Files with no reviewable changes (1)
  • emhttp/plugins/dynamix/sheets/Eth0.css
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)

@zackspear

Copy link
Copy Markdown
Contributor Author

@coderabbitai the !important that was added for the UD title override is necessary because it's overriding CSS that's added by a plugin.

@coderabbitai

coderabbitai Bot commented May 28, 2025

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@zackspear Thank you for that clarification! That makes perfect sense - using !important to override plugin-added CSS is a legitimate use case. Plugin styles often have high specificity or their own !important declarations, so this override approach is necessary to ensure the UD title styling takes precedence and prevents the overlap issue you mentioned.

🐰💡
Understanding the plugin override context!


✏️ Learnings added
Learnt from: zackspear
URL: https://github.com/unraid/webgui/pull/2212

Timestamp: 2025-05-28T20:54:31.350Z
Learning: In the unraid/webgui repository, the CSS rule `div.title.ud, div#title.ud { margin-top: 0 !important; }` uses `!important` specifically to override CSS that's added by a plugin, which is a necessary approach for ensuring proper title positioning and preventing overlap with tabs.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

zackspear added 3 commits May 28, 2025 14:57
- Removed text alignment from .nav-tile.right in default-base.css for better flex alignment.
- Updated padding and width for #guiSearchBox in gui_search.css to enhance the search box layout.
- Added a media query for #guiSearchBoxSpan to ensure consistent width on larger screens.
- Updated input value handling to use _var() for better security and consistency.
- Refactored submit button logic to improve user experience by enabling/disabling based on AD join status.
- Cleaned up form layout for better readability and maintainability.
…search.page

- Removed the browser detection logic for improved code clarity and maintainability.
- Updated the search functionality to use 'fragmentDirective' for better compatibility.
- Eliminated the jQuery.mark.js file as it is no longer needed, streamlining the search implementation.
@zackspear zackspear marked this pull request as ready for review May 28, 2025 23:22

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the browser detection as it's not needed any longer.

fragementDirective has been very well supported for a few years now, but we'll still check for it but even that is likely unnecessary these days.

https://caniuse.com/mdn-api_fragmentdirective

This allowed for the removal of the jquery.mark.js library and its usage.

zackspear added 6 commits May 29, 2025 09:46
- Eliminated an extra line break before the clone1 div to improve layout consistency and maintainability.
- Added CSS rules to remove top padding for the first form inside TableContainer elements, improving layout consistency.
- Adjusted HTML structure for better alignment and spacing of elements, enhancing overall readability.
- Updated form input handling to ensure consistent presentation and user experience.
- Cleaned up deprecated file system warnings and improved layout for various sections.
- Corrected inconsistent indentation in the processTitle function for improved code readability and maintainability.
- Adjusted indentation for the HTML structure of time selection elements, enhancing overall readability and consistency.
- Ensured proper alignment of select elements for better user experience.
- Adjusted indentation and layout for various elements to enhance readability and maintain consistency.
- Ensured proper alignment of titles and form elements for better user experience.
@ljm42 ljm42 added the 7.2 label May 29, 2025
zackspear added 4 commits May 29, 2025 14:13
…ndling

- Updated the plugin installation page to provide a console warning when no plugin file is selected, improving user feedback.
- Added a file tree for easier selection of plugin files, enhancing user experience during plugin installation.
- Adjusted the form layout for better alignment and consistency.
- Added logic to handle pages without titles but containing text, ensuring proper rendering of content.
- Introduced a mechanism to skip index increment for such pages, maintaining correct tab functionality.
- Improved code readability with better indentation and comments for clarity.
- Refactored navigation buttons in Share.page to use a more structured HTML layout, enhancing readability and user experience.
- Updated ShareEdit.page to manage share setting clone responsively.
- Deleted obsolete Share.css file to streamline styles and reduce clutter.
- Refactored HTML structure for read/write settings sections to improve layout and user experience.
- Updated template for better clone settings
- Adjusted form elements for improved alignment and spacing, enhancing overall readability.

@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

🧹 Nitpick comments (2)
emhttp/plugins/dynamix.plugin.manager/PluginInstall.page (1)

27-27: Good improvement, but consider adding user-visible feedback as well.

The console warning provides developer feedback when no plugin file is selected, which is better than silently returning. However, consider also displaying a user-visible message since end users may not check the browser console.

Consider enhancing the user feedback:

-if (!file) return console.warn('No plugin file selected');
+if (!file) {
+  console.warn('No plugin file selected');
+  // Add user-visible feedback here, e.g., show an alert or highlight the input field
+  return;
+}
emhttp/plugins/dynamix/include/DefaultPageLayout/MainContentTabbed.php (1)

30-33: Good initialization with clear documentation.

The variable initialization is well-documented and the purpose of $skipIndexIncrement is clearly explained in the comment.

Consider initializing the flag as part of the variable declaration for better locality:

 <?
     $i = 0;
-    $skipIndexIncrement = false; // used if the page has no title but has text
+    $skipIndexIncrement = false; // Flag to skip index increment for pages with no title but with text
 ?>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 75d9fe5 and 736baeb.

📒 Files selected for processing (9)
  • emhttp/plugins/dynamix.plugin.manager/PluginInstall.page (2 hunks)
  • emhttp/plugins/dynamix.plugin.manager/Plugins.page (0 hunks)
  • emhttp/plugins/dynamix/SecuritySMB.page (4 hunks)
  • emhttp/plugins/dynamix/Share.page (1 hunks)
  • emhttp/plugins/dynamix/ShareEdit.page (4 hunks)
  • emhttp/plugins/dynamix/include/DefaultPageLayout/MainContentTabbed.php (3 hunks)
  • emhttp/plugins/dynamix/sheets/Share.css (0 hunks)
  • emhttp/plugins/dynamix/styles/default-base.css (4 hunks)
  • emhttp/plugins/dynamix/styles/default-dynamix.css (1 hunks)
💤 Files with no reviewable changes (2)
  • emhttp/plugins/dynamix/sheets/Share.css
  • emhttp/plugins/dynamix.plugin.manager/Plugins.page
✅ Files skipped from review due to trivial changes (2)
  • emhttp/plugins/dynamix/styles/default-dynamix.css
  • emhttp/plugins/dynamix/SecuritySMB.page
🚧 Files skipped from review as they are similar to previous changes (2)
  • emhttp/plugins/dynamix/ShareEdit.page
  • emhttp/plugins/dynamix/styles/default-base.css
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
emhttp/plugins/dynamix/Share.page (2)

50-59: LGTM! Good modernization with template literals.

The refactoring to use ES6 template literals significantly improves code readability and maintainability. The HTML structure is clean and the CSS classes (buttons-spaced, flex-shrink-0) align well with modern utility-based styling approaches.

Security note: The interpolated PHP variables <?=$prev?> and <?=$next?> are safely URL-encoded on lines 26-27, preventing XSS vulnerabilities.


62-63: Clean simplification of DOM manipulation.

The simplified approach using template literals and direct append operation is much cleaner than the previous implementation. The conditional target selection logic correctly handles both tabbed and non-tabbed layouts.

emhttp/plugins/dynamix.plugin.manager/PluginInstall.page (2)

51-57: Excellent file browsing functionality implementation.

The fileTree component is well-configured for plugin installation:

  • Properly scoped to /boot/ directory (appropriate for Unraid plugin storage)
  • Correctly filtered to only show .plg files for security
  • Clean callback that populates the input field automatically

This enhances user experience by allowing visual file selection instead of manual path entry.


62-62: Good styling improvement for better layout.

The addition of max-w-20 mx-auto CSS classes provides consistent styling with a maximum width constraint and center alignment, improving the form's visual presentation.

emhttp/plugins/dynamix/include/DefaultPageLayout/MainContentTabbed.php (2)

7-7: Minor formatting improvement.

The added blank line improves code readability by separating the header comment from the main content.


65-71: Robust flag management logic.

The conditional increment logic correctly manages the tab index based on whether a page without title was processed. The flag is properly reset after use to prevent state leakage between iterations.

The approach ensures tab-content alignment remains correct when pages with no titles but with text are evaluated.

zackspear added 3 commits May 29, 2025 17:34
- Updated the HTML structure for the delete label and checkbox to improve alignment and user experience.
- Adjusted the layout of surrounding elements for better visual consistency.
- Refactored HTML structure for read/write settings sections to improve layout and user experience.
- Updated clone settings elements for better responsiveness
- Updated form elements for better alignment and spacing, enhancing overall readability.
- Introduced markdown support for improved formatting in the settings section.
- Wrapped the form element in a div for improved structure and layout.
- Adjusted the closing div position to ensure proper HTML structure and readability.
@zackspear

Copy link
Copy Markdown
Contributor Author

No appetite for latest nitpicks.

@zackspear zackspear requested a review from ljm42 May 30, 2025 00:58
@limetech limetech merged commit 5530103 into master May 30, 2025
3 checks passed
@limetech limetech deleted the feat/responsive-improvements branch May 30, 2025 17:51
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