Skip to content

Conversation

@david-allison
Copy link
Member

Purpose / Description

When adding a new note when there were 3 fields, there was an awkward flicker on the screen

Fixes

Approach

When adding a note, the note type does not update,

This means we can avoid recreating the fields, which stops the keyboard being closed and opened.

One this was fixed, there was an separate visual issue:

  • fields are cleared
  • then, focus moves to the first field

If the current field had text, this caused two 'selection changed' visual updates, which was distracting.

So I added & used an extension to handle this

How Has This Been Tested?

Pixel 9 Pro, Android 16

  • Add a note with first field
  • Add a note with pinned fields (1st/2nd/1st & 2nd)

There are a few flaky tests, I /think/ these are generally flaky, and I'll need to look into them

Checklist

  • 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

onNoteAdded calls `setNote` which calls `updateFieldsFromStickyText`
This fixes two related problems:

* the fields and keyboard flickered when adding a note
* (once fixed) selection focus was updated twice

This also fixes 19916
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.

LGTM

@mikehardy mikehardy added this pull request to the merge queue Dec 26, 2025
@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 Review labels Dec 26, 2025
Merged via the queue into ankidroid:main with commit c292cfb Dec 26, 2025
18 checks passed
@github-actions github-actions bot added this to the 2.24 release milestone Dec 26, 2025
@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 Dec 26, 2025
@david-allison david-allison deleted the fix-note-editor-flicker branch December 26, 2025 16:41
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.

Note Editor: no snackbar shown on first note added

2 participants