Skip to content

feat(sync): let users turn off missing media warnings - #22828

Open
criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:feat/missing-media-warning-setting
Open

criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:feat/missing-media-warning-setting

Conversation

@criticalAY

@criticalAY criticalAY commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Opus 5.5

Purpose / Description

People who turn media sync off on purpose had no way to stop the "Failed to load" snackbar. This adds a "Warn about missing media" switch to Sync settings, on by default, and the old study screen, the new one and the previewers all respect it.

Fixes

Approach

check commit message

How Has This Been Tested?

added tests, one per screen (both failed before the change) and emulator:
sync-settings-warn-about-missing-media

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

@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.

too many settings on the panel, could we move this under 'fetch media on sync'

@BrayanDSO FYI if you have a better idea

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

Copy link
Copy Markdown
Contributor

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Snapshot diff report vs main. Open screenshot-diff for diffs.

  • PreferencesScreenshotTest: 1 change
All 1 changed screenshots

PreferencesScreenshotTest

  • FetchMediaPreferenceDialog_never_compare.png

@criticalAY

This comment was marked as off-topic.

@david-allison

Copy link
Copy Markdown
Member

I... don't understand, sorry

@david-allison

Copy link
Copy Markdown
Member

I was thinking in this location, but not absolute slop

Screenshot 2026-10-27 at 19 47 16

@BrayanDSO

Copy link
Copy Markdown
Member

Is that a real issue?

@criticalAY

Copy link
Copy Markdown
Contributor Author

That was wrong screenshot, but I liked your idea too here is what I had in my mind

fetch media(always) no new setting:
Screenshot 2026-10-28 at 10 13 37 AM

fetch media(always): switch is shown
Screenshot 2026-10-28 at 10 13 45 AM

@criticalAY

Copy link
Copy Markdown
Contributor Author

Is that a real issue?

  • Yes imo, also the message is already limited to twice per study session, so it's a mild annoyance. David suggested the switch on improve missing media UX #22591 for people who turn media sync off on purpose.

@ZornHadNoChoice

ZornHadNoChoice commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Is the "Display synchronization status" option necessary? We can at least remove an option and add a new one!

Also, I think that "Automatic synchronization" should be the first toggle.

@david-allison

david-allison commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

We were having users lose their data, so wanted a red dot if a user was not signed in to AnkiWeb

Some users got frustrated about not being able to dismiss the "red dot" if they don't use AnkiWeb.

I'd support changing this to a persistent local backup option once we support these backups (probably 2.27, I've been putting it off).

@ZornHadNoChoice

This comment was marked as low quality.

@BrayanDSO

Copy link
Copy Markdown
Member

so it's a mild annoyance.

It's a reminder to either sync or fix the issue. I don't see the value of disabling it forever.

People who turn media sync off on purpose had no way to stop the
missing media snackbar while studying. The "Fetch media on sync"
dialog now shows a "Warn about missing media" switch under Never.
It only applies while media sync is off.

Part of 22591

Assisted-by: Claude Opus 5.5
@criticalAY
criticalAY force-pushed the feat/missing-media-warning-setting branch from 638856d to 8b50f0c Compare November 3, 2026 05:49
@criticalAY

Copy link
Copy Markdown
Contributor Author

Moved it into the “Fetch media on sync” dialog like your mock @david-allison :
fetch-media-dialog-never-light

@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Nov 3, 2026
@ZornHadNoChoice

Copy link
Copy Markdown
Collaborator

Not a fan of this design. It's very unusual.

@mikehardy

Copy link
Copy Markdown
Member

Assisted-by: grok-4.7
strings_pass@8b50f0c1226b35293d610ef6c79479cc59579a48

Thank you — nesting the switch under Never matches David’s mock, and the default keeps the snackbar for existing Never users until they turn it off.

Locally I rebased one commit onto main without force-push (push: no). Lint passed (lintAll, ktlintCheck, lint-rules:test), unit passed (jacocoUnitTestReport), and emulator passed (TEST_RELEASE_BUILD=true on emulator-5556 / API35_GAPI). GitHub CI on this head still had pending jobs when I checked; merge pending CI.

Reviewed diff: preferences_sync.xml swaps the fetch-media row to FetchMediaPreference with a dialog that uses three radio buttons plus a “warn about missing media” switch shown only for Never; OK/Cancel persist enum choice and the boolean. Prefs.showMissingMediaWarnings gates the could-not-find snackbar in both AbstractFlashcardViewer and CardViewerFragment. Tests cover dialog OK/cancel/recreation, previewer snackbar on/off, and a screenshot of the Never dialog.

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

some acceptable findings, no action required, just leaving for posterity: missing_media_warning_key is not in AnalyticsConstants.reportablePrefKeys; AbstractFlashcardViewerTest only asserts the snackbar is absent; OK writes warnAboutMissingMedia even when the saved choice is not Never; shorter commit subject would fit conventional length prefs.

Screenshot changes have been detected, so leaving this for a good manual look.

@david-allison

david-allison commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Also not a fan of the design, my point was that it belonged on the dialog, under 'never' [probably as an options menu], but not with the current design

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Needs Review Strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants