From 723bd9a095b31a8201ed301e049e2a88475b496b Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 11 Nov 2025 14:14:13 +0000 Subject: [PATCH] Added: Bury/Suspend More menu --- .../reviewer/reviewer-bottom/More.svelte | 20 ++++++++++++++---- ts/routes/reviewer/reviewer.ts | 21 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/ts/routes/reviewer/reviewer-bottom/More.svelte b/ts/routes/reviewer/reviewer-bottom/More.svelte index 1819f92f3..3f11251a5 100644 --- a/ts/routes/reviewer/reviewer-bottom/More.svelte +++ b/ts/routes/reviewer/reviewer-bottom/More.svelte @@ -32,7 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html { name: tr.studyingBuryCard(), shortcut: "-", - onClick: state.buryCurrentCard.bind(state), + onClick: state.buryOrSuspendCurrentCard.bind(state, false), }, { name: tr.actionsForgetCard(), shortcut: "Ctrl+Alt+N", onClick: todo }, { @@ -40,7 +40,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html shortcut: "Ctrl+Shift+D", onClick: state.displaySetDueDateMenu.bind(state), }, - { name: tr.actionsSuspendCard(), shortcut: "@", onClick: todo }, + { + name: tr.actionsSuspendCard(), + shortcut: "@", + onClick: state.buryOrSuspendCurrentCard.bind(state, true), + }, { name: tr.actionsOptions(), shortcut: "O", onClick: todo }, { name: tr.actionsCardInfo(), @@ -52,8 +56,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html "hr", // Notes { name: tr.studyingMarkNote(), shortcut: "*", onClick: todo }, - { name: tr.studyingBuryNote(), shortcut: "=", onClick: todo }, - { name: tr.studyingSuspendNote(), shortcut: "!", onClick: todo }, + { + name: tr.studyingBuryNote(), + shortcut: "=", + onClick: state.buryOrSuspendCurrentNote.bind(state, false), + }, + { + name: tr.studyingSuspendNote(), + shortcut: "!", + onClick: state.buryOrSuspendCurrentNote.bind(state, true), + }, { name: tr.actionsCreateCopy(), shortcut: "Ctrl+Alt+E", onClick: todo }, { name: tr.studyingDeleteNote(), diff --git a/ts/routes/reviewer/reviewer.ts b/ts/routes/reviewer/reviewer.ts index d8a12ce4e..c67d4bff7 100644 --- a/ts/routes/reviewer/reviewer.ts +++ b/ts/routes/reviewer/reviewer.ts @@ -112,12 +112,25 @@ export class ReviewerState { this.displayMenu("CardInfo"); } - public buryCurrentCard() { + public buryOrSuspendCurrentCard(suspend: boolean) { + const mode = suspend ? BuryOrSuspendCardsRequest_Mode.SUSPEND : BuryOrSuspendCardsRequest_Mode.BURY_USER; if (this.currentCard?.card?.id) { buryOrSuspendCards({ - cardIds: [this.currentCard?.card?.id], + cardIds: [this.currentCard.card.id], noteIds: [], - mode: BuryOrSuspendCardsRequest_Mode.BURY_USER, + mode, + }); + this.refresh(); + } + } + + public buryOrSuspendCurrentNote(suspend: boolean) { + const mode = suspend ? BuryOrSuspendCardsRequest_Mode.SUSPEND : BuryOrSuspendCardsRequest_Mode.BURY_USER; + if (this.currentCard?.card?.noteId) { + buryOrSuspendCards({ + cardIds: [], + noteIds: [this.currentCard.card.noteId], + mode, }); this.refresh(); } @@ -167,7 +180,7 @@ export class ReviewerState { break; } case "-": { - this.buryCurrentCard(); + this.buryOrSuspendCurrentCard(false); break; } }