Skip to content

Commit 6a9390e

Browse files
committed
build(deps): adopt Anki 26.05 beta1
Not to be merged until it becomes stable https://github.com/ankitects/anki/releases/tag/26.05b1 https://forums.ankiweb.net/t/anki-26-05-beta-1/69707/9?u=david FSRS "5.2.0" is still FSRS 6 ---- > implementing `getCustomColors` would bring parity with desktop for the > io editor which'll use em, yeah. im not sure if there's a max size for > android's colour picker palette, in which case truncation might > occur (but if it does the future note editor would also have the same > issue) > on desktop, `saveCustomColours` relies on qt calls to get the palette > instead of passing it from the web like i imagine would be required on > mobile ---- Ignores 'Off' Assisted-by: Claude Opus 4.8 - ignoring translations
1 parent e222af9 commit 6a9390e

6 files changed

Lines changed: 25 additions & 5 deletions

File tree

AnkiDroid/src/main/java/com/ichi2/anki/pages/PostRequestHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ val collectionMethods =
128128
"getIgnoredBeforeCount" to { bytes -> getIgnoredBeforeCountRaw(bytes) },
129129
"getRetentionWorkload" to { bytes -> getRetentionWorkloadRaw(bytes) },
130130
"simulateFsrsWorkload" to { bytes -> simulateFsrsWorkloadRaw(bytes) },
131-
// https://github.com/ankitects/anki/pull/4326 -> saveCustomColours should be no-op in mobile clients
132-
"saveCustomColours" to { bytes -> backendIdentity(bytes) },
131+
"saveCustomColours" to { bytes -> saveCustomColoursRaw(bytes) },
132+
"getCustomColours" to { bytes -> getCustomColoursRaw(bytes) },
133133
)
134134

135135
suspend fun handleCollectionPostRequest(

AnkiDroid/src/main/java/com/ichi2/anki/scheduling/Fsrs.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ value class FsrsVersion(
4343
when (libraryVersion) {
4444
"0.6.4" -> "FSRS 4.5"
4545
"1.4.3", "2.0.3" -> "FSRS 5"
46-
"4.1.1", "5.1.0" -> "FSRS 6"
46+
"4.1.1", "5.1.0", "5.2.0" -> "FSRS 6"
4747
else -> null
4848
}
4949
}

AnkiDroid/src/test/java/com/ichi2/anki/TranslationTest.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class TranslationTest : RobolectricTest() {
3939
@Test
4040
fun `translatable strings do not duplicate GeneratedTranslations`() =
4141
runTest {
42-
val backendStrings = getBackendNonArgStrings()
42+
val backendStrings =
43+
getBackendNonArgStrings()
44+
.filterNot { it.methodName in IGNORED_BACKEND_TRANSLATIONS }
4345
val backendByText = backendStrings.groupBy { it.text }
4446
val backendByTextLower = backendStrings.groupBy { it.text.lowercase() }
4547
val xmlStrings = getTranslatableXmlStrings()
@@ -363,5 +365,16 @@ class TranslationTest : RobolectricTest() {
363365
// TR.studyingShowAnswer()
364366
// TR.deckConfigQuestionActionShowAnswer()
365367
)
368+
369+
/**
370+
* Backend translation method names (e.g. `TR.xx()`) excluded from the
371+
* duplicate check as the strings are unrelated conceptually.
372+
*
373+
* Do not remove this set when empty.
374+
*/
375+
private val IGNORED_BACKEND_TRANSLATIONS =
376+
setOf(
377+
"launcherOff", // "Off" - unrelated to R.string.full_screen_off
378+
)
366379
}
367380
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ androidxWebkit = "1.15.0"
6464
# https://developer.android.com/jetpack/androidx/releases/work
6565
androidxWork = "2.11.2"
6666
# https://github.com/ankidroid/Anki-Android-Backend/
67-
ankiBackend = '0.1.64-anki25.09.2'
67+
ankiBackend = '0.1.65-anki26.05b1'
6868
autoService = "1.1.1"
6969
autoServiceAnnotations = "1.1.1"
7070
# https://github.com/skydoves/ColorPickerView/releases

libanki/src/main/java/com/ichi2/anki/libanki/Collection.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,12 @@ class Collection(
14931493

14941494
@NotInPyLib
14951495
fun evaluateParamsLegacyRaw(input: ByteArray): ByteArray = backend.evaluateParamsLegacyRaw(input = input)
1496+
1497+
@NotInPyLib
1498+
fun saveCustomColoursRaw(input: ByteArray): ByteArray = backend.saveCustomColoursRaw(input = input)
1499+
1500+
@NotInPyLib
1501+
fun getCustomColoursRaw(input: ByteArray): ByteArray = backend.getCustomColoursRaw(input = input)
14961502
}
14971503

14981504
@NotInPyLib

libanki/src/main/java/com/ichi2/anki/libanki/Deck.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ fun Order.toDisplayString(translations: Translations) =
135135
Order.REVERSE_ADDED -> translations.decksLatestAddedFirst()
136136
Order.RETRIEVABILITY_ASCENDING -> translations.deckConfigSortOrderRetrievabilityAscending()
137137
Order.RETRIEVABILITY_DESCENDING -> translations.deckConfigSortOrderRetrievabilityDescending()
138+
Order.RELATIVE_OVERDUENESS -> translations.decksRelativeOverdueness()
138139
Order.UNRECOGNIZED -> throw IllegalArgumentException("Can't display an unknown enum value.")
139140
}
140141

0 commit comments

Comments
 (0)