Commit Graph
4978 Commits
Author SHA1 Message Date
HapeLee 295a219760 fix: 阅读菜单书源名称点击事件 2026-06-09 01:45:45 +08:00
HapeLee 25f6eeaf48 fix: 翻页开关 2026-06-09 01:17:10 +08:00
HapeLee f9fb720ae3 fix: 底栏显隐开关 2026-06-09 01:02:14 +08:00
HapeLee 9a53f9eaf4 fix: 电量显示卡住及阅读记录丢失 2026-06-09 00:45:14 +08:00
HapeLee d0be59f607 fix: 阅读背景问题 2026-06-09 00:16:36 +08:00
HapeLee 43fc1e8614 fix: prefDelegate 直接读DataStore值 2026-06-08 22:22:10 +08:00
HapeLee 8d12e03113 fix: 配置无响应问题 2026-06-08 13:51:30 +08:00
HapeLee 5db49a101c fix: 阅读界面日夜选项 2026-06-08 13:51:30 +08:00
HapeLee 51d5efbc2b fix: dataStore逻辑 2026-06-08 13:51:18 +08:00
HapeLee 99b6635f04 fix: dataStore逻辑 2026-06-08 13:51:12 +08:00
HapeLee dced1d364d refactor: AppConfig.themeMode 改为直接读取 ThemeConfig.themeMode
删除 AppConfig.themeMode 缓存变量,isNightTheme 和 JsExtensions
统一从 ThemeConfig.themeMode(prefDelegate / MutableState)读取,
消除 SP listener 异步同步的时序问题。
2026-06-08 13:51:12 +08:00
HapeLee 2ba5f98db9 fix: dataStore逻辑 2026-06-08 13:51:12 +08:00
HapeLee bdc0424073 fix: 阅读界面切换亮暗色后 View 层立即生效
toggleDayNight() 设置 ThemeConfig.themeMode 后,同步更新
AppConfig.themeMode 缓存变量,避免 View 层通过 ReadStyleResolver
读取时因 SP listener 异步回调而拿到旧值。
2026-06-08 13:51:12 +08:00
HapeLee 26d9c8ae84 fix: dataStore逻辑 2026-06-08 13:51:12 +08:00
HapeLee e5c6643da8 fix: 修复阅读界面切换亮暗色主题无效的问题 2026-06-08 13:51:12 +08:00
HapeLee 9189b3dcfc fix: dataStore逻辑 2026-06-08 13:51:11 +08:00
HapeLee 2d4372f968 refactor: SP/DS 统一迁移 — PrefDelegate 双写 + DS 观察者 + 备份从 DS 读取
Phase 1: PrefDelegate.setValue 写入 SP 后异步同步到 DataStore (DsSync)
Phase 2: PrefDelegate.init 启动 DS 观察者,以 DS 为读取权威源,含类型回退
Phase 3: SettingsRepository 移除 syncToSharedPrefs,DS 为唯一写入源
Phase 4: Backup.kt 从 DataStore 读取配置(替代 defaultSharedPreferences)

修复:
- postMigrationSync 读取 DS String key 时 ClassCastException (runCatching)
- DS 观察者类型回退: typed key 读不到时从 stringPreferencesKey 转换
- DS 观察者安全读取: runCatching 避免类型不匹配崩溃
2026-06-08 01:21:50 +08:00
fansangg d43cf79274 fix:页面背景及类型更改时更新状态栏颜色 2026-06-08 01:21:50 +08:00
HapeLee 3647ee7979 fix: 朗读配置面板无法标识当前引擎及切换引擎后状态不一致 2026-06-08 01:19:47 +08:00
HapeLee 40cb04dfab fix: 修复 BgTextConfigSheet 中 Color.parseColor 崩溃问题
当 bgStr/bgStrNight 为空字符串或非法颜色值时,toColorInt() 会抛出
IllegalArgumentException: Unknown color。使用 runCatching 包裹并提供
合理的默认值(日间 #EEEEEE,夜间 #000000)。
2026-06-08 00:28:23 +08:00
HapeLee 4cc04b20d5 fix: DataStore迁移后主题配置丢失导致composeEngine重置
postMigrationSync()在App启动时校验SP中的主题key,若缺失则从DataStore补回。
解决进入ReadBookScreen触发首次DS访问后,composeEngine等配置被重置的问题。
2026-06-08 00:21:46 +08:00
fansan 5897304274 fix:修复菜单打开及切换配置时状态栏颜色未同步更新的问题 (#1310)
* fix:修复菜单打开及切换配置时状态栏颜色未同步更新的问题

* fix:ReadStyleContent底部tab不跟手,settledPage改成currentPage
2026-06-08 00:20:32 +08:00
Kudomaga 4c088448c3 feat(reader): 船新的基于 Compose 实现的阅读菜单界面与各项优化
* 初始版本

* refactor(reader): MVI architecture + menu settings overhaul

MVI/UDF Architecture:
- Add ReadBookContract: UiState, Intent, Effect, Sheet, Dialog, ConfigUpdate
- Refactor ReadBookViewModel with onIntent() entry point
- Add ReadBookScreen/ReadBookRouteScreen stateless composables
- Add ReadBookColorTheme for reader-specific theme override
- Add ReadConfigContract for read config screen MVI

ReadStyleSheet Decomposition:
- Split ReadStyleSheet into SystemMenuPage, TextTitleSheet,
  HeaderFooterPage, TitleBarIconSheet, GlobalThemePage
- Each page owns its tab state, color picker, and config mutations

Data Layer (DataStore-backed Repositories):
- Add ReadSettingsRepository with ReadPreferences flow
- Add MangaSettingsRepository with MangaPreferences flow
- Add ReadAloudSettingsRepository for TTS settings
- Add ReadStyleRepository (file I/O for read style configs)
- Add ReadBookStyleConfigRepository (repository boundary)
- Add ReadStyleResolver for background/theme resolution
- Remove legacy ReadTipConfig (merged into ReadBookConfig)
- Register all new repositories in Koin appModule

Menu Settings:
- Add unified border settings (width, color, colorNight) for
  both top and bottom bars with drawWithCache + drawPath
- Add ColorModePill with light/dark toggle and '+' icon for
  no-color state in TinySettingItems
- Add TinyClearColorModeSettingItem for border color config
- Add menu color customization (bg, accent, container) with
  day/night variants and seed color mode
- Add bottom bar layout settings (corner radius, margins)
- Add custom icon support for menu buttons and title bar icons
- Add title bar icon position setting

Config Pipeline:
- Consolidate all ReadBookConfig mutations into typed ConfigUpdate
  sealed interface with legacy UP_CONFIG code mapping
- Add resolvedMenuBorderColor (auto day/night switching)
- Add 20 new PreferKey constants for menu settings
- Update manga config dialogs to use MangaSettingsRepository
- Update ReadConfigViewModel with DataStore flow observation

* feat(reader): add liquid glass menu bars and floating bottom bar

- Integrate com.kyant.backdrop 2.0.0 for liquid glass blur/vibrancy
  effects on reading menu top bar and bottom bar (Android 13+)
- Add floating bottom bar toggle replacing manual margin sliders
- Extract ReadMenuConfig data class for proper MVI state management
  of all menu configuration properties
- Enable edge-to-edge in BaseComposeActivity, remove manual
  navigation bar color management across base classes and controller
- Fix fullScreen() to use setDecorFitsSystemWindows(false)

* Refactor series button rendering

* 实现液态玻璃

* 优化液态玻璃

* @
fix(reader): fix MVI behavior issues and improve sheet lifecycle

Behavior fixes:
- Fix AddSourceAsNewBook empty implementation — wire intent to addToBookshelf
- Fix content edit loading stuck on null chapter/content — use onFinally
- Fix cannot save empty content — remove isEmpty guard, use title as loaded proxy
- Fix bookmark not opening — use openReadMenuRoute instead of dead activeSheet path
- Fix chapter source sheet persists — animate dismiss via show param before removal
- Fix chapter source reopens to TOC — reset showToc in initData
- Fix SaveChapterContent saves to wrong chapter — carry chapterIndex in intent
- Fix chapter source search runs after dismiss — cancel searchJob in dispose
- Fix "go to background" button in ReadAloud — use CloseReadBook intent

Architecture improvements:
- ReadMenuConfig uses ImmutableMap for Compose stability
- Fix stale remember in ReadBookMenuBar title bar icons
- Move icon picker file IO from composable to ViewModel
- Route launcher results through MVI intents instead of direct calls
- Fix ChangeChapterSource effect collector key — use viewModel not Unit
- Make ReadAloudConfigSheet UDF-compliant — stateless with intents
- Remove main menu buttons from AutoRead and ReadAloud sheets
@

* @
refactor(reader): use Material Icons and ConfirmDismissButtonsRow

- TitleBarIconSheet: replace drawable resources with Icons library, use
  ConfirmDismissButtonsRow for save/cancel buttons
- SystemMenuPage MenuCustomIconSheet: same icon and button treatment
- ReadBookMenuBar: update ToolButtonDef/TitleBarIconDef to use ImageVector
  instead of drawable resource Int
- Use AutoMirrored variants for List and HelpOutline icons
@

* feat: 优化液态玻璃

* feat: 优化液态玻璃

* fix(AppLogSheet): 从本地文件读取日志,替代内存列表

* @
feat(reader): highlight rules, theme refactor & MVI improvements

- Add HighlightRule entity, DAO, and config/edit sheets
- Add ThemeConfigStore, remove OldThemeConfig
- Refactor ReadBookContract/ViewModel/Screen for deeper MVI
- Add CharStyle for text rendering, refactor TextLine/TextChapterLayout
- Add SectionTitle, TinySettingItems UI components
- Remove legacy XML layouts (regex_color_config)
- Update database schema to v90
- Various sheet and widget refinements
@

* @
fix: address PR review feedback

- ReadStyleRepository: fix copy-paste bug (bgStrNight→bgStr) + add bgTypeNight import
- BgImageSpan: replace Bitmap.createScaledBitmap with BitmapShader matrix scaling
- HighlightRule: use UUID.randomUUID() instead of System.currentTimeMillis()
- ChangeSourceSearchUseCase: guard against empty chapters list
@

* @fix: remove residual regexColorRules references after merge

- ChangeSourceSearchUseCase: adapt filter lambda to new 3-param signature
- TextChapterLayout: remove globalRegexResult field, preApplyRegexColorRules
  call, and the entire regexColorRules fullTextBuilder block
@

* fix: 图标间距
2026-06-07 18:28:33 +08:00
HapeLee 116762f826 fix: 优化搜素逻辑 2026-06-07 01:09:24 +08:00
HapeLee adc7738627 fix: 部分发现项无法同行显示 2026-06-07 01:09:24 +08:00
HapeLee e592fcdebf fix: 不再使用脆弱的反射进行备份与恢复 2026-06-06 13:40:57 +08:00
HapeLee b1ef0098d4 Merge branch 'main' of https://github.com/HapeLee/legado-with-MD3 2026-06-06 03:08:54 +08:00
HapeLee 63daf5d842 fix: use null-safe access for matcher.group(1) in fullTextBuilder
Prevents potential NPE when imgPattern matches but group(1) is null.
2026-06-06 02:59:29 +08:00
HapeLee 74618447cd fix: 发现页首页筛选问题 2026-06-06 01:53:00 +08:00
HapeLee 8633dd775f fix: 多张封面导入问题 2026-06-06 01:41:26 +08:00
HapeLee 451f2f8875 feat: 更新Ktor版本 2026-06-06 01:28:43 +08:00
HapeLee 1021e1086f fix: WebService 启动崩溃与关闭卡顿 2026-06-06 01:28:20 +08:00
aoi cb5108933e 优化代码 2026-06-05 00:06:46 +08:00
aoi 6d19b26b1f 支持regex全文匹配 2026-06-04 23:56:07 +08:00
HapeLee e6dcc7229f fix: 源变量无法设置的问题 2026-06-04 00:59:30 +08:00
WangXuanMeng b25244fcde feat: 实验室设置+护眼模式+Web清理
合并 PR #1278 by fjsuta
2026-06-02 18:32:28 +08:00
aoi 5da2e85395 feat: 保留ExpandedSourceSheet的浏览进度
合并 PR #1279 by woruteyqi
2026-06-02 18:32:04 +08:00
HapeLee b6b671ef7f Merge branch 'main' of https://github.com/HapeLee/legado-with-MD3 2026-06-01 00:35:04 +08:00
Kudomaga af5f53c6a4 Merge pull request #1251 from fjsuta/trae/solo-agent-vhkVM3
feat: 检查WebDav备份无响应问题
2026-06-01 00:33:51 +08:00
fjsutaandtraeagent d0e057e091 feat: 检查WebDav备份无响应问题
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
2026-05-31 14:37:48 +00:00
HapeLee 6cc229d9b9 @
revert: 回退rhino版本至1.8.1,移除1.9.1适配代码

- rhino 1.9.1 → 1.8.1
- VMBridgeReflect: 移除Context/ContextFactory fallback,恢复VMBridge反射
- ReadOnlyJavaObject/NativeBaseSource: 移除TypeInfoFactory适配,恢复Class<*>?构造
@
2026-05-31 22:03:33 +08:00
IsilsolmeandClaude Opus 4.8 947dbbfff1 Sort imports in PrefDelegate.kt
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:52:05 +08:00
IsilsolmeandClaude Opus 4.8 6ebe36dec9 Refine: make synchronous pref writes opt-in via sync parameter
Only use commit() (sync disk write) for preferences that opt in with
sync=true. The language preference in OtherConfig is currently the only
one that needs this — it triggers an immediate process restart via
context.restart().

Other string preferences continue using apply() (async) to avoid
unnecessary main-thread blocking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:51:35 +08:00
IsilsolmeandClaude Opus 4.8 59468d1bc2 Fix language preference not persisting after app restart
Use commit() instead of apply() for String preference writes to ensure
the value is written to disk synchronously before the process is killed
during restart().

Root cause: SharedPreferences.apply() writes to memory immediately but
commits to disk asynchronously. When context.restart() calls
Process.killProcess()+exitProcess(0) immediately after writing the
language preference, the async disk write may not complete, causing the
new process to read the old value.

Closes #862

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:45:11 +08:00
HapeLee c63cf8921d 备份问题 2026-05-31 01:25:28 +08:00
HapeLee f0fe3875ab 书籍管理界面不显示音频类 2026-05-31 01:25:26 +08:00
Duanhlandduanhl 978d6d2840 fix: 翻译功能的一些小优化和修复 (#1225)
1. llm温度是可调的,对于ds而言,翻译1.3最佳,默认值调整成该值
2. 翻译字典,最多允许从50增加到80,取头尾各一半,因为小说出场最早和最近的人最重要

Co-authored-by: duanhl <duanhl7749@gmail.com>
2026-05-30 03:50:34 +08:00
HapeLee f8f19f7379 备份问题 2026-05-30 01:16:23 +08:00
HapeLee b408ba580a fix: restore backup JobCancellationException on Activity relaunch
Move restore coroutine from rememberCoroutineScope() to viewModelScope
so it survives Activity recreation during config changes.
2026-05-29 22:53:57 +08:00
HapeLee a512ad0b4a 一些界面优化 2026-05-29 01:27:56 +08:00