Skip to content

Commit 7f9b20f

Browse files
committed
Improve keyboard shortcuts UX in motor wizard
- Allow single spacebar press to cascade through safety check -> start wizard -> spin motors - Make spacebar release fully stop wizard (same as Stop Motors button) - Move keyboard shortcuts tooltip outside SpinningWizard div so it's visible before motors start - Refactor tooltip to use i18n instead of hardcoded text This improves discoverability and provides a more intuitive toggle behavior for the spacebar shortcut.
1 parent 58e983f commit 7f9b20f

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/components/EscDshotDirection/Body.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,11 @@ <h4 id="escDshotDirectionDialog-SettingsAutoSaved-Normal" i18n="escDshotDirectio
2525
</div>
2626
</div>
2727
<div id="escDshotDirectionDialog-WizardDialog" class="display-contents">
28+
<!-- Keyboard shortcuts tooltip - visible in all wizard states -->
29+
<div class="keyboard-shortcuts-tooltip" i18n="escDshotDirectionDialog-KeyboardShortcuts"></div>
30+
2831
<a href="#" id="escDshotDirectionDialog-SpinWizard" class="regular-button" i18n="escDshotDirectionDialog-SpinWizard"></a>
2932
<div id="escDshotDirectionDialog-SpinningWizard" class="display-contents">
30-
<!-- Keyboard shortcuts tooltip -->
31-
<div class="keyboard-shortcuts-tooltip">
32-
<strong>⌨️ Keyboard Shortcuts:</strong>
33-
<span class="shortcut-item"><kbd>Space</kbd> = Spin/Stop Motors</span>
34-
<span class="shortcut-separator">|</span>
35-
<span class="shortcut-item"><kbd>1-8</kbd> = Toggle Direction</span>
36-
</div>
37-
3833
<h4 id="escDshotDirectionDialog-WizardActionHint" i18n="escDshotDirectionDialog-WizardActionHint"></h4>
3934
<h4 id="escDshotDirectionDialog-WizardActionHintSecondLine" i18n="escDshotDirectionDialog-WizardActionHintSecondLine"></h4>
4035
<div id="escDshotDirectionDialog-WizardMotorButtons">

src/components/EscDshotDirection/EscDshotDirectionComponent.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,15 @@ class EscDshotDirectionComponent {
330330
event.stopPropagation();
331331
this._domAgreeSafetyCheckBox.prop("checked", true);
332332
this._domAgreeSafetyCheckBox.trigger("change");
333-
return;
333+
// Don't return - allow flow-through to next steps
334334
}
335335

336336
// Step 2: Start wizard if checkbox is checked and wizard isn't open yet
337337
if (this._domWarningContentBlock.is(":visible") && this._domAgreeSafetyCheckBox.is(":checked")) {
338338
event.preventDefault();
339339
event.stopPropagation();
340340
this._onStartWizardButtonClicked();
341-
return;
341+
// Don't return - allow flow-through to spin motors
342342
}
343343

344344
// Step 3: Spin motors if wizard is open but not spinning yet
@@ -436,7 +436,8 @@ class EscDshotDirectionComponent {
436436
}
437437

438438
_handleSpacebarRelease() {
439-
this._motorDriver.stopAllMotors();
439+
// Fully stop wizard (same as clicking "Stop motors" button)
440+
this._onStopWizardButtonClicked();
440441
}
441442

442443
_handleWindowBlur() {

0 commit comments

Comments
 (0)