1
0

Improved testing flow

This commit is contained in:
2026-03-25 18:59:47 +01:00
parent 0566d9db10
commit dfe13b093d
9 changed files with 85 additions and 29 deletions

View File

@@ -193,8 +193,8 @@
<section id="step-mode" class="step" hidden>
<p>What would you like to do?</p>
<div class="selection-cards" role="radiogroup" aria-label="Mode selection">
<label class="selection-card selection-card--selected selection-card--recommended">
<input type="radio" name="mode" value="nickelmenu" checked>
<label class="selection-card selection-card--recommended">
<input type="radio" name="mode" value="nickelmenu">
<div class="selection-card-body">
<div class="selection-card-title">Install or remove NickelMenu</div>
<div class="recommended-label">Recommended</div>
@@ -212,7 +212,7 @@
<p id="mode-patches-hint" class="fallback-hint" hidden>Custom patches are not available for your software version. You can still install NickelMenu and choose what you want to do with your Kobo.</p>
<div class="step-actions">
<button id="btn-mode-back" class="secondary">&#x2039; Back</button>
<button id="btn-mode-next" class="primary">Continue &#x203A;</button>
<button id="btn-mode-next" class="primary" disabled>Continue &#x203A;</button>
</div>
</section>

View File

@@ -25,7 +25,7 @@ import { KoboPatchRunner } from './services/patch-runner.js';
import { NickelMenuInstaller, ALL_FEATURES } from '../nickelmenu/installer.js';
import { TL } from './strings.js';
import { isEnabled as analyticsEnabled, track } from './analytics.js';
import { $, $q, populateSelect } from './dom.js';
import { $, $q, $qa, populateSelect } from './dom.js';
import { showStep, setNavLabels, setNavStep, hideNav, showNav, stepHistory, setupCardRadios } from './nav.js';
import { initNickelMenu } from './flows/nickelmenu-flow.js';
import { initPatchesFlow } from './flows/patches-flow.js';
@@ -131,7 +131,7 @@ const nm = initNickelMenu(state);
const patches = initPatchesFlow(state);
// Wire up card-radio interactivity for mode selection and NM option cards.
setupCardRadios(stepMode, 'selection-card--selected');
setupCardRadios(stepMode, 'selection-card--selected', () => { btnModeNext.disabled = false; });
setupCardRadios($('step-nickelmenu'), 'selection-card--selected');
// =============================================================================
@@ -181,6 +181,14 @@ state.showError = showError;
function goToModeSelection() {
nm.resetNickelMenuState();
btnModeNext.disabled = true;
// Clear any previous mode selection so the user must pick again.
for (const radio of $qa('input[name="mode"]', stepMode)) {
radio.checked = false;
radio.closest('.selection-card')?.classList.remove('selection-card--selected');
}
const patchesRadio = $q('input[value="patches"]', stepMode);
const patchesCard = patchesRadio.closest('.selection-card');
const autoModeNoPatchesAvailable = !state.manualMode && (!state.patchesLoaded || !state.firmwareURL);

View File

@@ -99,7 +99,7 @@ export function showNav() {
* When a radio inside a <label> is checked, the label gets `selectedClass`;
* all sibling labels lose it.
*/
export function setupCardRadios(container, selectedClass) {
export function setupCardRadios(container, selectedClass, onChange) {
const labels = $qa('label', container);
for (const label of labels) {
const radio = $q('input[type="radio"]', label);
@@ -109,6 +109,7 @@ export function setupCardRadios(container, selectedClass) {
if ($q('input[type="radio"]', l)) l.classList.remove(selectedClass);
}
if (radio.checked) label.classList.add(selectedClass);
if (onChange) onChange(radio);
});
}
}

View File

@@ -17,7 +17,7 @@ export const TL = {
STATUS: {
DEVICE_RECOGNIZED: 'Your device has been recognized. You can continue to the next step!',
NM_REMOVED_ON_REBOOT: 'NickelMenu will be removed on next reboot.',
NM_INSTALLED: 'NickelMenu has been prepared for your Kobo. To complete the installation, follow the instructions below.',
NM_INSTALLED: 'NickelMenu has been installed on your Kobo. To complete the installation, follow the instructions below.',
NM_DOWNLOAD_READY: 'Your NickelMenu package is ready to download. After downloading, a list of installation steps will be displayed.',
NM_WILL_BE_REMOVED: 'NickelMenu will be updated and marked for removal. It will uninstall itself when your Kobo reboots.',
NM_WILL_BE_INSTALLED: 'The following will be installed on your Kobo:',