Skip to content

Conversation

@BrayanDSO
Copy link
Member

Fixes

Approach

  1. For listening to Enter presses in the <input> box, I used onkeydown, similar to what Anki Desktop does (although they use the deprecated onkeypress listener there).
    • And I know that the screen darkens after that, but I'll fix that in the future (I think the same happens in other scenarios, but I don't recall any right now)
  2. The best way I thought for the ViewModel to listen to the View (specifically the WebView in this case) was to use a CompletableDeferred Flow. I haven't tested, but it shouldn't result in any leakages, it is testable, and it doesn't couple the ViewModel with the View. It feels a bit hacky, and I suspect that this needs to be hacky, but I'm open to more elegant solutions. Maybe there are some flow or coroutines tricks that can be done.

How Has This Been Tested?

Emulator 34

Screen_recording_20251102_120321.webm
Screen_recording_20251102_120231.webm

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

adds `Flow` as as suffix like the other properties in the class
If the template has some kind of script that updates the value of the type answer <input>, the changes wouldn't be shown in the answer comparison unless the user typed something after the changes
@BrayanDSO BrayanDSO changed the title Fix/typed feat+fix(new study screen): HTML type in answer improvements Nov 2, 2025
Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't propose anything better so LGTM.

@lukstbit lukstbit added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Nov 3, 2025
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also LGTM

@mikehardy mikehardy added this pull request to the merge queue Nov 4, 2025
Merged via the queue into ankidroid:main with commit 1890f7e Nov 4, 2025
18 checks passed
@github-actions github-actions bot added this to the 2.23 release milestone Nov 4, 2025
@github-actions github-actions bot removed the Needs Second Approval Has one approval, one more approval to merge label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Modifying typed answer with JS works inconsistently

3 participants