Skip to content

Fix: instant editor cloze bug#20656

Merged
lukstbit merged 1 commit intoankidroid:mainfrom
criticalAY:fix/instant-editor-cloze-bug
Apr 7, 2026
Merged

Fix: instant editor cloze bug#20656
lukstbit merged 1 commit intoankidroid:mainfrom
criticalAY:fix/instant-editor-cloze-bug

Conversation

@criticalAY
Copy link
Copy Markdown
Contributor

@criticalAY criticalAY commented Apr 5, 2026

Purpose / Description

  • Blocked by refactor: use field backing property in Instant Editor VM #20501

  • When i was switching the increment or no increment, the no increment happens once but then again the cloze is incremented

    • setClozeFieldText always set currentClozeNumber to max + 1 regardless of the current cloze mode.
  • There was bug if i tap the switch to increment button twice, and there are no clozes at all then it start with 2, i.e. -> Increment mode -> no increment mode -> increment mode, then starting cloze is 2

    • toggleClozeMode unconditionally called decrementClozeNumber() or incrementClozeNumber() when switching modes.

Fixes

Approach

Add fix and unit test to stop regression

How Has This Been Tested?

Pixel 10

Learning (optional, can help others)

NA

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

@criticalAY criticalAY added Blocked by dependency Currently blocked by some other dependent / related change Needs Review and removed Needs Review labels Apr 5, 2026
@criticalAY criticalAY changed the title Fix/instant editor cloze bug Fix: instant editor cloze bug Apr 5, 2026
@ZornHadNoChoice
Copy link
Copy Markdown
Collaborator

Fixes #16936.

@criticalAY criticalAY force-pushed the fix/instant-editor-cloze-bug branch from 8868988 to f28624f Compare April 5, 2026 14:34
@criticalAY criticalAY removed Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts labels Apr 5, 2026
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Apr 5, 2026
@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Apr 7, 2026
@lukstbit lukstbit added this pull request to the merge queue Apr 7, 2026
Merged via the queue into ankidroid:main with commit 1de61eb Apr 7, 2026
15 checks passed
@github-actions github-actions bot added this to the 2.24 release milestone Apr 7, 2026
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Switching Cloze Mode Increments Next Cloze

4 participants