feat: add 'keep chat images' toggle to preserve chat images across restarts (#563) - #828
Open
ghshhf wants to merge 1 commit into
Open
feat: add 'keep chat images' toggle to preserve chat images across restarts (#563)#828ghshhf wants to merge 1 commit into
ghshhf wants to merge 1 commit into
Conversation
…starts (AAswordman#563) Implement upstream issue AAswordman#563: a user setting that, when enabled, stops ImagePoolManager from clearing the on-disk image cache on startup and from deleting disk files when the in-memory LRU pool evicts entries. Plumbing: new KEEP_CHAT_IMAGES DataStore preference, injected into ImagePoolManager at Application startup. UI: a Switch added to ChatHistorySettingsScreen with en/base string resources. Also adds JsCalculator JVM regression tests under core/tools.
luojiaping
requested review from
AAswordman and
luojiaping
and removed request for
luojiaping
July 27, 2026 23:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements upstream issue #563: a user setting "Keep chat images" that, when enabled, prevents
ImagePoolManagerfrom clearing the on-disk image cache on app startup and from deleting disk files when the in-memory LRU pool evicts entries. Chat images are therefore preserved across restarts and cache eviction.Changes
ImagePoolManager: addedkeepChatImagesflag; skipclearDiskCache()at startup and skipdeleteFromDisk()on LRU eviction when enabled.UserPreferencesManager: newKEEP_CHAT_IMAGESDataStore preference with Flow + setter.OperitApplication: read the preference before initializing the image pool, so startup does not wipe the disk cache.ChatHistorySettingsScreen: new Switch (with description) bound to the preference.values/strings.xml+values-en/strings.xml: new strings (zh + en).JsCalculatorRegressionTest: added pure-JVM regression tests undercore/tools/calculator(no Android dependency).Testing
Closes #563