Skip to content

Conversation

@zackspear
Copy link
Contributor

@zackspear zackspear commented Aug 13, 2025

Summary by CodeRabbit

  • New Features
    • Flash Backup now shows clear warnings when not signed in or not connected, and includes a loading spinner before the form appears.
  • Style
    • Standardized Flash Backup action buttons with consistent spacing and layout.
  • Refactor
    • Reworked Settings grid to a responsive, class-driven layout (1-column on small screens, 2-column on medium+), simplifying styles and improving alignment and gaps.

@zackspear zackspear requested a review from pujitm August 13, 2025 19:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Updates Connect.page to handle Flash Backup visibility based on user/connection state and standardize button layout with a loading indicator. Refactors SettingsGrid.vue to use class-based responsive grid utilities instead of custom CSS and media queries. No changes to exported/public APIs or business logic.

Changes

Cohort / File(s) Summary
Connect Flash Backup UI states and layout
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page
Adds conditional rendering for Flash Backup (unregistered, not connected, or show form). Introduces loading spinner via flashbackuptext. Wraps action buttons in a consistent buttons-spaced container across states. Minor structural/text adjustments; no logic/APIs changed.
Settings grid layout refactor
unraid-ui/src/components/layout/SettingsGrid.vue
Replaces CSS grid/media queries with class-driven responsive layout (grid-cols-1 → md:grid-cols-[35%_1fr], gaps, and odd-child text alignment). Removes style block; no public API changes.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant P as Connect.page
  participant C as Connect Plugin/Cloud Status

  U->>P: Open Connect page
  P->>C: Check registration & cloud connection
  alt Not registered
    P-->>U: Show "Disabled until you have signed in"
  else Not cloud-connected
    P-->>U: Show "Disabled until connected to Unraid Connect Cloud"
  else Connected
    P-->>U: Show loading indicator
    P-->>U: Render Flash Backup form and controls
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mdatelle
  • elibosley
  • pujitm

Poem

I thump my paws in tidy delight,
Buttons now cuddle with measured spacing just right.
Grids hop from CSS to classes so spry,
A spinner twirls—clouds whisper by.
Flashy backups queue, carrots in a row—
Connected, content, I’m ready to go. 🥕✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/connect-settings-page-styles

🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@zackspear zackspear requested a review from elibosley August 13, 2025 19:36
@claude
Copy link

claude bot commented Aug 13, 2025

Claude finished @zackspear's task —— View job


Code Review - PR #1585

Analyzing changes for critical issues in the diff only...

Todo List

  • Read changed files to understand the diff
  • Analyze modified lines for critical issues (bugs, security, breaking changes, data loss)
  • Provide review feedback focusing only on changed code

Analysis

I've reviewed the diff and analyzed only the modified lines for critical issues:

Connect.page changes (lines 494-572):

  • Moving _(Flash backup)_: labels inside conditional blocks - no critical issues
  • Adding buttons-spaced CSS class wrapper spans - no critical issues
  • Restructuring button layout HTML - no critical issues

SettingsGrid.vue changes (lines 11-20):

  • Replacing CSS <style> block with Tailwind utility classes - no critical issues
  • Converting md:pl-3 md:gap-x-10 to md:gap-x-3 (reduces horizontal gap) - no critical issues
  • Moving grid column and text alignment rules to utility classes - no critical issues

No critical issues found in changes

The modifications are cosmetic layout improvements that don't introduce bugs, security vulnerabilities, breaking changes, or data loss risks.


@github-actions
Copy link
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@zackspear
Copy link
Contributor Author

zackspear commented Aug 13, 2025

Still a small improvement needed to aligning spacing horizontal spacing. Don't merge quite yet.

it gucci

@github-actions
Copy link
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR1585/dynamix.unraid.net.plg

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page (1)

456-463: Fix JavaScript syntax error (stray character after brace)

There is a stray "i" character after a closing brace, which will break all subsequent JS execution on this page.

-  }i
+  }
🧹 Nitpick comments (3)
unraid-ui/src/components/layout/SettingsGrid.vue (1)

11-16: Optional: Avoid passing class via props; rely on Vue’s class merge

Vue automatically merges the parent’s class attribute onto the root element. Passing class through props is unnecessary and may confuse readers.

Within this template block, remove props.class from cn(...). Also remove the defineProps typing for class.

Diff within these lines:

-        'grid grid-cols-1 md:grid-cols-[35%_1fr] md:[&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
-        props.class
+        'grid grid-cols-1 md:grid-cols-[35%_1fr] md:[&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6'

Outside these lines (script setup), remove the props typing entirely:

<script setup lang="ts">
import { cn } from '@/lib/utils';
// no defineProps needed; Vue will merge parent classes into the root element
</script>
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page (2)

495-500: Standardize capitalization: “Flash Backup”

Other strings use “Flash Backup” (capital B). Align these labels for consistency.

-_(Flash backup)_:
+_(Flash Backup)_:
- _(Flash backup)_:
+ _(Flash Backup)_:

502-502: Add aria-live to announce loading/state changes for screen readers

flashbackuptext dynamically changes content. Make it accessible with aria-live/role.

-: <span id='flashbackuptext'><span class='blue p0'>_(Loading)_ <i class="fa fa-spinner fa-spin" aria-hidden="true"></i></span></span>
+: <span id='flashbackuptext' aria-live="polite" role="status"><span class='blue p0'>_(Loading)_ <i class="fa fa-spinner fa-spin" aria-hidden="true"></i></span></span>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b321687 and 05ad350.

📒 Files selected for processing (2)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page (2 hunks)
  • unraid-ui/src/components/layout/SettingsGrid.vue (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Avoid unnecessary or obvious comments; only add comments when needed for clarity

Files:

  • unraid-ui/src/components/layout/SettingsGrid.vue
**/components/**/*.vue

📄 CodeRabbit Inference Engine (.cursor/rules/web-testing-rules.mdc)

Some Vue files may require explicit imports like ref or computed due to Nuxt auto-imports not applying in tests

Files:

  • unraid-ui/src/components/layout/SettingsGrid.vue
🔇 Additional comments (3)
unraid-ui/src/components/layout/SettingsGrid.vue (1)

11-16: Confirm Tailwind support for text-end and arbitrary variant selector

The utility text-end and the arbitrary variant selector [&>*:nth-child(odd)] require Tailwind versions that support logical alignments and arbitrary variants. If your Tailwind version lacks text-end, use text-right plus an RTL override.

Fallback (if needed):

  • Replace text-end with text-right and add an RTL override:
    md:[&>:nth-child(odd)]:text-right rtl:md:[&>:nth-child(odd)]:text-left
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page (2)

518-523: Ensure buttons-spaced class exists and is loaded on this page

You’ve wrapped multiple button groups in span.buttons-spaced for consistent spacing. Confirm that:

  • .buttons-spaced is defined in a stylesheet loaded by this page (not only in the SPA bundle).
  • The class applies appropriate layout (e.g., inline-flex with gap) across classic/legacy pages.

If not guaranteed, add a minimal local style or ensure the global stylesheet is included to avoid layout regressions.

Also applies to: 525-529, 532-535, 541-545, 551-554, 560-564, 567-571


502-502: LGTM: Loading indicator and placeholder

Initializing flashbackuptext with a loading spinner is a UX improvement and aligns with the subsequent Nchan-fed state updates.

Comment on lines +11 to +16
:class="
cn(
'grid grid-cols-1 md:grid-cols-[35%_1fr] [&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
props.class
)
"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Scope odd-child text alignment to md+ to avoid awkward mobile layout

Right-aligning odd children on small screens can make single-column layouts look off (labels become right-aligned above inputs). Limit this alignment to md and above.

-        'grid grid-cols-1 md:grid-cols-[35%_1fr] [&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
+        'grid grid-cols-1 md:grid-cols-[35%_1fr] md:[&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
:class="
cn(
'grid grid-cols-1 md:grid-cols-[35%_1fr] [&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
props.class
)
"
:class="
cn(
'grid grid-cols-1 md:grid-cols-[35%_1fr] md:[&>*:nth-child(odd)]:text-end gap-2 items-baseline md:gap-x-3 md:gap-y-6',
props.class
)
"
🤖 Prompt for AI Agents
In unraid-ui/src/components/layout/SettingsGrid.vue around lines 11 to 16, the
utility that right-aligns odd children is applying on all screen sizes; change
the selector so it only applies at md and above. Replace the class token
[&>*:nth-child(odd)]:text-end with md:[&>*:nth-child(odd)]:text-end so
single-column (mobile) layouts keep default left alignment while preserving
right-align for md+ breakpoints.

@elibosley elibosley merged commit 96c120f into main Aug 15, 2025
16 checks passed
@elibosley elibosley deleted the fix/connect-settings-page-styles branch August 15, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants