Translation queue: batch + per-job status, independent of dialogs - #31
Merged
Conversation
…y translations, watch progress from the history page (strip + per-card badges), get toasts on completion — closing the viewer dialog no longer loses the job.
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.
背景
历史详情里的"翻译成X"此前是阻塞在对话框里的一次性动作:关掉对话框就看不到进度,也无法排队多个翻译。
改动与实现
queue_translation()入队(按 源+目标 去重、目标已存在拒绝),单工作线程顺序消费(Ollama 本就串行);TranslationJob记录 queued/running/done/failed、块级进度(接通了原本丢弃的 stage progress 回调)、错误信息;translation_snapshot()供 UI 读取。队列非空时模型不卸载,靠 keep_alive 在真正清空后回收验证
uv run pytest -q:173 passed / 5 skipped。新增:队列时序(事件门控)——入队/去重/双任务顺序完成/进度到达任务/历史记录落盘/已存在目标拒绝;GUI 状态条与徽标渲染、完成 toast 恰好一次