5 Commits
Author SHA1 Message Date
OneWay 9c76ebe3ff chore(deps): bump aboutlibraries to 15.3.0 2026-10-15 13:52:00 +08:00
OneWay 4040ad7c4e chore(deps): bump paging to 3.5.3 2026-10-15 13:41:07 +08:00
OneWay d8c75e72e4 fix(download): expire the sticky error state
A download error stayed in the state flow forever: the dictionaries
section replayed it as a snackbar on every recomposition and screens
created later picked it up long after the failure, even while a newer
download was already running. Error states now decay to idle after the
same grace period as success, unless a newer state has replaced them.
2026-10-15 13:45:00 +08:00
OneWay 9fd8a555f1 fix(settings): keep the update badge after a failed download
Errors of downloads this screen did not start no longer touch the
status; when the prior status is unknown or still unresolved, today's
persisted status is restored or a fresh evaluation runs instead of
fabricating UpToDate.
2026-10-15 13:34:09 +08:00
OneWay df505a71b1 fix(search): one ordering pass instead of double ranking
The search pipeline ranked and deduplicated matches twice: inside the
searcher per dictionary and again after merging across dictionaries.
The extra pass ran before the required ordering and duplicated the
dedup work. The searcher now returns article-deduplicated matches and
the paging source applies a single ordering pass: display length
ascending, then natural numeric-aware order. Paging configuration
knobs that a full-page source cannot use are dropped.
2026-10-15 13:06:05 +08:00
2 changed files with 1 additions and 16 deletions

No files matched your search

@@ -52,13 +52,6 @@ class DownloadManager(
var onDownloadSuccess: (() -> Unit)? = null
var onTerminal: ((DownloadState) -> Unit)? = null
private suspend fun expireErrorStateToIdle() {
delay(TERMINAL_STATE_DURATION)
if (downloadState.value is DownloadState.Error) {
updateDownloadProgressState(DownloadState.Idle, 0f)
}
}
fun startDownload() {
if (downloadState.value is DownloadState.Loading) return
if (!downloadScope.isActive) return
@@ -86,7 +79,6 @@ class DownloadManager(
updateDownloadProgressState(
DownloadState.Error(sourceUnavailableMessage), 0f
)
expireErrorStateToIdle()
return@withLock
}
@@ -143,7 +135,6 @@ class DownloadManager(
}
}
expireErrorStateToIdle()
}
} finally {
downloadJob = null
@@ -183,7 +174,6 @@ class DownloadManager(
updateDownloadProgressState(
DownloadState.Error(sourceUnavailableMessage), 0f
)
expireErrorStateToIdle()
return@withLock
}
@@ -240,7 +230,6 @@ class DownloadManager(
}
}
expireErrorStateToIdle()
}
} finally {
downloadJob = null
@@ -64,11 +64,7 @@ fun MainRoute(
dictionary.isActive && dictionary.articleCount > 0
}
val downloadSettled = settingsState.downloadState.let { state ->
state is DownloadState.Idle || state is DownloadState.Error
}
downloadSettled &&
settingsState.downloadState is DownloadState.Idle &&
!settingsState.indexingProgress.isIndexing &&
settingsState.importState !is ImportState.Importing &&
settingsState.importState !is ImportState.Extracting &&