[BUG] Talkback reading ease button text incorrectly
Checked for duplicates?
- [x] This issue is not a duplicate
Does it also happen in the desktop version?
- [ ] This bug does not occur in the latest version of Anki Desktop
What are the steps to reproduce this bug?
Enable talkback mode in android settings, go to AnkiDroid and review any card, upon hovering on any of the ease buttons.
https://github.com/user-attachments/assets/8c59034e-0f86-40af-b8bb-b286d4946eb0
Expected behaviour
Talkback mode says metres. Expected behaviour is for it to say minutes.
Debug info
AnkiDroid Version = 2.22.3 (4f2ec681da36b8307a865f05192498b8425adf0f)
Backend Version = 0.1.60-anki25.07.5 (25.07.5 7172b2d26684c7ef9d10e249bd43dc5bf73ae00c)
Android Version = 14 (SDK 34)
ProductFlavor = play
Device Info = samsung | samsung | r0s | r0sxeea | SM-S901B | s5e9925
Webview User Agent = Mozilla/5.0 (Linux; Android 14; SM-S901B Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/142.0.7444.174 Mobile Safari/537.36
ACRA UUID = 320e031d-2ec2-4970-be8f-27784fbf1330
FSRS = 4.1.1 (Enabled: false)
Crash Reports Enabled = true
(Optional) Anything else you want to share?
No response
Research
- [x] I have checked the manual and the FAQ and could not find a solution to my issue
- [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
@david-allison Is this alright? Also, to fix the issue I suppose the next steps would be to find out to do research on where d,h,m.. come from as you said and then develop a solution based on that right? Should I close the pr I made in the parent issue then?
Depending on how much time you have close or draft it.
You can fix it via rebase and force push, but in this case I'd close it
Depending on how much time you have close or draft it.
You can fix it via rebase and force push, but in this case I'd close it
I'd love to try and fix it, since I've only been working on good first issues I would like to try it out, I'll list down anything I find during research here then work on any fixes.
After poking around, I think I have an idea of how we are receiving the time data: We are getting the time interval in the form of an object called a SchedulingStates which contains the raw data I assume (the code is very complex here so I havent tried to decipher what is actually happening) -> ReviewerViewModel.kt extracts the time with this line I believe val nextTimes = AnswerButtonsNextTime.from(state) -> AnswerbuttonsNextTime.kt extracts the raw time as a string and passes it on (I think this is where we can implement the fix by passing the raw data as well so we can use it for contentdesc) -> this goes to ReviewerFragment.kt which displays it (lines 359-370)
Hopefully, someone can verify the above. Another doubt I had was that when I implemented a fix in EaseButton.kt, it worked and during that process I was also able to change the UI of the ease button, does this mean we are still using EaseButton.kt but it is soon to be deprecated (I hope the question makes sense)?
Ah, this won't be fun and I'd advise leaving it for now
https://github.com/ankidroid/Anki-Android/blob/bd8e5c7cd01451c102265b96c9a77c25cf7cf119/AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/AnswerButtonsNextTime.kt#L27-L32
https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/proto/anki/scheduler.proto#L43
https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/rslib/src/scheduler/service/mod.rs#L219-L225
Implementation
https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/rslib/src/scheduler/answering/mod.rs#L262-L305
Ah, this won't be fun and I'd advise leaving it for now
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/AnswerButtonsNextTime.kt
Lines 27 to 32 in bd8e5c7
companion object { suspend fun from(state: CurrentQueueState): AnswerButtonsNextTime { val (again, hard, good, easy) = withCol { sched.describeNextStates(state.states) } return AnswerButtonsNextTime(again = again, hard = hard, good = good, easy = easy) } } https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/proto/anki/scheduler.proto#L43
https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/rslib/src/scheduler/service/mod.rs#L219-L225
Implementation
https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/rslib/src/scheduler/answering/mod.rs#L262-L305
Right, the moment I saw SchedulingState.java I knew it was way too complex for me, I'll look into other buttons instead for now but another issue in reviewer is that it doesn't read the cards themselves which I believe makes the app unusable, I thought it would be too complex so I didn't look into it but I thought it may be worth adding an issue for, if one is not there already.
We have a few choices:
- implement
format_time_spanand use the same derived data- https://github.com/ankitects/anki/blob/2d4de33cf3160342c4c704c294e643c3e11071b1/pylib/anki/collection.py#L182-L187
- Implement the functionality in the Rust backend for Android-only code
- Reverse the data we have from
schedulingAnswerButtonTime[Years]and pass it toschedulingTimeSpan[Years]
My vote is for (2), but it's a lot of work for minimal gain :/