Added: Answer on enter

This commit is contained in:
Luc Mcgrady 2025-11-17 21:58:45 +00:00
parent cc043dbf0b
commit 43484e9201
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
4 changed files with 7 additions and 1 deletions

View file

@ -319,6 +319,10 @@ message NextCardDataResponse {
bool marked = 13;
optional TypedAnswer typed_answer = 12;
optional TimerPreferences timer = 14;
// TODO: Is it worth setting up some sort of "ReviewerPreferences" endpoint
// akin to GetGraphPreferences Also should this reviewer setting be moved to
// a config bool rather than config.meta
bool accept_enter = 15;
repeated card_rendering.AVTag question_av_tags = 8;
repeated card_rendering.AVTag answer_av_tags = 9;

View file

@ -701,6 +701,7 @@ def next_card_data() -> bytes:
# Night mode is handled by the frontend so that it works with the browsers theme if used outside of anki.
# Perhaps the OS class should be handled this way too?
data.next_card.body_class = theme_manager.body_classes_for_card_ord(card.ord, False)
data.next_card.accept_enter = aqt.mw.pm.spacebar_rates_card()
return data.SerializeToString()

View file

@ -501,6 +501,7 @@ impl crate::services::SchedulerService for Collection {
timer,
// Filled by python
accept_enter: true,
front: "".to_string(),
back: "".to_string(),
body_class: "".to_string(),

View file

@ -236,7 +236,7 @@ export class ReviewerState {
case "enter": {
if (!get(this.answerShown)) {
this.showAnswer();
} else {
} else if (this._cardData?.acceptEnter ?? true) {
this.easeButtonPressed(2);
}
break;