Added: Bury shortcut

This commit is contained in:
Luc Mcgrady 2025-11-11 09:47:06 +00:00
parent 40d7ce88aa
commit f5c4b02609
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
2 changed files with 23 additions and 1 deletions

View file

@ -779,6 +779,7 @@ exposed_backend_list = [
"get_optimal_retention_parameters",
"simulate_fsrs_review",
"simulate_fsrs_workload",
"bury_or_suspend_cards",
# DeckConfigService
"get_ignored_before_count",
"get_retention_workload",

View file

@ -1,7 +1,12 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
import {
BuryOrSuspendCardsRequest_Mode,
CardAnswer,
type NextCardDataResponse_NextCardData,
} from "@generated/anki/scheduler_pb";
import {
buryOrSuspendCards,
compareAnswer,
displayEditMenu,
getConfigJson,
@ -95,6 +100,17 @@ export class ReviewerState {
displayEditMenu({ cid: this.currentCard?.card?.id });
}
public buryCurrentCard() {
if (this.currentCard?.card?.id) {
buryOrSuspendCards({
cardIds: [this.currentCard?.card?.id],
noteIds: [],
mode: BuryOrSuspendCardsRequest_Mode.BURY_USER,
});
this.refresh();
}
}
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
key = key.toLowerCase();
switch (key) {
@ -136,6 +152,11 @@ export class ReviewerState {
}
case "e": {
this.displayEditMenu();
break;
}
case "-": {
this.buryCurrentCard();
break;
}
}
}