Skip to content

feat: Add 'Show Onboarding Wizard' button to the ArrayOperation page.#2567

Merged
limetech merged 5 commits into
masterfrom
feat/onboarding-button
Mar 11, 2026
Merged

feat: Add 'Show Onboarding Wizard' button to the ArrayOperation page.#2567
limetech merged 5 commits into
masterfrom
feat/onboarding-button

Conversation

@Ajit-Mehrotra

@Ajit-Mehrotra Ajit-Mehrotra commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added Onboarding Wizard with a dedicated user interface.
    • Includes launcher button (disabled while array is running).
    • Displays contextual information when the wizard is unavailable.
    • Includes completion action to finalize onboarding process.

- Purpose: disable the onboarding wizard action while the array is online.
- Before: the Array Operation page kept the onboarding button clickable after the array was started.
- Why: launching onboarding while the array is online should be blocked and the UI did not reflect that restriction.
- What: render the Show Onboarding Wizard button as disabled whenever fsState is Started.
- How: reuse the existing Array Operation page fsState check directly in the button markup.
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

A new Onboarding Wizard UI page was added at emhttp/plugins/dynamix/UserOnboarding.page with an inline script exposing openOnboardingWizard() to open the wizard via a URL query parameter; UserPreferences.page has a non-functional formatting artifact change.

Changes

Cohort / File(s) Summary
Onboarding UI
emhttp/plugins/dynamix/UserOnboarding.page
Adds a new page rendering an "Onboarding Wizard" form, includes a "Show Onboarding Wizard" button (disabled when fsState == "Started"), a "Done" button, conditional note when fsState is "Started", localization markers, and a global openOnboardingWizard() function that redirects to the current path with ?onboarding=open.
Trivial Formatting
emhttp/plugins/dynamix/UserPreferences.page
Whitespace/newline artifact: a Tag="star" line was removed and re-added with identical content (no behavior change).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped in with a shiny new page,
A button to open the onboarding stage,
Click "Show" and off you’ll go,
A little wizard, nice and slow,
— from a rabbit who loves a helpful page ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title references adding a button to 'ArrayOperation page', but the actual changeset adds a new UserOnboarding.page file with minimal changes to UserPreferences.page. The title does not accurately reflect the primary change. Update the title to reflect that a new UserOnboarding.page was created with the onboarding wizard UI, such as 'feat: Add UserOnboarding page with onboarding wizard interface' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/onboarding-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.03.10.2015
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2567/webgui-pr-2567.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/UserOnboarding.page
emhttp/plugins/dynamix/UserPreferences.page

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2567, or run:

plugin remove webgui-pr-2567

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@Ajit-Mehrotra Ajit-Mehrotra self-assigned this Mar 9, 2026
@Ajit-Mehrotra
Ajit-Mehrotra requested a review from elibosley March 10, 2026 15:54
@Ajit-Mehrotra
Ajit-Mehrotra marked this pull request as ready for review March 10, 2026 15:55

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@emhttp/plugins/dynamix/ArrayOperation.page`:
- Line 905: The Show Onboarding Wizard button currently disables only when the
array fsState equals "Started"; update the disable gate on that input element in
ArrayOperation.page so it is disabled whenever fsState is not "Stopped" (i.e.,
allow the button only when the array is fully stopped). Locate the conditional
that reads the _var($var,'fsState') check for "Started" on the input and replace
it so the input is disabled for any fsState value other than "Stopped".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0fadfc80-3753-4ddf-af65-52f07a104598

📥 Commits

Reviewing files that changed from the base of the PR and between 29fc74a and 1aad334.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/ArrayOperation.page

<tr><td></td><td><span class="buttons-spaced"><input type="button" name="reboot" value="_(Reboot)_" onclick="shutdown_now(this.form,'reboot')"><input type="button" name="shutdown" value="_(Shutdown)_" onclick="shutdown_now(this.form,'shutdown')"></span></td>
<td>**_(Reboot)_** _(will activate a *clean* system reset)_.<br>**_(Shutdown)_** _(will activate a *clean* system power down)_.<br><label class="flex flex-row items-center gap-2"><input type="checkbox" name="safemode">_(Reboot in safe mode)_</label></td></tr>
<tr><td></td><td class="line" colspan="2"></td></tr>
<tr><td></td><td><input type="button" value="_(Show Onboarding Wizard)_" onclick="window.location.href=window.location.pathname+'?onboarding=open'" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>></td>

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.

⚠️ Potential issue | 🟠 Major

Broaden the disable gate beyond Started.

Line 905 only blocks the wizard for fsState == "Started", so it stays clickable during other non-offline states like Starting, Stopping, Formatting, Copying, and Clearing. This page already uses fsState != "Stopped" for similar controls, and emhttp/plugins/dynamix/include/Boot.php:91-109 shows those states are valid. Please gate this action on the array being fully stopped instead.

Suggested fix
- <tr><td></td><td><input type="button" value="_(Show Onboarding Wizard)_" onclick="window.location.href=window.location.pathname+'?onboarding=open'" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>></td>
+ <tr><td></td><td><input type="button" value="_(Show Onboarding Wizard)_" onclick="window.location.href=window.location.pathname+'?onboarding=open'" <?if (_var($var,'fsState')!="Stopped"):?>disabled<?endif;?>></td>
📝 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
<tr><td></td><td><input type="button" value="_(Show Onboarding Wizard)_" onclick="window.location.href=window.location.pathname+'?onboarding=open'" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>></td>
<tr><td></td><td><input type="button" value="_(Show Onboarding Wizard)_" onclick="window.location.href=window.location.pathname+'?onboarding=open'" <?if (_var($var,'fsState')!="Stopped"):?>disabled<?endif;?>></td>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix/ArrayOperation.page` at line 905, The Show Onboarding
Wizard button currently disables only when the array fsState equals "Started";
update the disable gate on that input element in ArrayOperation.page so it is
disabled whenever fsState is not "Stopped" (i.e., allow the button only when the
array is fully stopped). Locate the conditional that reads the
_var($var,'fsState') check for "Started" on the input and replace it so the
input is disabled for any fsState value other than "Stopped".

@elibosley elibosley added the 7.3 label Mar 10, 2026
Removed FAQ section placeholder from UserOnboarding.page.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@emhttp/plugins/dynamix/UserOnboarding.page`:
- Around line 25-35: The onboarding wizard buttons and message currently only
check fsState == "Started"; change the logic to enable the "Show Onboarding
Wizard" button only when fsState == "Stopped" and disable it (and show the
"Array must be stopped" small text) for any other state (e.g., "Starting",
"Stopping", "Formatting", etc.). Update the input element with
onclick="openOnboardingWizard()" to use a condition like <?if
(_var($var,'fsState')!="Stopped"):?>disabled<?endif;?> and change the
conditional that renders the <small> warning to <?if
(_var($var,'fsState')!="Stopped"):?> so the guard consistently references
fsState == "Stopped" for enabling/disabling the wizard and showing the warning
(affecting the elements tied to openOnboardingWizard and the warning message).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 56324745-9906-422e-ba63-fcbb8780fa38

📥 Commits

Reviewing files that changed from the base of the PR and between 1aad334 and 30e0cc5.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/UserOnboarding.page
  • emhttp/plugins/dynamix/UserPreferences.page
✅ Files skipped from review due to trivial changes (1)
  • emhttp/plugins/dynamix/UserPreferences.page

Comment on lines +25 to +35
<form markdown="1" name="user_onboarding_settings">
_(Onboarding Wizard)_:
: <span class="inline-block">
<input type="button" value="_(Show Onboarding Wizard)_" onclick="openOnboardingWizard()" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>>
<input type="button" value="_(Done)_" onclick="done()">
</span>

: _(Launch the onboarding wizard to customize your server and set up an internal boot drive)_.

<?if (_var($var,'fsState')=="Started"):?>
: <small>_(Array must be stopped to open the onboarding wizard)_.</small>

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.

⚠️ Potential issue | 🟠 Major

Gate the wizard on Stopped, not just Started.

Line 28 and Line 34 only special-case fsState == "Started", but emhttp/plugins/dynamix/include/Boot.php:55-67 shows other non-stopped states (Starting, Stopping, and the default branch for active states such as Formatting). As written, the wizard stays enabled during those states even though the UI message says the array must be stopped.

Suggested fix
 <form markdown="1" name="user_onboarding_settings">
+<?$arrayStopped = _var($var,'fsState')=="Stopped";?>
 _(Onboarding Wizard)_:
 : <span class="inline-block">
-  <input type="button" value="_(Show Onboarding Wizard)_" onclick="openOnboardingWizard()" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>>
+  <input type="button" value="_(Show Onboarding Wizard)_" onclick="openOnboardingWizard()" <?if (!$arrayStopped):?>disabled<?endif;?>>
   <input type="button" value="_(Done)_" onclick="done()">
   </span>
 
 : _(Launch the onboarding wizard to customize your server and set up an internal boot drive)_.
 
-<?if (_var($var,'fsState')=="Started"):?>
+<?if (!$arrayStopped):?>
 : <small>_(Array must be stopped to open the onboarding wizard)_.</small>
 <?endif;?>
📝 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
<form markdown="1" name="user_onboarding_settings">
_(Onboarding Wizard)_:
: <span class="inline-block">
<input type="button" value="_(Show Onboarding Wizard)_" onclick="openOnboardingWizard()" <?if (_var($var,'fsState')=="Started"):?>disabled<?endif;?>>
<input type="button" value="_(Done)_" onclick="done()">
</span>
: _(Launch the onboarding wizard to customize your server and set up an internal boot drive)_.
<?if (_var($var,'fsState')=="Started"):?>
: <small>_(Array must be stopped to open the onboarding wizard)_.</small>
<form markdown="1" name="user_onboarding_settings">
<?$arrayStopped = _var($var,'fsState')=="Stopped";?>
_(Onboarding Wizard)_:
: <span class="inline-block">
<input type="button" value="_(Show Onboarding Wizard)_" onclick="openOnboardingWizard()" <?if (!$arrayStopped):?>disabled<?endif;?>>
<input type="button" value="_(Done)_" onclick="done()">
</span>
: _(Launch the onboarding wizard to customize your server and set up an internal boot drive)_.
<?if (!$arrayStopped):?>
: <small>_(Array must be stopped to open the onboarding wizard)_.</small>
<?endif;?>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix/UserOnboarding.page` around lines 25 - 35, The
onboarding wizard buttons and message currently only check fsState == "Started";
change the logic to enable the "Show Onboarding Wizard" button only when fsState
== "Stopped" and disable it (and show the "Array must be stopped" small text)
for any other state (e.g., "Starting", "Stopping", "Formatting", etc.). Update
the input element with onclick="openOnboardingWizard()" to use a condition like
<?if (_var($var,'fsState')!="Stopped"):?>disabled<?endif;?> and change the
conditional that renders the <small> warning to <?if
(_var($var,'fsState')!="Stopped"):?> so the guard consistently references
fsState == "Stopped" for enabling/disabling the wizard and showing the warning
(affecting the elements tied to openOnboardingWizard and the warning message).

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@emhttp/plugins/dynamix/UserOnboarding.page`:
- Around line 20-22: openOnboardingWizard currently just reloads the page with
?onboarding=open but nothing reads that parameter; either remove the unused
button or implement parameter handling so the wizard actually opens. Add code to
run on page load (e.g., in the module initialization) that checks new
URLSearchParams(window.location.search).get('onboarding') === 'open' and then
calls the real wizard entry point (e.g., showOnboardingWizard or
startOnboardingWizard) or dispatches the event that opens the onboarding modal;
alternatively, remove openOnboardingWizard and the button that calls it if no
wizard entrypoint exists.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 53e2cf7c-7004-423d-bdfd-ca9d1c431776

📥 Commits

Reviewing files that changed from the base of the PR and between 30e0cc5 and f8c0701.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/UserOnboarding.page

Comment on lines +20 to +22
function openOnboardingWizard() {
window.location.href = window.location.pathname + '?onboarding=open';
}

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify whether the onboarding query parameter is consumed anywhere outside this new page.
# Expected: at least one hit that reads/acts on `onboarding` or `onboarding=open`.
# If the only matches are this file, clicking the button just reloads the current page.

rg -n -C2 'onboarding=open|\bonboarding\b|openOnboardingWizard\s*\(' .

Repository: unraid/webgui

Length of output: 1551


openOnboardingWizard() is non-functional—the query parameter is never consumed.

The function reloads the current page with ?onboarding=open, but no code in the repository reads or acts on this parameter. The button needs to either be removed or properly implemented to open the actual wizard interface.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix/UserOnboarding.page` around lines 20 - 22,
openOnboardingWizard currently just reloads the page with ?onboarding=open but
nothing reads that parameter; either remove the unused button or implement
parameter handling so the wizard actually opens. Add code to run on page load
(e.g., in the module initialization) that checks new
URLSearchParams(window.location.search).get('onboarding') === 'open' and then
calls the real wizard entry point (e.g., showOnboardingWizard or
startOnboardingWizard) or dispatches the event that opens the onboarding modal;
alternatively, remove openOnboardingWizard and the button that calls it if no
wizard entrypoint exists.

@limetech
limetech merged commit 583b8a1 into master Mar 11, 2026
5 checks passed
@limetech
limetech deleted the feat/onboarding-button branch March 11, 2026 15:53
@github-actions

Copy link
Copy Markdown

🧹 PR Test Plugin Cleaned Up

The test plugin and associated files for this PR have been removed from the preview environment.


🤖 This comment is automatically generated when a PR is closed.

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