From 11aeb313ef2b90843ecbe7dff5987508fa2f6aaa Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 19 Sep 2024 11:54:27 +0200 Subject: [PATCH] feat(commandline): add back commands that quickly practise missed and slow words --- .../src/ts/commandline/lists/result-screen.ts | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/frontend/src/ts/commandline/lists/result-screen.ts b/frontend/src/ts/commandline/lists/result-screen.ts index 8f8b358b0..9c5cc6a02 100644 --- a/frontend/src/ts/commandline/lists/result-screen.ts +++ b/frontend/src/ts/commandline/lists/result-screen.ts @@ -5,6 +5,43 @@ import * as Notifications from "../../elements/notifications"; import * as TestInput from "../../test/test-input"; import * as TestWords from "../../test/test-words"; import Config from "../../config"; +import * as PractiseWords from "../../test/practise-words"; + +const practiceSubgroup: MonkeyTypes.CommandsSubgroup = { + title: "Practice words...", + list: [ + { + id: "practiseWordsMissed", + display: "missed", + exec: (): void => { + PractiseWords.init("words", false); + TestLogic.restart({ + practiseMissed: true, + }); + }, + }, + { + id: "practiseWordsSlow", + display: "slow", + exec: (): void => { + PractiseWords.init("off", true); + TestLogic.restart({ + practiseMissed: true, + }); + }, + }, + { + id: "practiseWordsCustom", + display: "custom...", + exec: (options): void => { + PractiseWordsModal.show({ + animationMode: "modalOnly", + modalChain: options.commandlineModal, + }); + }, + }, + ], +}; const commands: MonkeyTypes.Command[] = [ { @@ -34,15 +71,9 @@ const commands: MonkeyTypes.Command[] = [ }, { id: "practiseWords", - display: "Practice words", + display: "Practice words...", icon: "fa-exclamation-triangle", - opensModal: true, - exec: (options): void => { - PractiseWordsModal.show({ - animationMode: "modalOnly", - modalChain: options.commandlineModal, - }); - }, + subgroup: practiceSubgroup, available: (): boolean => { return TestUI.resultVisible; },