fix(local-asr): 下载进度全局浮层 + 进度节流 + 取消清理 + 看板过滤 + 3s 文件监测 - #925
Merged
Conversation
- 进度浮层全局化:新 GlobalDownloadProgress 自监听三引擎下载事件,挂 App 根, 主窗口所有页面常驻显示;含取消按钮(按引擎分派 cancel 命令) - Rust 进度事件 ≥150ms 节流(qwen3/sherpa/foundry),修进度条高频抽搐 - 取消下载清理 .partial/.partial.idx(sparse 预分配全长,1.7B 模型残留巨大), 新增 remove_partial_artifacts 单测 - 看板只列已下载/下载中的模型(下载弹窗保留全目录列表),条目行距加大 - 3s 轮询磁盘状态 + 选中瞬间校验 + 下载事件驱动刷新;fetchAll 按平台分支 (macOS 上 sherpa/foundry catalog 命令未注册导致 Promise.all 整体失败) - 同 provider 切换模型走轻量路径 + 乐观 draft 值,修下拉闪回旧模型
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.
目标
一轮解决本地 ASR 下载/管理的前端体验问题:进度条全局可见且不抽搐、取消下载真正清理磁盘、看板只显示已下载模型、磁盘文件变化 3 秒内自动跟随、同供应商切换模型不再闪烁。
改动
Rust(src-tauri)
asr/local/download.rs/sherpa_download.rs/foundry_runtime.rs:进度事件 ≥150ms 节流(原来每个 HTTP chunk emit 一次,前端进度条高频刷新「抽搐」).partial/.partial.idx(sparse 预分配全长,1.7B 模型残留可达 1.7GB),新增remove_partial_artifacts纯函数 + 单测(915 pass)前端(src)
components/GlobalDownloadProgress.tsx:自监听三引擎下载事件、portal 到 body,挂 App 根——主窗口所有页面右上角常驻显示,含取消按钮;与页面 state 解耦fetchAll在 macOS 上拉 sherpa/foundry catalog(命令未注册)导致 Promise.all 整体失败、下拉永远为空 → 按平台分支兼容性
GlobalDownloadProgress组件挂在 App 根(纯展示)测试
cargo test --manifest-path src-tauri/Cargo.toml:915 passed / 0 failednpm run build:tsc + vite 通过npm test:16 项契约全过证据路径
DMG 构建后附截图。