Skip to content

feat: Instanteditor progress adoption - #22736

Merged
criticalAY merged 2 commits into
ankidroid:mainfrom
criticalAY:instanteditor-progress-adoption
Oct 28, 2026
Merged

criticalAY merged 2 commits into
ankidroid:mainfrom
criticalAY:instanteditor-progress-adoption

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Claude Opus 5.5

Purpose / Description

Adopt the ViewModel progress for the Instant Note Editor.

It also fixes a bug on main: Save could be tapped again while a note was saving, which added the same note twice and broke the collection until the app restarted.

Fixes

Approach

commits

How Has This Been Tested?

most of the users wont see this but nice to have?
after-1-saving

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 changed the title Instanteditor progress adoption feat: Instanteditor progress adoption Oct 24, 2026
david-allison

This comment was marked as resolved.

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Oct 24, 2026
@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Oct 25, 2026
david-allison

This comment was marked as resolved.

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author and removed Needs Author Reply Waiting for a reply from the original author labels Oct 26, 2026
@david-allison
david-allison self-requested a review October 26, 2026 19:42
david-allison

This comment was marked as resolved.

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Oct 26, 2026
@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Oct 27, 2026

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, cheers!

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Oct 27, 2026
@criticalAY criticalAY added Needs Author Reply Waiting for a reply from the original author and removed Needs Author Reply Waiting for a reply from the original author labels Oct 27, 2026

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assisted-by: grok-4.7

Thank you — the follow-up commits address what the earlier reviews asked for, and the shared test helper lands in the right place.

Prep rebased seven commits cleanly onto current main without pushing (push: no).

Local validation: lintAll, ktlintCheck, and lint-rules:test; unit via jacocoUnitTestReport; emulator with TEST_RELEASE_BUILD=true on assigned emulator-5556 / API35_GAPI.

Reviewed at ff8e1816: InstantEditorViewModel reports InstantEditorProgress.SAVING_NOTE through ProgressManager, and Save paths ignore taps while progress is active, while finishing, or when the no-cloze confirmation would re-read fields. checkAndSave extracts once; the warning’s Save calls saveNoteWithProgress(skipClozeCheck = true) so editorNote stays the validated snapshot. Activity tests cover double-save during active progress, double-tap on the warning, ignored saves during queued insertion, finish guard, and back during save; the no-cloze snapshot test asserts confirmation saves the fields that triggered the warning.

some acceptable findings, no action required, just leaving for posterity: Approach says “commits” while messages already describe each step; Accessibility Scanner unchecked though screenshot shows saving state; back-during-save test uses original share text so discard dialog timing matches the old window; Assisted-by trailers do not spell out which parts were tool-written.

@mikehardy mikehardy 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 Oct 28, 2026
@criticalAY
criticalAY added this pull request to the merge queue Oct 28, 2026
@criticalAY
criticalAY removed this pull request from the merge queue due to a manual request Oct 28, 2026
@criticalAY

Copy link
Copy Markdown
Contributor Author

I will squash the commits, then lets get this in

Saving a note now reports progress from InstantEditorViewModel, so back
is ignored until the save finishes instead of closing the editor
halfway through.

Assisted-by: Claude Opus 5.5
The editor is a dialog, so Save could still be tapped while a note was
saving. The second tap added the same note again, which failed in the
backend and broke the collection until the app restarted.

Save is now ignored while a note is saving or the editor is closing,
both in the editor and in the no-cloze warning. The check runs before
the fields are read, so an ignored Save can't change the note being
saved, and confirming the warning saves the fields that were checked.

Assisted-by: Claude Opus 5.5
@criticalAY
criticalAY force-pushed the instanteditor-progress-adoption branch from ff8e181 to dcfd067 Compare October 28, 2026 20:44
@criticalAY
criticalAY enabled auto-merge October 28, 2026 20:44
@criticalAY
criticalAY added this pull request to the merge queue Oct 28, 2026
Merged via the queue into ankidroid:main with commit c66d67d Oct 28, 2026
21 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 28, 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 Oct 28, 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.

3 participants