Skip to content

feat: add 'keep chat images' toggle to preserve chat images across restarts (#563) - #828

Open
ghshhf wants to merge 1 commit into
AAswordman:mainfrom
ghshhf:pr/keep-chat-images
Open

feat: add 'keep chat images' toggle to preserve chat images across restarts (#563)#828
ghshhf wants to merge 1 commit into
AAswordman:mainfrom
ghshhf:pr/keep-chat-images

Conversation

@ghshhf

@ghshhf ghshhf commented Jul 27, 2026

Copy link
Copy Markdown

Summary

Implements upstream issue #563: a user setting "Keep chat images" that, when enabled, prevents ImagePoolManager from 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: added keepChatImages flag; skip clearDiskCache() at startup and skip deleteFromDisk() on LRU eviction when enabled.
  • UserPreferencesManager: new KEEP_CHAT_IMAGES DataStore 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 under core/tools/calculator (no Android dependency).

Testing

  • Build + existing JVM test suite; the JsCalculator tests run without Android dependencies.
  • Manual verification recommended: enable the toggle, restart the app, and confirm chat images remain on disk.

Closes #563

…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
luojiaping requested review from AAswordman and luojiaping and removed request for luojiaping July 27, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant