Added: Bury/Suspend More menu

This commit is contained in:
Luc Mcgrady 2025-11-11 14:14:13 +00:00
parent d96809cdfa
commit 723bd9a095
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
2 changed files with 33 additions and 8 deletions

View file

@ -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(),

View file

@ -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;
}
}