功能:新增 Apple 视觉、图片翻译、智能缓存与可信局域网共享,并优化阅读链路 - #811
Open
NeuronCState wants to merge 104 commits into
Open
NeuronCState wants to merge 104 commits into
NeuronCState wants to merge 104 commits into
Conversation
NeuronCState
marked this pull request as ready for review
August 7, 2026 03:23
On macOS the window uses a hidden title bar with a full-size content view, so the traffic-light buttons overlay the top-left of the reading page. The AppBar forces its leading slot to leadingWidth (56px), so widen it and pad the BackButton so it no longer sits underneath the traffic lights. Applies on macOS only. Co-Authored-By: Claude <noreply@anthropic.com>
…le settings - route image/page caches into JHTData/temp/autotemp via vendored extended_image_library - add smart cache space limit and eviction policy (added date / usage frequency) - track cache usage stats for pages and images, direct md5 cache lookup - dedupe read-page parse tasks, bypass rate limit on cache hits, session-level parse cache - auto-retry failed online images once - collapse master-switch sub-options in Apple-style settings
…I layers - cover decode optimization setting (decode covers near display size) - image request timeouts + retry backoff (delayFactor 500ms) - tag refresh staleness filter; smart cache hit aggregation + atomic upsert - global image cache budget; isolate pool for HTML/JSON parsing - parallel startup init; download atomic writes (temp+rename) - archive streaming unzip + temp dir; 429 backoff auto-resume - reader scroll rebuild guards + jump prefetch; gid-scoped status fan-out - translation dimension probe via ImageDescriptor; overlay PNG encode off UI isolate - gzip page cache with legacy fallback (fromResponseAsync) - thumbnail sprite decode caps; gallery tag sort memoization
…batch - cancel the in-flight translation batch when leaving the gallery so OCR/API work is not carried on in the background - give online image fetches a 5s timeout and skip pages that are not loaded yet, so batch translation never stalls on unavailable images - guard each page of the batch loop so a single failure does not abort the rest Co-Authored-By: Claude <noreply@anthropic.com>
…slation menu Download engine hardening: - archive: null the completed downloadCompleter after success and guard completeError with isCompleted, so a failed move/unpack no longer throws StateError and permanently wedges the archive - gallery: cap the parse->download->re-parse loop with a consecutive-network- failure counter that pauses the gallery after 3 instead of retrying forever - fix _deleteImageInDisk resolving image.path relative to the visible dir - guard _updateProgressAfterImageDownloaded against double-counting (curCount) - contain copy/cache-step exceptions so a failure falls through to download instead of killing the task and leaving the image stuck - copy cached images via temp + atomic rename; write gallery metadata atomically and skip corrupted metadata files on restore - recover archives stuck in waitingIsolate across restarts - cancel archives before dropping the task; clean up .jdtemp/.jdcopy leftovers - guard EHExecutor rate limiter against maximum == 0 (divide by zero) Cache reuse (downloads reuse the read cache): - key the extended_image disk cache by the stable fileindex instead of the raw URL, which carries a rotating keystamp and alternates between /h/ and /om/ formats; a gallery read before now downloads straight from cache - count cache-copied bytes into the speed/progress display - copy cached images directly outside the rate-limited executor queue Read page: - consolidate the translate/show-hide/retranslate buttons into one that opens a small action menu (Apple action sheet or Material bottom sheet) Other: - add a Material ancestor under the Apple settings card so ListTile ink renders and the repeated "ink splashes may be invisible" global error stops - tests for cache-key stability, cache lookup, EHExecutor zero-rate Co-Authored-By: Claude <noreply@anthropic.com>
…ranslate menu - ColorScheme.fromSeed(black/white) derives pink/magenta tones for the roles not overridden, which leaked as pink sidebars and pink translation UI on iOS; override secondary/tertiary and their containers (plus inverse roles) with gray so the Apple style is monochrome on all platforms - read-page translate menu: replace the sheet-based entry with an anchored showMenu dropdown driven by an action enum Co-Authored-By: Claude <noreply@anthropic.com>
…Apple); gzip OCR result cache - New autoTranslateGalleryText setting, gated to Apple Live Text + on-device translation - translateGalleryText engine: concurrency-limited queue, in-flight dedupe, failure negative-cache, in-memory LRU + persistent gzip cache (reuses _compressJson/_decompressJson) - New EHTranslatedText widget (Text/SelectableText-compatible) with stale-result race guard - Comments translate per text run preserving HTML formatting; edit dialog shows original - Converted all gallery-title surfaces: list/waterfall/dashboard/history cards, details AppBar+main+subtitle, download grid/list/search pages - Settings toggle in Apple on-device path; i18n keys added to all 6 languages - Tests: autoTranslateGalleryText config round-trip Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # lib/src/pages/base/base_page.dart
NeuronCState
marked this pull request as ready for review
August 12, 2026 23:47
NeuronCState
marked this pull request as draft
August 13, 2026 11:57
NeuronCState
marked this pull request as ready for review
August 13, 2026 12:03
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.
改动概览
本 PR 集中改进 JHenTai 的阅读体验、图片翻译、本地推理、智能缓存、下载可靠性和可信局域网共享,同时加入可选的 Apple 风格界面。
现有 Material UI、普通联网阅读和第三方翻译路径继续保留。新能力不可用或运行失败时,应用会回退到兼容路径。
主要改动
Apple 风格界面
Reader Engine Test(可选)
ReaderPipelineScheduler。ReaderPerformanceGovernor会根据持续帧耗时调整预取范围和并发。智能缓存与下载可靠性
fileindex生成图片缓存键。/h/、/om/URL。Documents/JHTData。图片翻译
ONNX 推理与超分辨率
本地 GGUF 翻译
lib_llama_cpp接入进程内 llama.cpp 运行时。llama-server作为桌面端 loopback 兼容方式。阅读器操作
可信局域网共享
登录状态与历史同步
默认配置
主动广播可能向同一局域网中的新设备发起配对请求。登录同步包含 Cookie,建议只在可信网络中使用。
上游同步与兼容迁移
本分支已经同步最新上游
master,并解决相关合并冲突。gallerys到gallery/galleries的目录和类型重命名。originalImageUrl字段。top.jtmonster.jhentai,避免升级后产生新的应用容器。平台要求
建议审查顺序
lib/src/pages/read、lib/src/service/reader_*lib/src/service/image_translation_service.dart、lib/src/service/inference、lib/src/service/enginelib/src/service/lan_*、lib/src/model/lan_*lib/src/service/gallery_download、lib/src/database、lib/src/network/eh_cache_manager.dartlib/src/widget/eh_apple_controls.dart、lib/src/config/theme_config.dart、ios、macosthird_party/flutter_onnxruntime、third_party/extended_image_library验证结果
dart analyze没有 error,仓库仍有 warning 和 info。当前 PR 已同步上游,GitHub 状态为
MERGEABLE和CLEAN。